Our Monday Telecon will be dedicated to going over the action
items from the fixed point package.
The source code is at:
http://vhdl.org/vhdlsynth/proposals/dave_p3.html
> > Telecon information:
> >
> > 888-742-8686
> > 303-928-2600 (int'l)
> > Conference ID: 4737027
> > Time 2 PM PST Monday 7/12
Currently ufixed (5 dt 2) := ufixed (-1 dt -5) / ufixed(-1 dt -5);
doesn't work, but all other operations (including a normal divide
with a range like (5 dt -1)) does work.
Our agenda will be:
1) To vs downto interpretation of bit string literals
(reference FT09)
http://www.eda-twiki.org/vhdl-200x/vhdl-200x-ft/proposals/ft09_bit_string_literal.txt
Our argument is this:
variable a8r : ufixed (-1 to 7) := "010011100";
Is the result interpreted as 57 or 78?
Bit wise, if we reverse the range to be 7 downto -1 the result
would be 58. However, if we follow the rules from "numeric_std"
the answer would be 78.
2) Bit sizing rules (part 1):
Currently our bit sizing rules follow those of numeric_std
unsigned (a downto 0) + unsigned (b downto 0) = unsigned (max(a,b) downto 0);
Which actually tosses the overflow bit.
Proposed is the following:
ufixed(a downto b) + ufixed(c downto d) = ufixed(max(a,c)+1 downto
min(b,d))
But we do this, then "a <= a + b;" won't work.
An option on the last one.
If we leave the bit sizing rules for +, - alone, then
we can create the following operators "|+" and "|-"
3) Bit sizing rules (part 2):
a) For a multiply in numeric_std:
In numeric_std:
signed (a downto 0) * signed (c downto 0) = signed (a+c+1 downto 0)
unsigned (a downto 0) * unsigned (c downto 0) = unsigned (a+c+1 downto 0)
Proposed is:
ufixed(a downto b) * ufixed(c downto d) = ufixed(a+c+1 downto b+d)
ufixed(a downto b) * sfixed(c downto d) = sfixed(a+c+1 downto b+d)
sfixed(a downto b) * sfixed(c downto d) = sfixed(a+c downto b+d)
b) for a divide:
-- divide returns odd combination of widths
ufixed(a downto b) / ufixed(c downto d) = ufixed(a-d+1 downto b-c-1)
ufixed(a downto b) / sfixed(c downto d) = sfixed(a-d+1 downto b-c)
sfixed(a downto b) / ufixed(c downto d) = sfixed(a-d downto b-c-1)
sfixed(a downto b) / sfixed(c downto d) = sfixed(a-d downto b-c)
Note that from several post (and the problem I am currently having with
the packages) they appear to be problematic.
4) Overloading
Already included: ufixed + integer, ufixed + real, sfixed + integer,
sfixed + real
a) ufixed := ufixed + unsigned vs ufixed := ufixed + to_ufixed (unsigned,x,x)
sfixed := sfixed + signed
If we do this, then "ufixed := ufixed + "010011100" won't work.
b) sfixed := ufixed - ufixed;
c) sfixed := sfixed + ufixed; (- * /)
d) sfixed := ufixed + signed; (- * /) (once a signed number is involved
the result would be "sfixed")
-- NAME: David W. Bishop INTERNET: dbishop@vhdl.orgReceived on Sat Jul 10 13:04:34 2004
This archive was generated by hypermail 2.1.8 : Sat Jul 10 2004 - 13:06:12 PDT