Altera_Forum
Honored Contributor
16 years agovhdl addition result size
Hello, maybe a dummy question:
I am using arith package. If I need to add 2 signed std_logic_vector of 3 bits, The output should be a std_logic_vector of 4 bits, 3+3=6 ----->b"011" + b"010" = b"0110" -3-3=-6 ----->b"101" + b"101" = b"1010" A,B:std_logic_vector(2:0); result:std_logic_vector(3:0); but if I do this assignation result<=A+B; quartus said me "expression has 3 elements, but must have 4 elements" Thank you.