Interesting details of ieee.fixed_pkg

Today I learned that in order to assign a negative sfixed (signed fixed-point) signal or variable to another signal or variable, I have to use resize.

process
variable x0: sfixed(7 downto -8) := to_sfixed(1, 7, -8);
constant val: sfixed(7 downto -8) := to_sfixed(10, 7, -8);
begin
-- does not work:
x0 := -val;

bowfinger.de/blog/2023/05/inte

#vhdl2008 #fpga #vhdl #ghdl

Last updated 1 year ago