Need help for Cordic Function implementation
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
bym
am 27 Okt. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Fixed-Point Math Operations in MATLAB and Simulink finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!