1
20 03 S c h o o l o f E l e c t r i c a l E n g i n e e r i n g & T e l e c o m m u n i c a t i o n s Author : TAN SUNG JENG (3035017) Supervisor : DR SAEID NOOSHABADI SN03 – Design of A CORDIC Calculator Abstract Most scientific calculators use series expansion or look up tables for trigonometric and hyperbolic function calculations. This requires large hardware utilization. The Coordinate Rotation Digital Computer (CORDIC) algorithm calculates the trigonometric and hyperbolic functions using vector rotation. The implementation of CORDIC uses only the shift and add operations. This simplicity reduces the hardware utilization. In addition, the accuracy of calculation can be improved simply by increasing the number of iterations. 3. The CORDIC Processor 1. The Unified CORDIC Algorithm ENGINEERING @ UNSW UNSW n θ n α n X 1 + = n ε 1 = n ε n n R 2 n n R 2 1 + n Y n Y 1 + n Y 1 + n X 1 + n X n α n n n R R 2 1 2 1 + + = n R n n X 2 n n X 2 n n Y 2 n n Y 2 Y X Single Step Computation in Circular System n n n n n n n n n n n n n n Z Z X Y Y Y m X X α ε ε ε = + = = + + + 1 1 1 2 2 CORDIC Coordinate System System, m Rotational Gain, P Micro-rotation Angle, n α Circular 1 0 ) 2 ( tan 1 n for n n 2 2 1 + Hyperbolic -1 1 ) 2 ( tanh 1 n for n n 2 2 1 Linear 0 0 2 n for n 1 2. Hardware Implementation of CORDIC Algorithm The iterative formula of the CORDIC equations were implemented in an algorithmic FSM architecture. The core processor is simple as it contains basic digital system components and a small ROM for micro-rotation angles. The advantage is that the calculation involves NO multiplier! Sequential CORDIC Core Processor Architecture 4. The CORDIC Calculator The analysis of single step computation in circular system allows the calculation of trigonometric functions. A generalized formula called the Unified CORDIC Algorithm extends the computation to hyperbolic and linear functions. The Interface module shown below provides the user interface to the CORDIC processor with the I/O devices. The Data Processor stores, encodes, decodes and controls the display of input/output data. The IO processor controls the bus arbitration between the system board and the I/O board. It also passes data between I/O devices and Data processor. The CORDIC processor was designed together with the Pre-processor and Post-processor to extend the range of input arguments beyond the domain of convergence of the CORDIC core processor. 5. Implementation Hardware (D2E-DIO2) The CORDIC calculator was synthesized into the Xilinx Spartan 2E FPGA on the D2E board. The DIO2 board provides the user interface push buttons, switches and LCD display. CORDIC CORE PROCESSOR PRE- PROCESSOR POST- PROCESSOR qsign q[4:0] rotate_end angle_input[15:0] end_calculate pre_sine[15:0] pre_cosine[15:0] clk,reset, function_select[2:0] angle_in[31:0] start_cordic end_cal answer_cal[31:0] out_range CORDIC Processor Structure CORDIC Calculator Structure Interface module to/from DIO2 Conclusion The implementation of CORDIC calculator in the D2E-DIO2 boards successfully demonstrated the functionality of the hardware implemented CORDIC algorithm as a simple scientific calculator. 0 1 0 1 0 1 shr >> n shr >> n D Q Q D Q Q D Q Q 0 1 sel sel sel system artan artanh count count xn zn yn xnp ynp znp sx sy sz xin yin Zin xl yl zl ce ce ce ROM count

SN03 – Design of A CORDIC Calculatorsubjects.ee.unsw.edu.au/scoff/posters/posters2003/tan.pdf · The CORDIC calculator was synthesized into the Xilinx Spartan 2E FPGA on the D2E

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SN03 – Design of A CORDIC Calculatorsubjects.ee.unsw.edu.au/scoff/posters/posters2003/tan.pdf · The CORDIC calculator was synthesized into the Xilinx Spartan 2E FPGA on the D2E

2003

School of Electrical Engineering &Telecom

munications

Author : TAN SUNG JENG (3035017)

Supervisor : DR SAEID NOOSHABADI

SN03 – Design of A CORDIC Calculator

Abstract

Most scientific calculators use series expansion or look up tables for trigonometric and hyperbolic function calculations. This requires large hardware utilization. The Coordinate Rotation Digital Computer (CORDIC) algorithm calculates the trigonometric and hyperbolic functions using vector rotation. The implementation of CORDIC uses only the shift and add operations. This simplicity reduces the hardware utilization. In addition, the accuracy of calculation can be improved simply by increasing the number of iterations.

3. The CORDIC Processor

1.The Unified CORDIC Algorithm

ENGINEERING @ UNSW

UNSW

nθnα

nX

1+=nε

1−=nε

nnR2 −

nnR2 −

1+nY

nY

1+nY

1+nX1+nX

nn

n RR 21 21 −+ +=

nR

nnX2 −

nnX2 −

nnY2 −

nnY2−

Y

X

Single Step Computation in Circular System

nnnn

nn

nnn

nn

nnn

ZZ

XYYYmXX

αε

ε

ε

⋅−=

⋅⋅+=

⋅⋅⋅−=

+

−+

−+

1

1

1

2

2

CORDIC CoordinateSystem System, m Rotational Gain, PMicro-rotation

Angle, nα

Circular 1 0)2(tan 1 ≥−− nforn n221 −+

Hyperbolic -1 1)2(tanh 1 ≥−− nforn n221 −−

Linear 0 02 ≥− nforn 1

2. Hardware Implementation of CORDIC Algorithm

The iterative formula of the CORDIC equations were implemented in an algorithmic FSM architecture. The core processor is simple as it contains basic digital system components and a small ROM for micro-rotation angles. The advantage is that the calculation involves NO multiplier!

Sequential CORDIC Core Processor Architecture

4. The CORDIC CalculatorThe analysis of single step computation in

circular system allows the calculation of trigonometric functions. A generalized formula called the Unified CORDIC Algorithm extends the computation to hyperbolic and linear functions.

The Interface module shown below provides the user interface to the CORDIC processor with the I/O devices. The Data Processor stores, encodes, decodes and controls the display of input/output data. The IO processor controls the bus arbitration between the system board and the I/O board. It also passes data between I/O devices and Data processor.

The CORDIC processor was designed together with the Pre-processor and Post-processor to extend the range of input arguments beyond the domain of convergence of the CORDIC core processor.

5. Implementation Hardware (D2E-DIO2)

The CORDIC calculator was synthesized into the Xilinx Spartan 2E FPGA on the D2E board. The DIO2 board provides the user interface push buttons, switches and LCD display.

CORDICCORE

PROCESSOR

PRE-PROCESSOR

POST-PROCESSOR

qsign

q[4:0]

rotate_end

angle_input[15:0]

end_calculate

pre_sine[15:0]

pre_cosine[15:0]

clk,reset, function_select[2:0]

angle_in[31:0]

start_cordic

end_calanswer_cal[31:0]

out_range

CORDIC Processor Structure

CORDIC Calculator Structure

CORDICPROCESSOR

IOPROCESSOR

DATAPROCESSOR

Interface module

to/from DIO2

Conclusion

The implementation of CORDIC calculator in the D2E-DIO2 boards successfully demonstrated the functionality of the hardware implemented CORDIC algorithm as a simple scientific calculator.

0

1

0

1

0

1

shr >> n

shr >> n

DQ

Q

DQ

Q

DQ

Q

0

1

sel

sel

sel

system

artan

artanh

count

count

xn

zn

yn

xnp

ynp

znp

sx

sy

sz

xin

yin

Zin

xl

yl

zl

ce

ce

ce

ROMcount