You are on page 1of 3

IMPLEMENTATION OF CORDIC

ALGORITHM USING MATLAB & VHDL FOR


WLAN RECEIVER
Mr. Sandeep Bidwai1, Prof. Dr. S.P. Patil2 and Mr. Saylee S. Bidwai3
Sandeep.bidwai1@gmail.com
Abstract:
This paper is focused on the CORDIC algorithm for wireless LAN.
The primary task is to create a VHDL description for CORDIC
vector rotation algorithm. The basic work has been carried out in
MATLAB. The VHDL implementation of the CORDIC algorithm is
based on the results obtained from the MATLABs simulation
environment. The accuracy of vector value in the receiver depends
on its number of bits. The main task is to make the calculated angle
value point the vector to the same constellation point, not to nearest
one. This is the cause that determines the required accuracy of the
angle calculation. The program in MATLAB calculates the first 20
steps of the CORDIC algorithm and displays how accurate each
step is. It takes the closest vectors in the signal constellation as
input. CORDIC moduld to which the calculated angle theta is given
as input to comput the sine and cosine functions using Simulink.
Last Step includes the VHDL implementation of CORDIC and the
simulation results.

II. CORDIC algorithm for Sine and cosine


1 . Arithmatics

Figure 1 represents the block diagram of conventional


CORDIC algorithm , based on ripple carry adders or sub
tractors

Key Words: CORDIC, MATLAB,VHDL, OFDM, WLAN,

I INTRODUCTION:
The CORDIC (COordinate Rotation DIgital
Computer) algorithm was developed by Volder in 1959. It
rotates the vector, stepbystep, with a given angle.
Additional theoretical work has been done by Walther in
1971. The main principle of CORDIC are calculations based
on shiftregisters and adders instead of multiplications, what
saves much hardware resources. All trigonometric functions
can be computed using vector rotation. CORDIC is used for
polar to rectangular and rectangular to polar conversions and
also for calculation of trigonometric functions, vector
magnitude and in some transformations, like discrete Fourier
transform (DFT) or discrete cosine transform (DCT). In
particular case, the CORDIC algorithm is used in wireless
LAN (WLAN) by receivers.
This paper is organized in following five steps. Step
first contains the CORDIC algorithm, its architecture and
WLAN with OFDM system. Step second deals with the
implementation of OFDM system in WLAN using FFT/IFFT
in MATLAB. Step third includes the implementation of
CORDIC algorithm in MATLAB for the WLAN receiver in
order to find out the angle of incomming vectors from
transmitter. Step four deals with CORDIC moduld to which
the calculated angle theta is given as input to comput the sine
and cosine functions using Simulink. Step five includes the
VHDL implementation of CORDIC and the simulation
results.

Fig.1 Block diagram of cordic

An adder/subtractor (A/S), depending on a selection input,


performs an addition or a subtraction. This input indicates
whether an operand is negative. The basic cell of A/S is
decomposed by two functions with 4 bits input each. One of
them is for calculating the output and another to transmit the
carry. According to this an Nbit A/S can fit in (2N+1)/2
CLBs (configurable logic block). The additional half CLB is
required for introducing the least significant bit (LSB) one in
case of the substraction. The critical path here is indicated by
the ripple carry propagation and the routing delay of the A/S
wire. This net has a fanout of 2N in this case. It decreases
the performance of the circuit and it is the main disadvantage
of conventional CORDIC implementations. As the solution
to this, redundant arithmetic could be used to increase the
speed of the CORDIC. Implementation avoids the carry
propagation from the LSB to the most significant bit (MSB),
due to its carryfree property. Redundant arithmetic is good
to accelerate those operations, which have a long propagation

delay. On the other hand redundant arithmetic also has some


disadvantages. For example, it is impossible to detect the
sign of a redundant number without checking all the digits
which expects a propagation from the MSB to the LSB.
Another problem, that the redundant arithmetic uses digit set
{1,0,1}, and needs more hardware resources to execute
simple tasks, than the conventional one which uses digit set
{1,1}. According to results of the research, the redundant
arithmetic is more accurate, but it needs much more
hardware than the conventional arithmetic and for this reason
conventional arithmetic has been used in this work. [2]
III. CORDIC module design

Dn =-1 if zn<0, +1 otherwise


(4)
Result after n iterations can be given as
Xn = Gn[x0cos(0) y0 sine(0)]
Yn = Gn [y0cos (0) + x0 sine(0)]
n =0
Gn = 1+ 2^- 2n
(5)
N
Where G is constant and approaches to 1.647 when n
approaches to infinity.
In vector mode the following equations are used:
Xn+1 = Kn [xn yndn 2^(-n)]
Yn+1 = Kn [yn + xndn 2^(-n)]
Zn+1 = zn- dn.atan2^(-n)
dn = +1, if yn <0, -1otherwise
(6)
results after n iterations can be given as
xn = Gn x0^2 + y0^2
yn = 0
n = 0 + atan (y0/x0)
Gn = 1 + 2^(-2n)
(7)
To calculate the sine and cosine functions, the CORDIC
algorithm in rotational mode is used. The initial conditions
are:
X0= 1/ Gn
Y0 = 0
Using these initial conditions equation 5 reduces to

