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
- posted
19 years ago
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:
-- --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
Most likely that's the way to do it. An alternative would be a hyperbolic CORDIC, also explained by Ray:
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
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.