Assignment-2
Submitted to: Dr. Sumam David Dept. of Electronics & Communication Engineering NITK Surathkal
Submitted by:
Rakshith Sharma 10EC87
Vikas Majjagi 10EC107
Mullapudi Srinivas 10EC99
Algorithm:
This is implemented for a range of input values < 0.75 since Xin should be less than 1 for the bit notation we used.Here we use the vectoring Mode of CORIC and its Hyperbolic subcase to calculate Xout=sqrt(xin2 -yin2 ) And yout= 0 Bit notation: [MSB(sign bit)] . [(bit 1 to 15 for +ve fraction)]
If we use xin=M+ ¼ and yin=M -1/4 we can compute xout=sqrt(M). The other equations of the cordic remain the same ie, X(i+1)=x(i)+d(i)*y(i)*2-i Y(i+1)=y(i)+d(i)*x(i)*2-i Z(i+1)= z(i) – d(i)*a(i) where a(i)=tan-1 (2-i) In this case we use 16bit fixed point notation with one sign bit and 15 bits in Q15 notation. A total of 12 iterations are used to reach the result where y(i) is sufficiently close to 0 and x(i) is approximately equal to sqrt(M). In case of hyperbolic, it is necessary to repeat shift iteration number for 4 th and 7th iterations in order to make the series to converge. The final obtained x(i) is to be multiplied by 1.207534056 to get the result. The flow chart for the algorithm implement in the VHDL code is as shown in the following page. d(i)=1 if x(i)*y(i)0
Y(i) has gone to 0(apprx)
input M=0.63998413
output X(i)=0.80035533
Y=0?&sh ift>12
Yes No Yes
X(i)=sqrt(M)
Yes
Check iteration number
Shift=4 or 7?
Shiftrep= 0?
No
No
Shiftrep+1
Shift+1
d(i)=-1
No