CORDIC Algorithm Core for Iterations

CORDIC Algorithm Core for Iterations

Details

Category: Arithmetic Core

Created: September 25, 2001

Updated: January 27, 2020

Language: VHDL

Other project properties

Development Status: Stable

Additional info: Design done, FPGA proven

WishBone compliant: No

WishBone version: n/a

License: GPL

Description

The CORDIC algorithm is an iterative algorithm to evaluate many mathematical functions, such as trigonometrically functions, hyperbolic functions and planar rotations.

Core Description

As the name suggests the CORDIC algorithm was developed for rotating coordinates, a piece of hardware for doing real-time navigational computations in the 1950's. The CORDIC uses a sequence like successive approximation to reach its results. The nice part is it does this by adding/subtracting and shifting only. Suppose we want to rotate a point(X,Y) by an angle(Z). The coordinates for the new point(Xnew, Ynew) are:

  • Xnew = X * cos(Z) - Y * sin(Z) Ynew = Y * cos(Z) + X * sin(Z)
  • Xnew / cos(Z) = X - Y * tan(Z) Ynew / cos(Z) = Y + X * tan(Z)
  • X(n+1) = P(n) * ( X(n) - Y(n) / 2^n) Y(n+1) = P(n) * ( Y(n) + X(n) / 2^n) Z(n) = atan(1/2^n)
  • P = cos(atan(1/2^0)) * cos(atan(1/2^1)) * cos(atan(1/2^2))....cos(atan(1/2^n))
  • Xnew = 0.607... * sum( X(n) - Y(n) / 2^n) Ynew = 0.607... * sum( Y(n) + X(n) / 2^n)
  • For i=0 to n-1
    • If (Z(n) >= 0) then
      • X(n + 1) := X(n) – (Yn/2^n); Y(n + 1) := Y(n) + (Xn/2^n); Z(n + 1) := Z(n) – atan(1/2^i);
      Else
      • X(n + 1) := X(n) + (Yn/2^n); Y(n + 1) := Y(n) – (Xn/2^n); Z(n + 1) := Z(n) + atan(1/2^i);
      End if;
    End for;

Implementation

See the on-line documentation for the theory behind and information about the available CORDIC cores.

Status

- Design is available in VHDL from OpenCores CVS via cvsweb or via cvsget
- ToDo: finish documentation