fahmi87
Newbie level 2
Hi, plz the following matlab code calculate the sin & cos of an angle using cordic algorithm.
Can you plz translate this using assembly language for Blackfin processor
ai=[0.7854,0.46365,0.24498,0.12435,0.06242,0.03124,0.01562,0.00781,0.00391,0.00195,9.8E-4,4.9E-4,2.4E-4,1.2E-4,6E-5];
x=0.60725;
y=0;
r=pi/4;
b=r;
for k =0:14
s=sign(r);
temps=x-s*y*2^(-k);
y=y+s*x*2^(-k);
x=temps;
r=r-s*ai(k+1);
end
cosinus=x
sinus=y
Can you plz translate this using assembly language for Blackfin processor
ai=[0.7854,0.46365,0.24498,0.12435,0.06242,0.03124,0.01562,0.00781,0.00391,0.00195,9.8E-4,4.9E-4,2.4E-4,1.2E-4,6E-5];
x=0.60725;
y=0;
r=pi/4;
b=r;
for k =0:14
s=sign(r);
temps=x-s*y*2^(-k);
y=y+s*x*2^(-k);
x=temps;
r=r-s*ai(k+1);
end
cosinus=x
sinus=y