OpenCores
no use no use 1/1 no use no use
Basic question on implementation of Cordic Algorithm for Multiplication
by kyalama2 on Dec 3, 2011
kyalama2
Posts: 1
Joined: Nov 28, 2011
Last seen: Dec 3, 2011
Hi,
I was trying to implement the algorithm for multiplication first in matlab and

then in verilog and would like to quote from Andraka's paper to illustrate an

example. My basic problem is that when I implement the modified equations for

multiplication from the paper all i get is x*2 and not x*z (so irrespective of

whatever value I initialize z it always does x*2). I find this true when i do it

by hand and not just in matlab and want to know where I am going wrong.

So from Andraka's paper:
x(i+1)=x(i)-0*y(i)d(i)*2^-i; which is basically x(i) or just x0 (the initial

value)

y(i+1)=y(i)+x(i)*d(i)*(2^-(i)); where d(i)=-1 for z(i)
z(i+1)=z(i)-d(i)*(2^-(i));

So in the end it says I should get:
x(n)=x0
y(n)=y0+x0*z0
z(n)=0

Lets take an example : x0=3, y0=0, z0=3 (expected result --> y(n) = 9, z(n) = 0)
i=0: x(1)= x0 (this doesnt matter i guess), also d0=1 since z0 is +ve
y(1)= 0 + 3*1*2^-0 = 3
z(1)= 3 - 1*2^-0 = 2

i=1: y(2)= 3+ 3*1*2^-1 = 3+3/2
z(2)= 2 - 1*2^-1 = 2 - 1/2

so on further iterations we notice that
y(n) = 3+ 3/2 + 3/4 + 3/8 +... = 3*( 1+1/2+1/4+1/8+...) isn't this equal to 3 *2 =

6 ?
z(n) = 2 - (1/2+1/4+1/8...) = 2-1 = 1 ?

So can someone tell me where am I going wrong in these iterations and why I am not

getting the expected result.

Thanks in advance.
no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.