Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Re: Please review my float package

 
Thread Tools Search this Thread
Old 08-15-2003, 06:32 PM   #1
Default Re: Please review my float package


Jerker Hammarberg (DST) wrote:

> I put together a generic floating point package that performs addition,
> subtraction, multiplication and comparison. Contrary fphdl
> (www.eda.org/fphdl), it is synthesizable with Xilinx XST - that's why
> I made my own. Anyway, I present it here in the hope that anyone may
> wants to look through it for
> * possible optimizations, particularly for implementation size,
> * language misuse or simplifications,
> * bugs,
> * or actually, any possible improvements.


Consider:

1. A simple testbench with an assertion for each function.
2. numeric_std:

-- use ieee.std_logic_arith.all;
use ieee.numeric_std.all;

m := "01" & shift_left((m(size-3 downto 0))
to_integer(to_unsigned(leftshift,EXPSIZE)));

-- m := "01" & shl(m(size-3 downto 0),
-- conv_unsigned(leftshift, EXPSIZE));

-- rsres := shr(rsarg1, rsarg2);
rsres := shift_right(rsarg1, to_integer(rsarg2));

-- return conv_std_logic_vector(result, TOTALSIZE);
return std_logic_vector(result);


-- return conv_std_logic_vector(result, TOTALSIZE);
return std_logic_vector(result);



-- Mike Treseler



Mike Treseler
  Reply With Quote
Old 08-15-2003, 06:42 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: Please review my float package
missed a comma \

m := "01" & shift_left((m(size-3 downto 0)) ,
to_integer(to_unsigned(leftshift,EXPSIZE))) ;

-- Mike Treseler




Mike Treseler
  Reply With Quote
Old 08-18-2003, 07:56 AM   #3
Tim Hubberstey
 
Posts: n/a
Default Re: Please review my float package
"Jerker Hammarberg (DST)" wrote:
>
> > 2. numeric_std:

>
> This is interesting... what is the difference between numeric_std and
> std_logic_arith? I can see the former is slightly more readable. Is it also
> more efficient?


I don't know for sure about efficiency but I doubt there is any
appreciable difference since efficiency is determined primarily by the
tool, not the package, unless you have optimization turned off.

The most important difference is that numeric_std is an IEEE standard
while std_logic_arith actually has several different (and incompatible)
versions, depending on whose tool you're using. If you want your code to
be portable, use numeric_std.
--
Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com


Tim Hubberstey
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
TheDigitalReview: DO YOU BELIEVE IN MIRACLES? - DVD REVIEW Mike McGee DVD Video 0 02-09-2004 08:15 PM
TheDigitalReview: WILLIAM GIBSON: NO MAPS FOR THESE TERRITORIES - DVD REVIEW Mike McGee DVD Video 0 12-08-2003 02:02 AM
TheDigitalReview: BABE SPECIAL EDITION - DVD REVIEW (User Review) Mike McGee DVD Video 0 12-04-2003 04:52 AM
TheDigitalReview: HUD - DVD REVIEW Mike McGee DVD Video 0 11-22-2003 10:34 AM
TheDigitalReview: THE JAMIE KENNEDY EXPERIMENT - COMPLETE FIRST SEASON - DVD REVIEW Mike McGee DVD Video 0 11-21-2003 12:07 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46