Concatenation means connecting two one-dimensional arrays to each other by using an adding operator. ┬á(&) sign is used to join the arrays of same type. The result of this joint is emerged according to process order. It means that a value which is on the left side of the operator sign, becomes first in the result.
NOTE: It is important to define the size of the array such as it should not exceed the dimensions of the elements to be combined.
A & B = 0 01;
A & C= 0 011;
B & D=01 1100;
C & B= 011 01;
A & B & C= 0 01 011;
EXAMPLE 2 (Shifting Numbers To The Right)
entity Shifting is
Generic( capacity : integer := 10);
Port ( CLK : in STD_LOGIC;
DATA : in STD_LOGIC;
OUTPUT : out STD_LOGIC);
architecture Behavioral of Shifting is
signal shifting_number: Std_Logic_Vector(capacity -1 downto 0):=(others=>'0');
--(others=>'0') means to assign '0' to all elements.
if rising_edge(CLK) then
shifting_number <= DATA & shifting_number ( (capacity -1) downto 1);
OUTPUT<= shifting_number (0 );
After simulating the program with ┬áModelSim, we get the plot below: