0% found this document useful (0 votes)
86 views6 pages

P S ECE 645: C: .: Roject Pecification Omputer Arithemetic Implementaiton in Hardware and Software

This document describes the implementation of sine and cosine functions using the CORDIC algorithm. CORDIC is an iterative algorithm that can compute trigonometric and hyperbolic functions using only shift and add operations. It works by performing a series of small vector rotations to end up at the desired angle. The document outlines the CORDIC theory and equations. It explains how CORDIC can be used to compute sine and cosine by setting initial vector components and accumulating the rotations. Details are provided about optimizing a pipelined hardware implementation and example applications in digital signal processing.

Uploaded by

Harsh Baghel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views6 pages

P S ECE 645: C: .: Roject Pecification Omputer Arithemetic Implementaiton in Hardware and Software

This document describes the implementation of sine and cosine functions using the CORDIC algorithm. CORDIC is an iterative algorithm that can compute trigonometric and hyperbolic functions using only shift and add operations. It works by performing a series of small vector rotations to end up at the desired angle. The document outlines the CORDIC theory and equations. It explains how CORDIC can be used to compute sine and cosine by setting initial vector components and accumulating the rotations. Details are provided about optimizing a pipelined hardware implementation and example applications in digital signal processing.

Uploaded by

Harsh Baghel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

PROJECT SPECIFICATION

ECE 645: COMPUTER ARITHEMETIC: IMPLEMENTAITON IN HARDWARE


AND SOFTWARE.

IMPLEMENTATION OF SINE AND COSINE USING


CORDIC ALGORITHM

Submitted by,
HIREN SHAH (GWU)
GAURAV DOSHI (GWU)
INTRODUCTION:

CORDIC (COordinate Rotation DIgital Computer) is a simple and efficient algorithm to


calculate hyperbolic and trigonometric functions. It is the algorithm of choice if no
hardware multiplier is available, e.g. simple microcontrollers and FPGAs as it only
requires small lookup tables, bitshifts and additions. Additionally when implemented in
soft or dedicated hardware the algorithm is suitable for pipelining. CORDIC revolves
around the idea of "rotating" the phase of a complex number, by multiplying it by a
succession of constant values

CORDIC THEORY: AN ALGORITHM FOR VECTOR ROTATION:

All of the trigonometric functions can be computed or derived from functions using
vector rotations. The CORDIC algorithm provides an iterative method of performing
vector rotations by arbitrary angles using only shifts and adds. The algorithm is derived
from the general rotation transform:

x’ = xcosф – ysinф
y’ = ycosф + xsinф

which rotates a vector in Cartesian plane by the angle ф.

These can be rearranged so that:

x’ = cosф [x – ytanф]
y’ = cosф [y + xtanф]

If the rotation angles are restricted so that tanф = ±2i , the multiplication by the tangent
term is reduced to simple shift operation. Arbitrary angles of rotation are obtainable by
performing a series of successively smaller elementary rotations. If the decision at each
iteration i, is which direction to rotate rather than whether or not to rotate, then the cosδ
term. The iterative rotation can now be expressed as:

xi+1 = Ki [xi – yidi2-i]


yi+1 = Ki [yi + xidi2-i]

where:
Ki =cos(tan-12-i) = 1/sqroot(1+2-i)
Di = ±1

Removing the scale constant from the iterative equations yields a shift-add algorithm for
vector rotation. The product of the Ki can be applied elsewhere in the system or trated as
part of a system processing gain. That product approaches 0.6073 as the number of
iterations goes to infinity. Therefore, the rotation algorithm has a gain, An, of
approximately 1.647. The exact gain depends on the number of iterations, and obeys the
relation.

An = П sqroot(1+2-i)

The angle of composite rotation is uniquely defined by the sequence of the directions of
the elementary rotations. That sequence can be represented by a decision vector. The set
of all possible decision vectors is an angular measurement system based on binary
arctangents. Conversions between this angular system and any other can be accomplished
using a look-up. A better conversion method uses an additional adder-subtractor that
accumulates the elementary rotation angles at each iteration. The elementary angles can
be expressed in any convenient angular unit. Those angular values are supplied by a
small lookup table. The angle accumulator adds a third difference equation to the
CORDIC algorithm:

