floating point / real number

Moderator (Company: Titel) #3041233
Up to now real numbers aren't synthesizable "automatically". You 
cannot write:
1
signal r, a, b, c, x, y, z : real;
2

3
  c <= a-b+3.3;
4
  z <= x+y;
5
  r <= c*z;
Instead you must implement the datapath by using IP-Cores or coding by 
yourself.

But:
WHAT is your actual problem?
WHY do you need floats?
#3041912
Do you realy nead "floating point" or does fixpoint fits to your 
project?

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
OP (Company: student) #3042513
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 
core.
My professors have told me that i should define the package for using 
real numbers.
Guest #3065200
... 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...
Guest #3065234
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.

Reply

A question of your own? This thread is over 13 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.