Concatenations
Formal Definition
The concatenation is the combination of two or more expressions.
Simplified Syntax
{expression_1, expression_2}
{multiplier{expression}}
Description
The concatenation is expressed by the brace characters {} bracketing
two or more expressions separated by commas (Example 1).
Concatenations can also be expressed using a repetition multiplier,
which duplicates the expression it contains the number of times
specified by the constant expression that precedes it (Example 2).
A concatenation expression can be either an identifier or a sized
number. Unsized numbers are illegal because the size of all operands
is required to calculate the size of an entire concatenation. A
repetition multiplier should be a constant expression specified
within the brace characters.
Examples
Example 1
reg [7:0] a;
{a, 4'b1110, b[2:1]}
Result of this expression has 14-bits ('a' has 8 bits, 4'b1110 has 4
bits, b[2:1] has 2 bits).
Example 2
{a, {2{b, c, d}}, a}
The above concatenation is equivalent to the following concatenation:
{a, b, c, d, b, c, d, a}
Important Notes
|