Hi,
I been trying out my codes, in order to make sure if the code is functioning with the purpose of the coding. I would like to ask another question which is the input values.
Say the input bits are 16bits [15:0], then we know that in circular cordic, rotation mode is used to compute for sine and cosine. So, basically, xi=0.603, yi=0 and zi = input angle desired to calculate.
1) my question is - how to convert the input angle into binary format?
I saw some reference (input angle /360 ) x (2^16) and some ( input angle /180 ) x (2^16), so I am confused... which is the correct one?
On top of that, the answer would be in degree, what if I wan it to be in radian?
Do I convert ( input angle x pi ) / 180 first, then angle in radian / pi x 2^16 ?
2) When my set initial input xi =0.603 which is ( 1/ 1.646 ), and yi =0 , does it means that i do not have to divide with scale correction factor for the final answer, x(16) and y(16) anymore?
3) For the iterative cordic, every iteration looping passing the shifter, the number of bits shifted to the right depends on the internal iteration,n? case 1 : meaning at 1st iteration,x value is shifted one bit to the right, then the next looping, i=2, x value is shifted 2 bits to the rights, so on til i=15, x value is shifted 15bits to the right? Or,case2: every iteration loop, the x value is shifted only one bit to the right?
case 1 : signed_shifter x_shifter(iteration, x_i, x_i_shifted);
signed_shifter y_shifter(iteration, y_i, y_i_shifted);
for (j=0;j<i;j=j+1)
begin
x_1 <= x_i + y_i_shifted;
y_1 <= y_i - x_i_shifted;
end
case 2 : for (j=0;j<i;j=j+1)
begin
x_1 <= x - (y >> 1);
y_1 <= y + (x >> 1);
end
Pls help me out with this confusion, Thx alot. I appreciate your help very much.