02-26-2018 02:32 AM
Hi all,
Any idea how I need to use power of X function in FPGA. It is not available there, any idea how it works in FPGA?
02-26-2018 02:43 AM
02-26-2018 02:55 AM
Thankyou,
I was thinking if there is ready function. I will do in that way.
02-26-2018 09:16 AM
@GerdW wrote:
use a loop to calculate (positive integer) powers of a value!
For negative integer powers, compute 1/(x^|n|), i.e. the reciprocal of the positive integer power. If n is small (say < 8), a For loop to do n multiplications is simple and quick. If n is large, you can express it as a binary integer and work with squares of x (i.e. n = 10 = 1010b, compute x^2 and ((x^2)^2)^2 and multiply them together. Note that you should probably do some timing tests to verify that the squaring method (a) works and (b) "makes a difference".
Bob Schor