Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

implementing Look Up Tables on FPGA ROM or RAM

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
Hello,

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' ?
 

A ROM in an FPGA will just be a ram without a write port.
How many bits input and output are you trying to implement. And are you using fixed point?
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
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)
 

Hi,

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.

How do microcontrollers implement trig functions?
 

  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
FPGA's have embedded multipliers in them..so, why not use Taylor?
It seems like most solutions advocate CORDIC instead. I don't understand why...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top