Looking at the fixed and floating point to_signed and
to_unsigned functions. The overflow is silent in these functions.
Thus if you do a:
signal uns : unsigned (2 downto 0);
signal uf : ufixed (8 downto -1);
signal ufl : float (5 downto -5);
uns <= to_unsigned(8, uns); -- returns "7" and an overflow warning
uf <= to_ufixed (8, uf);
uns <= to_unsigned (uf, uns); -- returns a "7" and is silent
ufl <= to_float (8, ufl);
uns <= to_unsigned (uf, uns); -- returns a "7" and is silent
Should I make these spit out a warning if they overflow?
For the "to_float" there is a concept of "infinity", so that is what
I return (silently).
For "to_ufixed" and "to_sfixed" I return the maximum number (silently)
if I get an overflow.
Opinions please?
-- David W. Bishop dbishop@vhdl.org All standard disclaimers apply.Received on Mon Jan 24 12:55:53 2005
This archive was generated by hypermail 2.1.8 : Mon Jan 24 2005 - 13:01:12 PST