Forum Discussion
Altera_Forum
Honored Contributor
18 years agoBit extending when adding
Hello, I'm trying to add an signed std_logic_vector(21 downto 0) with a std_logic (unsigned) using the vhdl operator "+". I'm using the "IEEE.std_logic_signed.all" library . I just assumed that...
Altera_Forum
Honored Contributor
18 years agoThank you for the input. I'll take a look at the numeric_std library. Not beeing able to multiply std_logic_vectors with std_logics is not a large problem when designing something new. For the moment I will do like this:
p_value_rounded <= sxt(p_value_truncated,23) + p_value_carry_ext;
where p_value_carry_ext is p_value_carry extended with a zero just to be on the safe side with the sign. Best Regards, Ola Bångdahl