Forum: FPGA, VHDL & Verilog floating point / real number

von soumava r. (Company: student) (soumava)

Rate this post
0 useful
not useful
i m working on a vhdl project which requires the use of floating point 
numbers ? please let me knew if there is any available source code for 
the same?

von Lothar M. (lkmiller) (Moderator)

Rate this post
0 useful
not useful
Up to now real numbers aren't synthesizable "automatically". You 
cannot write:
signal r, a, b, c, x, y, z : real;
  c <= a-b+3.3;
  z <= x+y;
  r <= c*z;
Instead you must implement the datapath by using IP-Cores or coding by 

WHAT is your actual problem?
WHY do you need floats?

von Oliver H. (ollih)

Rate this post
0 useful
not useful
Do you realy nead "floating point" or does fixpoint fits to your 

So you could consider your integer variables as fixpoint values e.g. a 
8bit integer as a fixpoint with 4 integer and 4 fractional digits:
  deciaml    binary
     0.06125 0000_0001
     0.125   0000_0010
     0.5     0000_1000
     1.0     0001_0000
     3.75    0011_1100

von soumava r. (Company: student) (soumava)

Rate this post
0 useful
not useful
i am working on implementation of neural networks on FPGA. which 
requires addition and multiplication of real numbers.
i am and Electronics and communication student. i dont know what is IP 
My professors have told me that i should define the package for using 
real numbers.

von Ale (Guest)

Rate this post
0 useful
not useful
... do you know what is a real number ? look for IEEE754 for example
... what range/precision do you need ? how big/small accurate should 
they be ?  (maybe fixed point is the way to go).

look at opencores.org, there are some fpu implementations there...

von pks (Guest)

Rate this post
0 useful
not useful
I think in case of an FPGA-implementation of a neural network (mlp?) you 
will have a big amount of parallel mult operations, which means a lot of 
ressource-requirement especially in case of float values. First you 
should check if you really need fp-precision.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.