String

LRM §2.6.

Strings are 8-bit ASCII characters.

Syntax:

"string"

Description:

String values can be stored in registers. They can be assigned, concatenated and compared in the same way as numbers. Strings can also be used as arguments to system tasks like $display and $monitor.

A string may not span multiple lines and may contain special characters as shown in the table.

Character

Meaning

\n

New line

\t

Tab

\\

Backslash

\"

Double quote

\ddd

Octal code

%%

Percent sign

Example:

"This is the first line\n This is the second line"
reg [11*8:1] R1;
R1 = "Hello World";

Notes:

See also:

Number, $display