Fig. 2 CORDIC module to implement Sine and Cosine

Above
fig. shows the CORDIC module for
implementating Sine and cosine Trignometric function using
Embedded MATLAB function block.
The basic equations for vector rotation are [4]
x = cos()[x-ytan()]
y = cos()[y+xtan()]
= Rotation angle.
(1)
where x and y are original coordinates before rotation and x
and y are the coordinates after rotation. This equatationcan
be simplified by assuming that the tangent is a power of 2.
Tan() = + 2^(-n)
(2)
Then any angle of rotation can be obtained by performing
successive smaller rotations. This assumption help us to
write equation (1) in the form of iterative operations.
Xn+1 = Kn [xn-yndn 2^(-n)]
Yn+1 = Kn [yn+xndn 2^(-n)]
Zn+1 = zn dnatan 2^(-n)
Kn = cos(atan 2^-n)) = 1 + 1+ 2^(-2n)
Dn = +1
(3)
These equations can be used in two different modes: rotation
mode and vector mode. In rotation mode, the input vector
rotates by a specific angle. In vector mode, the input vector
rotates to the x axis.
In rotation mode the following equations are used:
Xn+1 = Kn [xn yndn 2^(-n)]
Yn+1 = Kn[yn + xndn 2^(-n)]
Zn+1 = zn dnatan2^(-n)]

Xn = cos(0)
Yn = sin (0)
From the above equatations, the angle theta is calculated
from the OFDM based WLAN system and given to CORDIC
module designed in simulink to implement the trignometric
functions Sine and Cosine.
The output wave form is as shown in following fig.

Fig. 3 CORDIC implementation for Sine & Cosine


1 CORDIC VHDL results :

Using HDL coder in MATLAB, the CORDIC


model is converted from Simulink into the various HDL
files in order to varify the performance of CORDIC in
VHDL. The RTL schematic for CORDIC module is as
shown in Fig. 4. The input length in the form of Z0 is

maintained 24 bits. The inputs are applied in the CORDIC


formats in 1QN format. And the respective output is
observed in 2 QN format by performing the simulation of
test benches of the module in Modelsim simultor.

BIO DATA OF AUTHOR(S)

Mr. Sandeep S. Bidwai


Working as a lecturer in E & TC Dept, at ADCET
Ashta, Dist- Sangli (MS- INDIA). Completed his
BE (E & TC) from BAM University Aurangabad (MS)
Currently doing ME (Electronics)from Sivaji University
Kolhapur (MS). He has 3 Yrs of teaching experience
& field of interest VLSI design

Prof. Dr. S. P. Patil


Presently working as Principal ADCET Ashta, DistSangli (MS- INDIA). He has completed his BE, ME
(Electronics) & PhD from Shivaji University, Kolhapur
& He has 21Yrs of experience & his areas of interest are
Signal processing & biomedical engineering.
Figure 4

CORDIC module in VHDL

The inputs given to module in terms of Z0 is in the CORDIC


data format. The output is observed in x(n) and y(n) i.e.
cosine and sine functions as discussed previously.

Fig. 5 output wave forms for Main CORDIC module

CONCLUSION
The CORDIC module designed in MATLAB
simulink has more flexibility to operate for the
implementation of the trignometric function Sine and
Cosine. The CORDIC rotations can be used to perform the
operations on the given input angle to rotate it to the desired
direction and magnitude and phase can be computed. Finnaly
the VHDL module varifies the performance of CORDIC
module with the help of Modelsim simulator.
REFERENCES
Valls. J. Kuhmann. M. Parhi, K.K. Efficient Mapping of CORDIC
Algorithm on FPGA, Signal processing systems 2000. IEEE
workshop, pp336-343, 11-13 oct. 2000.
[2] Anastasia Lashko, Oleg Zakaznov, CORDIC implementation using
VHDL for WLAN receiver,
[3] Benjamin Heyne, Jurgen Gotze ,A pure cordic based FFT for
reconfigurable digital signal processing
[4] Volder J.E.: "The CORDIC Trigonometric Computing Technique", IRE
Trans. Electronic Computers, vol. EC8, pp 330334, 1959.
[1]

Mrs. Saylee S. Bidwai


Working as a lecturer in E & TC Dept, at ADCET
Ashta, Dist- Sangli (MS- INDIA). Completed her
BE (Electronics) from SRT University Nanded (MS)
Currently doing ME (Electronics)from Sivaji University
Kolhapur (MS). She has 3.5 Yrs of teaching experience
& field of interest VLSI design.

You might also like