Re: [vhdl-200x-ft] Use of String Literals in Fixed Point and Floating Point Operations

From: David Bishop <dbishop@server.vhdl.org>
Date: Wed Jan 12 2005 - 12:08:40 PST

Jim Lewis wrote:

> Along the same lines, it may be useful to be able to
> extract the subtype of a data object so we can coerce
> the dimensions of another object. For example:
>
> signal A : sfixed(4 downto -3) ;
> signal Y : sfixed(5 downto -3) ;
>
> Y <= A + A'subtype("00110100") ; -- maybe it should be a'type?

Several ways you can do this. I already have the "from_string" commands.
I did this because of the problem with literal for floating point.
I am now extending it to fixed.

You can say:
Y <= A + from_string("00110100", 4, -3);
or
Y <= A + from_string("00110100", A);
OR
Y <= A + from_string("00110.100"); -- If no dot I would assume 7 downto 0.
or
Y <= A + from_hstring("68", A);
.....

-- 
David W. Bishop dbishop@vhdl.org       All standard disclaimers apply.
Received on Wed Jan 12 12:15:01 2005

This archive was generated by hypermail 2.1.8 : Wed Jan 12 2005 - 12:15:06 PST