RE: [vhdl-200x-ft] fixed and floating point to_signed

From: <ryan.w.hinton@L-3com.com>
Date: Thu Jan 27 2005 - 14:57:40 PST

David,

I think they should both issue overflow warnings, though I wouldn't be sad
if the "to_float" did not since an infinite value can be detected and
flagged.

---
Ryan Hinton
L-3 Communications / Communication Systems - West
ryan.w.hinton@L-3com.com
-----Original Message-----
From: David Bishop [mailto:dbishop@vhdl.org]
Sent: Monday, January 24, 2005 1:55 PM
To: vhdl-200x-ft@eda.org
Subject: [vhdl-200x-ft] fixed and floating point to_signed
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 Thu Jan 27 14:58:00 2005

This archive was generated by hypermail 2.1.8 : Thu Jan 27 2005 - 14:59:51 PST