Appendix III (Extracted From Peimin Chi's MS Thesis) Cordic: Ae Jy X y X A
Appendix III (Extracted From Peimin Chi's MS Thesis) Cordic: Ae Jy X y X A
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.
A = x2 + y2
y
α = tan −1
x
and we want to rotate the vector by an angle β , therefore the resultant vector would be
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
y_new
y’
β
α
x’ x_new x
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
Any angles between 99.7o and -99.7o can be represented as a sum or difference of the
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
Similarly, for rotation angles of less than -99.7o and more than -180o, we can do
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) .
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
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
0.25
0.2
0.15
0.1
0.05
0
-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180
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
adder, a mux whose select signal is di, and a negate block. This is also true for updating
represent anglei.
di sel
-1 Add xi
xi-1
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
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
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