I want to implement Sin, Cos and Tan functions over FPGA memory.
To implement a Sin function over the 0 to 360 degree range with a precision of 3 numbers after the decimal point, requires around 360,000 bits...This will eat away the memory resources very fast...
My question: Is there really dedicated ROM logic in the FPGA or it's just RAM with write enable tied to '0' ?
For the input I want to have two numbers after the deimal point:
0.00 to 360.00 for the input. If 36000 is "1000110010100000" - this means 16 input bits for the address (angle).
For the output:
0.000 for the output. 1000 is "1111101000" - 10 bit wide output.
3.6 - Mega bits of RAM for a single trig function!
If I take into consideration the periodic properties of Sin, I can use a quarter of that - but still, that's a lot!
For sine and cosine you only need a quarter of full function period. Just look at sine wave period and you can get it why. This is also why you don't need separate tables for sine and cosine. Also tangent is sin(x)/cos(x), but i don't know wheter this can be useful. Also you don't need that many points in your LUT, you can interpolate (at least that's what most FPGA DDS cores do)
I know about the properties of the trig functions.
As I said, I can do with a quarter (0 to 90)... However, I don't know how to avoid using so much memory.
Suppose I go with 0.00-89.99 degrees. This means 9000 address.
Each address will contain an answer from 0.000 to 0.999
I guess the only way around is to use CORDIC or DDS.