rtl

P

Patrice

Helo
I use quartus web edition, and made me some routines but
sundely a saw that there is no math_real library in quarus !
Does it mean what mathematical operation on real cannot be made
with this board ?? (i'm interrested in sqrt function)

Thanks for reply
 
A

Allan Herriman

Helo
I use quartus web edition, and made me some routines but
sundely a saw that there is no math_real library in quarus !
Does it mean what mathematical operation on real cannot be made
with this board ?? (i'm interrested in sqrt function)

Synthesisers don't support real numbers for general use (AFAIK), so
this will be a problem with any board.

You have several options:
- recode your design to use fixed point
- implement your own floating point
- use some sort of hybrid approach, e.g. block floating point.

Also reconsider your "need" for a square root. Are you performing a
cartesian to polar conversion? There are several ways of doing that
which are more efficient that the canonical schemes.

Regards,
Allan.
 
A

Anthony J Bybell

Patrice said:
Helo
I use quartus web edition, and made me some routines but
sundely a saw that there is no math_real library in quarus !
Does it mean what mathematical operation on real cannot be made
with this board ?? (i'm interrested in sqrt function)

Thanks for reply

As a side note (this has nothing to do with Quartus or even VHDL), for
some applications calculating the inverse square root may prove more
useful or be faster. (e.g., if you have to divide by the square root
of something, it's faster to multiply by its inverse.)

http://www.finesse.demon.co.uk/steven/invsqrt.html

-t
 
K

Ken Smith

Helo
I use quartus web edition, and made me some routines but
sundely a saw that there is no math_real library in quarus !
Does it mean what mathematical operation on real cannot be made
with this board ?? (i'm interrested in sqrt function)

real=sqrt(real) Forget it

integer=sqrt(integer) Yes in more than one clock

fixedpoint=sqrt(fixedpoint) same as integer

If you can take more than one clock cycle to do it, you can make an
integer or fixedpoint SQRT. The trick is to use Booths[1] method.

[1] At least I think it was Booth, Gauss may be the real father of this.


Basic rule:

N^2 = the sum of the first N odd numbers.

Stupid method = subtract 1,3,5,7.. until it crosses zero.

Optimization:
If you multiply N by 2, you multiply N^2 by 4. As a result, you can get
there quicker if you include some shifting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top