Using concatenation operator in VHDL

Status
Not open for further replies.

lahrach

Full Member level 3
Joined
Feb 6, 2009
Messages
170
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,285
is this statement correct

clumn_fault : std_logic_vector(1 downto 0);

clumn_fault<= (outp_1 xor outp_2) & (outp_1 xor outp_3);

thanks
 

Re: quik quetion vhdl

The concatenation operator in this case produces a data type equivalent to an element of the result data type STD_LOGIC_VECTOR. Hence the result will be the data type of STD_LOGIC_VECTOR, if outp_1, outp_2 and outp_3 are defined as STD_LOGIC.

So the following should work if the data types are defined correctly.

Code:
clumn_fault : std_logic_vector(1 downto 0); 

clumn_fault <= (outp_1 xor outp_2) & (outp_1 xor outp_3);

If you are still have problems, then another way to accomplish this would be:

Code:
clumn_fault : std_logic_vector(1 downto 0); 

clumn_fault(0) <= outp_1 XOR outp_2;

clumn_fault(1) <= outp_1 XOR outp_3;

This is assuming outp_1, outp_2 and outp_3 are STD_LOGIC.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…