Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16596 Discussions

how to code tan, arctan, log functions in verilog?

Altera_Forum
Honored Contributor II
3,295 Views

I need to use tan and arctan functions in verilog and generate a plot, one like in matlab. 

 

Also , the code should be synthesizable. 

 

Can any one suggest how can I code such trigonometric functions in verilog? 

 

Awaiting help. 

Thanks, 

Susmitha
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
2,156 Views

You should use the Cordic IP core in order to generate complex mathematical functions. 

Try to instantiate and simulate the cordic core and configure it such a way that your math functions are generated.
0 Kudos
Altera_Forum
Honored Contributor II
2,157 Views

Or just precompute the values you need to some resolution, and store them in a ROM lookup table using block RAM. 

It all depends on what data format and resolution of computation you need (ie, 16b integer vs 32b floating point require dramatically different logic).
0 Kudos
Altera_Forum
Honored Contributor II
2,157 Views

Thank you so much for the suggestions.

0 Kudos
Reply