0% found this document useful (0 votes)
22 views

Appendix III (Extracted From Peimin Chi's MS Thesis) Cordic: Ae Jy X y X A

The document summarizes the CORDIC (COordinate Rotation DIgital Computer) algorithm. CORDIC is used to estimate the phase of the maximum correlation value based on its real and imaginary components. It does this using basic operations like addition and bit shifting. CORDIC can rotate a vector by any angle between -99.7 and 99.7 degrees using an iterative process with pre-determined rotation angles whose tangents are powers of two. It can also estimate the angle of an input vector or its amplitude. The estimation error decreases with more stages but hardware cost increases linearly with the number of stages.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Appendix III (Extracted From Peimin Chi's MS Thesis) Cordic: Ae Jy X y X A

The document summarizes the CORDIC (COordinate Rotation DIgital Computer) algorithm. CORDIC is used to estimate the phase of the maximum correlation value based on its real and imaginary components. It does this using basic operations like addition and bit shifting. CORDIC can rotate a vector by any angle between -99.7 and 99.7 degrees using an iterative process with pre-determined rotation angles whose tangents are powers of two. It can also estimate the angle of an input vector or its amplitude. The estimation error decreases with more stages but hardware cost increases linearly with the number of stages.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Appendix III (extracted from Peimin Chi’s MS thesis)

CORDIC

Due to frequency offset, the maximum correlation value is Ne j2π∆fT when there is

no noise, as shown in (2.11). To estimate the frequency offset, we need to estimate the

phase of the max correlation value based on its real and imaginary components and this is

done by the CORDIC module that only uses basic elements such as adders and shifters.

4.5.1 Theory of Operations

If we have a vector x + jy = Ae jα in the complex plane, where

A = x2 + y2
y
α = tan −1
x

and we want to rotate the vector by an angle β , therefore the resultant vector would be

Ae j (α + β ) and in rectangular coordinates, we have

x ' = A(cos α cos β − sin α sin β )


= x cos β − y sin β
(4.3)
y ' = A(sin α cos β + cos α sin β )
= y cos β + x sin β

With trigonometry identities and some manipulation, we can rewrite (4.3) as

1
x' = ( x − y tan β )
1 + tan 2 β
(4.4)
1
y' = ( y + x tan β )
1 + tan 2 β
1
If we ignore the factor , then the new X and Y coordinates can be put into a
1 + tan 2 β

simple form:

x _ new = x − y tan β
(4.5)
y _ new = y + x tan β

and the amplitude of the resultant vector will be bigger than that of the original vector by

a factor of 1 + tan 2 β . Therefore, we have done pseudo-rotation rather than ideal

rotation as shown in Figure 4.3.

y_new

y’

β
α

x’ x_new x

Figure 4.3 Pseudo-rotation and Rotation of a Vector

4.5.2 Choice of Angles and Iterative Rotation


From (4.5), it is clear that in order to calculate the x_new and y_new, it is still

necessary to multiply tan β . To make implementation easier, we can choose special

angles such that their tangents are powers of 2 and approximate the angle β as sum (or

difference) of such angles. This implies an iterative method to rotate an angle β . Table

4.6 lists the special angles for the first 10 iterations.

Iteration i Anglei tan(anglei) = 21-i


1 45o 20
2 26.6o 2-1
3 14.0o 2-2
4 7.1o 2-3
5 3.6o 2-4
6 1.8o 2-5
7 0.9o 2-6
8 0.4o 2-7
9 0.2o 2-8
10 0.1o 2-9
Table 4.6 Iterative Angles for CORDIC Rotation

Any angles between 99.7o and -99.7o can be represented as a sum or difference of the

angles in Table 4.6. For example, 70o can be approximated as:

45o + 26.6o - 14.0o + 7.1o + 3.6o + 1.8o - 0.9o + 0.4o + 0.2o + 0.1o ≈ 70o

Now we can use the iterative algorithm to rotate a vector by any angle between 99.7o and

-99.7o.
Initialize x0 to be the x-coordinate of original vector
Initialize y0 to be the y-coordinate of original vector
Initialize z0 to be the desired angle of rotation
for i =1:Number of Stages
di=sign(zi-1) (4.6)
xi=xi-1 – yi-1 * (di * 21-i)
yi=yi-1 + xi-1 * (di * 21-i)
zi=zi-1 - di * anglei
end

If the desired angle of rotation is more than 99.7o and less than 180o, then we just simply

modify the initialization process.

Initialize x0 to be the NEGATIVE x-coordinate of original vector


Initialize y0 to be the NEGATIVE y-coordinate of original vector
Initialize z0 = desired angle of rotation - 180o

Similarly, for rotation angles of less than -99.7o and more than -180o, we can do

Initialize x0 to be the NEGATIVE x-coordinate of original vector


Initialize y0 to be the NEGATIVE y-coordinate of original vector
Initialize z0 = desired angle of rotation + 180o

After all the iterations, z will be forced to almost zero. Since each of the iterations

performs a pseudo-rotation rather than a ideal rotation, after all the iterations, x and y will

be coordinates of the ideal results multiplied by a factor. If the total number of iterations

N_stage N_stage
is N_stage, then the amplifying factor is K = ∏i =1
1 + tan 2 (angle i ) = ∏i =1
1 + 2 2(1-i) .

For large number of stages, this factor K converges to 1.6467.

4.5.3 CORDIC in Vector Mode

In additional to rotate a given vector by an angle, CORDIC in vector mode is able

to take an input vector (the x and y coordinates) and estimate the angle of the input [17].

The procedures are almost identical to (4.6) with a few minor changes. The operation
behaves like this. At each stage, the rotate angle is chosen such that the resultant y-

coordinate is forced toward zero. When all iterations are done, summing over all the

intermediate rotation angles produces an approximation of the angle of the input vector.

Figure 4.4 plots the normalize error of the estimation for different number of stages.

2
10
2 stages
4 stages
10
1 8 stages

0
10

-1
10

-2
10

-3
10

-4
10

-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180


Degrees

Figure 4.4 Normalized Angle Estimation Error for CORDIC

4.5.4 CORDIC as an Amplitude Estimator

When CORDIC is used in the vector mode, the output x value is the original input

amplitude scaled by the factor K . Since we know exactly the value of K based on the

number of stages, CORDIC in vector mode can also be used as an amplitude estimator
for free. Figure 4.5 plots the normalized error for amplitude estimation using CORDIC.

The simulation uses unit-norm vectors with different phases as inputs. It is clear from

Figure 4.5 that at some particular angles, the normalized error becomes biggest. For

example, for a CORDIC with only one stage, large error occurs at –180o, -90o, 0o, 90o,

180o. This observation can be explained with the following reasoning. With one stage

CORDIC amplitude estimator, the input vector has to be rotated by either 45o or –45o.

For a vector whose phase is one of the above angles, this one time rotation produces a

resultant vector that has the greatest Euclidean distance from the original vector. For

instance, if the input is [1 0]T, we could estimate the amplitude by just reading the x value

without doing any rotation. However, CORDIC blindly rotates the input to

T
 2 2
  (after scaling correction), therefore the greatest error. It is also interesting to
 2 2 

see that for certain input angles, the estimation is perfect due to the same reason

explained above. For a one stage CORDIC, the angles of zero estimation error are

-135o, -45o, 45o, 135o.


0.35
1 stage
2 stages
0.3 3 stages

0.25

0.2

0.15

0.1

0.05

0
-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180

Figure 4.5 Normalized Amplitude Estimation Error for CORDIC

4.5.5 Hardware Cost

The core component of the CORDIC module is the different stages. If we have

parallel implementation of all the different stages, then the hardware cost is directly

proportional to the number of stages. From (4.6), we see they are only 4 operations to be

performed at each stage. Taking the sign of zi-1 can be thought of as hardware cost free

since the sign information is stored in the most significant bit of the input zi-1 if we have

2’s complement representation. Updating x coordinates requires an arithmetic shifter, an

adder, a mux whose select signal is di, and a negate block. This is also true for updating

y. For the zi equation, a shifter is no longer needed, instead we need a constant to

represent anglei.
di sel

-1 Add xi

yi-1 shift negat 1

xi-1

Figure 4.6 Implementation for Updaing x-coordinates

The total number of hardware components per stage is listed in Table 4.7.

Elementary Components
Per Stage
Adders 3
Shifters 2
Negate 3
Multiplexers 3
Table 4.7 Number of Components Per Stage of CORDIC

Since all stages are almost identical, we can also upsample the input signal by the number

of stages used and require the hardware to finish one stage of operation per cycle. Three

registers are required at the end for intermediate output to be latched back and three

muxes are needed to pass either the input or the intermediate output to the shared stage as

shown in Figure 4.7.


Figure 4.7 Shared Implementation of CORDIC

Shared implementation like that shown in Figure 4.7 will result hardware savings for

large number of stages since the number of adders and negates no longer increases

linearly with the number of stages and the only incremental costs are the registers and

muxes. However, power consumption will increase since all hardware components are

operating at higher rate and power is linearly proportional to frequency.

4.5.6 Module Compiler Implementation

Table 4.8 shows the area and critical path delay of the MC implementation of a

12-stage CORDIC. The input I and Q components are 10 bits wide and output angle is

also 10 bits.
Adder Type Area Critical Path
(µm2) Delay
(ns)
Ripple 11982 13.94
CLSA 24338 11.20
CSA 17739 11.89
CLA 20784 11.13
FASTCLA 23772 11.12
Table 4.8 MC Estimates for 12-stage CORDIC Optimized for Speed

You might also like