exp(-x) function

Mar 30, 2005 4 Replies

I'm new to math function on FPGA, but I need to calculate exp(-x) wit a Spartan3 in fixed point 16bit numbers. How can i do that? What's th best way? Can someone hel me?[size=24:ae1f1145a8][/size:ae1f1145a8



Depends on what is the range of parameters. Your statement "fixed point 16bit numbers" doesn't help much, because it doesn't specify any particular encoding -- is it 8 bits for the integral part and 8 bits for fractions or only 16 bits of fraction, which describe a number in the range of (-1,1) or something else?

As I said, it depends.

Best regards Piotr Wyderski

I've posted on this subject before (search google using andraka and exp) here is one such posting that is probably the closest to what you want:

formatting link

--Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759

formatting link

Most likely that's the way to do it. An alternative would be a hyperbolic CORDIC, also explained by Ray:

formatting link

Kolja Sulimma

If I needed high precision or for some reason could not use reasonably sized look-up tables, I'd consider a hybrid of these two, replacing the look-up with a CORDIC exp(x) after performing the normalize to strip off the integer part. The look up method I described in my prior post will get you plenty of precision for most applications.

--Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required