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;
https://bowfinger.de/blog/2023/05/interesting-details-of-ieee-fixed_pkg/