0
\$\begingroup\$

does anyone knows how is the fast way to perform a floating point exponential operation? (like this y = 2.71^(3.45)) Thank you to all posible links to references or articles.

EDIT:

I am pondering several possibilities:

Doing by System Generator (I am using the 9.2.01 version)

Using some Free Xilinx IP

Using some open libraries like:

Using an open-source ALU

\$\endgroup\$
  • \$\begingroup\$ What format floating point? IEEE754 single or double? Or can you use funky custom formats (as you are targetting an FPGA)? \$\endgroup\$ – Martin Thompson Feb 3 '11 at 13:26
  • \$\begingroup\$ Well, whatever... I´m using a virtex 4. \$\endgroup\$ – Peterstone Feb 4 '11 at 14:31
1
\$\begingroup\$

Well, I don´t know if this is the fast way to perform a exponential operation. But you can try to do a LUT. You have to thing in the dynamic range of your signal, the maximun and the minimun value. And depend of the accuracy you want to have in your design. For instance, imagine the dinamyc range of the signal is (-1,1) and the accuracy is fo three 3 digits, (0.567,-0.237,0.457...) So there are 2000 possible values. So the LUT will have 2000 files.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I got confused by the third person in your answer... Weren't you the one that asked the question on the first place? ;] \$\endgroup\$ – jpc Apr 14 '11 at 11:03
  • \$\begingroup\$ Well, I am the same person in both cases, It´s more natural to me to wrote the answer in that way. Besides I could have sense for a person who just only is reading without take care who write the question and who answer it. \$\endgroup\$ – Peterstone Apr 15 '11 at 15:21
1
\$\begingroup\$

The first step in performing a floating-point exponential operation is to scale things so that you're trying compute 2^(someInteger / powerOfTwo). This will easily reduce the problem to one of converting a value between 0 and 1, into a value between 1.00 and 1.99+. Let's suppose that we have a 32-bit integer and a scaling factor of 2^24. The upper 8 bits of that integer can easily yield the exponent for the result. As a rough approximation (to show how things are done), scale things so that the bottom 20 bits of the exponent will yield a value between 1.0 exactly and 1.04427378. Use bits 20-21 of the exponent to pick an entry from the table (1.0, 1.04427378, 1.09050773, 1.13878863) and multiply by that, and then use bits 22-23 to pick an entry from (1.00, 1.18920711, 1.41421356, 1.68179283) and multiply by that.

Note that this approach won't yield precise results, but it can achieve reasonably fast results with a reasonable amount of hardware. Using more lookup table steps can increase precision at the expense of time and hardware. Using larger lookup tables can increase precision at a given speed at the expense of hardware.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.