Error in LRM: Table G.2—Index range of result of an operation
It seems that the Result Range of the reciprocal operations for "Signed reciprocal(A)" and "Unsigned reciprocal(A)" are swapped in "Table G.2—Index range of result of an operation" (page 571) of the IEEE Std 1076‐2019
Looking into the implementation they are as follows:
- Signed reciprocal(A) -> –A'right + 1 downto –A'left
- Unsigned reciprocal(A) -> –A'right downto –A'left – 1
Here is a snippet of the VHDL (https://github.com/FPHDL/fphdl/blob/master/fixed_pkg_c.vhdl)
-- These functions return 1/X -- 1 / ufixed(a downto b) = ufixed(-b downto -a-1) function reciprocal ( arg : UNRESOLVED_ufixed; -- fixed point input constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed;
-- 1 / sfixed(a downto b) = sfixed(-b+1 downto -a) function reciprocal ( arg : UNRESOLVED_sfixed; -- fixed point input constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed;
If one goes into the package body (because does not trust the comments above) will lead to the same conclusion.