zi+1 = zi – ditan-1(2-i)

CORDIC is operated in two modes: vectoring and rotation mode.

In rotation mode, the angle accumulator is initialized with the desired rotation angle. The
rotation decision at each iteration is made to diminish the magnitude of the residual angle
in the angle accumulator. The decision at each iteration is therefore based on the sign of
the residual angle after each step. If the input angle is already expressed in the binary
arctangent base, the angle accumulator may be eliminated. For rotation mode, the
CORDIC equations are:

xi+1 = xi – yidi2-i
yi+1 = yi + xidi2-i
zi+1 = zi – ditan-1(2-i)

SINE AND COSINE:

The rotational mode CORDIC operation can simultaneously compute the sine and cosine
of the input angle. Setting the y component of the input vector to zero reduces the
rotation mode result to:

xn = An x0 cosZ0
yn = An x0 sinZ0

By setting x0 equal to a/ An , the rotation produces the unscaled sine and cosine of the
angle argument, Z0. The sine and cosine values modulate a magnitude value. Using other
techniques requires a pair of multipliers to obtain the modulation. The CORDIC
technique performs the multiply as part of the rotation operation, and therefore eliminates
the need for a pair of explicit multipliers. The output of the CORDIC rotator is scaled by
the rotator gain. If the gain is not acceptable, a single multiply by the reciprocal of the
gain constant placed before the CORDIC rotator will yield unscaled results. The
hardware complexity of the CORDIC rotator is approximately equivalent to that of a
single multiplier with the same word size.

CORDIC HARDWARE:
It requires three registers for x, y and z, a lookup table to store the values of tan-1(2-i)
And two shifters to supply the terms 2-i x and 2-i y to the adder/subtractor units. The di
factor is accommodated by selecting the operand or its complement.

X
±
shift

Y
±

Z
±

Lookup
Table

Single adder and one shifter can be shared by the three computations if a reduction in
speed by a factor of about 3 is acceptable. In the extreme, CORDIC iterations can be
implemented in firmware or even software using the ALU and general-purpose registers
of a standard microprocessor. Look table can be stored in the control ROM or in main
memory.
APPLICATION:

CORDIC algorithm is powerful tool in the DSP toolbox. This algorithm is used in DSP
designs and DSP engines.

Real time application of CORDIC sine/cosine in satellite data processing systems are
attitude determination and direct digital synthesis.

The Earth’s magnetic field is very computationally intensive procedure in satellite


attitude determination. A hardware structure based on CORDIC modules has been
proposed for calculation of the Legendre polynomials. It consists of four blocks
comprising CORDIC modules for sine/cosine as well as other functions.

Direct digital synthesis (DDS) generates a new frequency based upon an original
reference frequency. Virtually all DDS architectures include a lookup table that performs
a sine computation function for generating sinusoidal output signals.

OPTIMIZATION CRITERIA:

All iterations of CORDIC algorithm performed in parallel, using a pipelined structure.


Because of the pipelined structure the core can perform a CORDIC transformation each
clock cycle. Thus ensuring the highest throughput possible. Speed is optimization criteria
to such that it meets requirements of DSP deisgns.

IO PORTS:

Port Direction Description


clk Input System Clock
enable Input Clock Enable Signal
Ain Input Angle Input
sin Output Sine output
cos Output Cosine Output
LANGUAGE, PLATFORM AND TOOLS:

The whole system is synthesized for Xilinx virtex3 family of FPGAs and 90nm TSMC
library based standard-cell ASICs.
Tools:
1. Cadence – Simvision
2. Synopsys Design Analyzer, DFT, Prime Time (for STA)
3. Active-HDL 7.1(Functional simulation),
4. Synplicity Synplify Pro(synthesis),
5. Xilinx ISE 8.x (Implementation, placement and routing) and

REFERENCES:

1) Computer Arithmetic – B. Parhami


2) Digital Arithmetic –
3) Survey of CORDIC algorithms for FPGA based computers – R.Andraka
4) FPGA Implementation of Sine and Cosine Generators using the CORDIC
algorithm.

You might also like