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.

Calculating Cosine and Sine Functions In VHDL - Using Look Up Tables (Need Help)

Status
Not open for further replies.

jerryt

Junior Member level 3
Joined
Jan 26, 2009
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,608
I am working on a final project for graduate school. I need to be able to calculate cos (x) and sin (x) in VHDL code. My professor tells me I should use a look up table for cos and sin values. I have never worked with look up tables in VHDL and I am a bit confused on how to do this in VHDL. Any suggestions?

Example:

cos (2) = -0.4161 (I need to find the solution of the cosine function and use it later in my VHDL code)

Thanks for everyone's help in advance! I really appreciate it.
 

There have been various threads about different sine generation methods in FPGAs. Larger look-up tables (LUT) are usually implemented in internal ROM blocks (initialized RAM) as they are provided by most recent FPGA series. The sine function table can be loaded from a file, explicitely coded in a case structure (long winded) or calculated in HDL at compile time. The below thread has examples of the latter method. https://www.edaboard.com/threads/117304/

A sine look-up table is quantized both in angle and magnitude. Thus you need to determine the required resolution respectively address and table value bitwidths.
 
  • Like
Reactions: jerryt

    jerryt

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top