Re: florating point and VHDL



On Oct 22, 11:14 am, Jonathan Bromley <jonathan.brom...@xxxxxxxxxxxxx>
wrote:
On Sun, 21 Oct 2007 21:07:04 -0700, Amit <amit.ko...@xxxxxxxxx> wrote:
Regarding floating point multiplication in VHDL. Can I use the regular
* operator or should I use Adder for this matter?

I think Mike Treseler is basically right. For simulation only,
you can just use ordinary VHDL variables of type REAL, and
all the normal arithmetic operations are available. math_real
provides all the usual mathematical library functions. But
if you are trying to build hardware, it's quite likely that
you only *think* you need floating-point, and in fact you
would be at least as well served by fixed-point arithmetic,
which is only integer arithmetic in party dress.

If you really, really want floating-point hardware, there
are two quick answers:
(1) look at the new IEEE synthesisable packages (they've been
mentioned here many times);
(2) you need both + and *. Very roughly:
- add the two exponents, not forgetting to subtract the bias
value if you are using a biased-exponent representation;
- multiply together the two fractions
- normalize the fraction (possible 1-bit left shift) if
necessary; if so, decrement the exponent by 1
- throw away the unused less-significant bits of the fraction,
having first done the necessary rounding on the more
significant bits.
Oh, and there are the special cases for zero, and proper
handling of Not-A-Number inputs, and overflow, and
denormalization if the exponent underflows, and choice of
rounding mode, and remembering to handle the hidden units
bit if you're using any of the standard formats, and
correctly manipulating the sign bit, and...

See what I mean? You really DON'T want floating-point, do you? :)
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.brom...@xxxxxxxxxxxxxxxxx://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.


Thanks to you guys but whatever I find it just theory. It seems nobody
likes the floating point as Jonathan pointed out!

I have 4 different books of vhdl and none of them has talked about
floating point multiplications. Currently I'm using Quartus II 6.1 and
it is shipped by the board on a CD but it is all verilog and even when
I follow its steps I get error during compilation (using
MegaFunctions) I really don't know what to do.


.



Relevant Pages

  • Re: florating point and VHDL
    ... If you really, really want floating-point hardware, there ... decrement the exponent by 1 ... having first done the necessary rounding on the more ... DOULOS - Developing Design Know-how ...
    (comp.lang.vhdl)
  • Re: is order urgent doubt
    ... Because double double (using a pair of doubles to represent a single ... floating-point number) in the general case doesn't adhere to the ... to restrict the exponents to make the fraction bits contiguous rather ...
    (comp.lang.c)
  • Re: How to "print" a "double" ?
    ... floating-point value into an integer exponent and a normalized ... fraction and printing them separately. ...
    (comp.unix.programmer)
  • Re: News on VHDL-200X
    ... p12 - Would it be more usal to call the 'fraction' of a floating-point ... The significand is similar to the fraction, ...
    (comp.lang.vhdl)
  • Re: ADO adDate Value Calculation
    ... but I don't know the formula for calculating the fraction of a day. ... Use floating-point ... Stephen Howe ...
    (microsoft.public.data.ado)