180 likes | 402 Views
CORDIC Algorithm CO ordinate R otation DI gital C omputer. Method for Elementary Function Evaluation (e.g., sin( z ), cos( z ), tan -1 ( y )) Originally Used for Real-time Navigation (Volder 1956) Idea is to Rotate a Vector in Cartesion Plane by Some Angle Complexity Comparable to Division.
E N D
CORDIC AlgorithmCOordinate Rotation DIgital Computer • Method for Elementary Function Evaluation (e.g., sin(z), cos(z), tan-1(y)) • Originally Used for Real-time Navigation (Volder 1956) • Idea is to Rotate a Vector in Cartesion Plane by Some Angle • Complexity Comparable to Division
Rotations in the Plane y (0.707,0.707)(cos45°, sin45°) 0.707 45° x 0.707 (1,0)
Rotations in the Plane-Simplifications Factoring the term cos from the above Equations: Restrict the Rotation Angles Such that: Above Multiplication is Reduced to a Simple Shift!!
Iterations Over Angles • Arbitrary Angles Obtained After Series of Smaller Rotations (increasing i values) • At Each Iteration Rotate Up or Rotate Down • Possible Rotation Angles, e(i) = tan –1 2-i(degrees):
Rotations in the Plane-Simplifications Restrict the Rotation Angles Such that: Substituting into Previous Equations:
Rotations in the Plane-Simplifications Using the Identity: Previous Equations: Are Further Simplified as:
Scaling Constant – CORDIC Gain Factor Gain Factor Becomes: This Value is Pre-computed for a Given i Value: • Can Remove the Ki Value and Apply Elsewhere in System • Can Pre-scale (x, y) by An
Angle Accumulator, zi Overall Rotation Angle Defined by Sequence of Iterations: Use Angle Accumulator to Keep Track of Rotations:
Binary Angular Measurement - BAM • Angle Accumulator can Represent Angles as BAM • Encode di={-1,+1} as Bit Values {0,1} • Example: -1 Represented by 0 and +1 Represented by 1 • LSb Represents d0 • Content z=01011 • z=+45 +26.6 -14.0 +7.1 -3.6 =61.1 • Can Simplify CORDIC Circuitry for Some Modes • May Need BAM encode/decode – Can Use Lookup Table
CORDIC - Rotation Mode • Input is Angle, – Initialized in Angle Accumulator • Vector Initialized to Lie on x-axis • Each Iteration di Chosen by Sign of Angle • Attempt to Bring Angle to Zero • Result is x Register Contains ~cos • Result is y Register Contains ~sin • Also Polar to Rectangular if x Register Initialized to Magnitude
CORDIC - Vector Mode • Input is (Pre-scaled) Vector in (x,y) Registers • Angle, – Initialized to Zero • Each Iteration di Chosen to Move Vector to Lie Along Positive x-axis (Want to Reduce y Register to Zero) • Result is Original Vector Angle in Angle Accumulator • Can be Used for sin-1 andcos-1 • Also Rectangular to Polar Conversion • Magnitude in x Register
CORDIC – Rotation/Vector Modes • Rotation Mode: • Vector Mode:
Rotation Angle Limits • Rotation/Vector Algorithms Limited to 90 • Due to Use of =tan(20) for First Iteration • Several Ways to Extend Range • One Way is to Use Additional Rotation for Angles Outside Range • This Rotation is Initial 90 Rotation
CORDIC Uses • Can Use CORDIC For Others Also: • Linear Functions • Hyperbolic Functions • Square Rooting • Logarithms, Exponentials
Iterative CORDIC Structure* *Taken from “A Survey of CORDIC Algorithms for FPGA Based Computers”, R. Andraka, FPGA’98
Bit-serial CORDIC Structure* *Taken from “A Survey of CORDIC Algorithms for FPGA Based Computers”, R. Andraka, FPGA’98