Mobile
Verilog Online Help Prev Page Prev Page
Table of Contents
Bit-select
Block Statements
Built-in Primitives
Case Statement
Continuous Assignments
Conversion Functions
Comments
Compiler Directives
Concatenations
Conditional Operator
Delays
Disable Statement
Display Tasks
Edge Sensitive Path
Expression Bit Length
File I/O Functions
Functions
Identifiers
If Statement
Integer Constants
Intra-assignment Timing Controls
Keywords
Loop Statements
Memories
min:typ:max Delays
Module Declaration
Module Instantiation
Module Path Declaration
Module Path Polarity
Net Data Types
Operators
Parameters
Part-select
PLA Modeling Tasks
Probabilistic Distribution Functions
Procedural Assignments
Procedural Continuous Assignments
Procedural Timing Control
Range Specification
Real Constants
Register Data Types
Simulation Control Tasks
Simulation Time Functions
Specify Block
State Dependent Path
Stochastic Analysis Tasks
Strengths
Strings
Structured Procedures
Tasks
Timescale System Tasks
Timing Check Tasks
UDP Declaration
UDP Instantiation
UDP State Table
Value Change Dump (VCD) File
Vectors

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

  • Repetition multiplier should be a constant expression.

  • Unsized numbers are illegal in concatenations (except as repetition multiplier).

 

Powered by IXwebhosting