Forum Discussion
Altera_Forum
Honored Contributor
10 years agoYou are aligning the data on the LSB. Don't do that - you want to align it on the sign bit.
For a 32-bit signed integer, bit-31 is the sign bit. For a 14-bit signed number, bit-13 is the sign bit: out <= in & "00" Alternatively, you can propagate the sign bit to all of the high bits: out <= (12 downto 0 => in(12 downto 0), others => in(13)) - or something like that.