Concatenation

Formal Definition

Predefined adding operator for any one-dimensional array type.

Description

The concatenation operator (denoted as &) composes two one-dimensional arrays into a larger one of the same type. A single element can be used as any of the two operands of concatenation. If two single elements are concatenated, then the result can be of any array type (as long as it is compatible with the type of the operands).

The resulting array is composed of the elements of the left operand (in left-to-right order) followed by the elements of the right operand (in the same order). The direction of the resulting array is the same as of the left operand, unless the left operand is a null array, in which case the direction of the result is that of the right operand.

Examples

variable ByteDat : Bit_Vector(7 downto 0);
alias Sign : Bit is ByteDat(7);
alias Modulus : Bit_Vector(6 downto 0) is ByteDat(6 downto 0);
constant FourZeros : Bit_Vector(3 downto 0) := "0000";
constant ResetHigh : Bit_Vector(7 downto 0) := FourZeros & "1111";
constant ResetAll : Bit_Vector(7 downto 0) := FourZeros & FourZeros;
ByteDat := '1' & Modulus;

Important Notes

· The declared number of elements in the result array must be large enough to cover the number of both operands added.

No comments:

Post a Comment

Please provide valuable comments and suggestions for our motivation...

Popular Posts