Need help for Cordic Function implementation
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to fill in the blanks \????" in the provided code to implement the CORDIC function for division. I have to Choose appropriate values for i. Then Test the algorithm by computing the division of 7 by 15. Can any body guide me for this
% Initialize
x = ???;
y = ???;
z = ???;
disp(['True value: x/y = ' num2str(x/y)])
for ii = ???:???,
d = ???;
x = ???;
z = ???;
disp([ii d x z])
end
0 commentaires
Réponses (1)
bym
le 27 Oct 2011
doesn't follow your template, but might give you some ideas
x = 7;
y = 15;
z = 0;
format long
a = zeros(20,3);
for i = 1:20
if x > 0
x = x - y*2^(-i);
z = z + 2^(-i);
else
x = x + y*2^(-i);
z = z - 2^(-i);
end
a(i,:) = [i 7/15 z];
end
a
0 commentaires
Voir également
Catégories
En savoir plus sur Fixed-Point Math Operations in MATLAB and Simulink dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!