CORDIC-ARCTAN

Status
Not open for further replies.

gary36

Full Member level 4
Joined
Mar 31, 2018
Messages
234
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
2,007
I am looking for a verilog Code for arc tan function. I am recieving DC sine/cosine from 16 bit ADC. INput ranges for ADC are 0 to +/-5V. I need 16 bit fixed point implemetation.
Could anybody provide pointers ( btw: required for all 4 quadrants and to be implemented in FPGA)
 

Hello,
there is one implementation in SystemVerilog on Opencores.org:

https://opencores.org/projects/cordic_atan_iq

Regards
 

I tried to check with the C code and then tranlsating to verilog. Below is one. Why does this code not work?
 

Attachments

  • cordic_fixed_point.txt
    1 KB · Views: 144

In the code , you may notice that test angle is 30 deg ( sine theta =0.5,cos theta= 0.866). I get 43 deg instead.
 

Could locate the error. It is in the Tan table. Now scaled all values to Q15 and now works very well.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…