问题
I want to design arctan function with VHDL for using in demodulator design. I need a division & arctan function block. I have two signals, assumed that sin(alpha) and cos(alpha) from previos blocks. I want to retrieve alpha with using division [sin(alpha)/cos(alpha) = tan(alpha)] and then arctan function. I found that it is possible to do that with cordic algortihm, but a bit confused. Do you have any recommendation, docs or sth. how to design division & arctan with cordic in vhdl?
Thanks in advance
回答1:
All you need is a CORDIC arctan function, no need for division. CORDIC arctan takes cartesian coordinates (X, Y)
and convert it to polar coordinates (r, theta)
. You want theta.
You can look at wikipedia for details of the algorithm. Your fpga vendor should already provide CORDIC IP core for free, for instance, here the one for Xilinx.
回答2:
An alternative implementation is to use a memory: the tangent is the address and the angle is the contents at that address. That will be practical for a lowish number of bits, but obviously not once the number of bits gets higher. It depends on how many bits resolution you need.
来源:https://stackoverflow.com/questions/29331863/arctan-function-with-cordic-with-vhdl