Inferensys

Glossary

CORDIC Algorithm

An iterative shift-and-add algorithm used to efficiently compute trigonometric functions and vector rotations in hardware, commonly used to implement numerically controlled oscillators.
Engineer reviewing vector database search results on laptop, embeddings visualization on screen, home office coding session.
HARDWARE EFFICIENT COMPUTATION

What is CORDIC Algorithm?

The CORDIC algorithm is an iterative shift-and-add method for computing trigonometric, hyperbolic, and logarithmic functions using only basic integer arithmetic, making it ideal for resource-constrained hardware implementations.

The CORDIC (COordinate Rotation DIgital Computer) algorithm is a class of shift-and-add algorithms that efficiently compute trigonometric functions, vector rotations, and conversions between rectangular and polar coordinates. By decomposing a desired rotation angle into a sequence of predefined micro-rotations using only bit-shifts and additions, CORDIC eliminates the need for hardware multipliers, making it the standard method for implementing numerically controlled oscillators (NCOs) in digital down conversion (DDC) chains and software-defined radio (SDR) platforms.

In IQ sample processing pipelines, CORDIC operates in two fundamental modes: rotation mode, which rotates a complex vector by a specified angle to generate a local oscillator for frequency translation, and vectoring mode, which computes the magnitude and phase angle of an incoming complex sample. This dual capability allows a single CORDIC core to simultaneously perform carrier recovery and amplitude computation, directly supporting Costas loop implementations and automatic gain control (AGC) circuits in direct-conversion receivers.

SHIFT-AND-ADD COMPUTATION

Key Features of the CORDIC Algorithm

The COordinate Rotation DIgital Computer (CORDIC) algorithm is a class of iterative shift-and-add operations that efficiently compute trigonometric, hyperbolic, and logarithmic functions using only basic integer arithmetic, making it ideal for resource-constrained hardware implementations.

01

Iterative Shift-and-Add Mechanics

CORDIC replaces complex multiplications with simple binary shifts and additions. At each iteration, the algorithm rotates a vector by a predetermined elementary angle stored in a lookup table. The rotation direction is determined by the sign of the remaining angle, converging toward the target through successive approximations. This eliminates the need for hardware multipliers, reducing silicon area and power consumption in FPGA and ASIC implementations.

1 iteration/bit
Convergence Rate
02

Rotation and Vectoring Modes

CORDIC operates in two fundamental modes:

  • Rotation Mode: Rotates an input vector by a specified angle, computing sine and cosine simultaneously. The angle accumulator is driven to zero.
  • Vectoring Mode: Determines the magnitude and phase angle of an input vector by rotating it to align with the x-axis. The y-component is driven to zero. Both modes use the same core hardware, enabling a single CORDIC engine to compute multiple transcendental functions.
03

Numerically Controlled Oscillator (NCO) Implementation

CORDIC is the foundational engine for direct digital synthesis (DDS) in software-defined radios. By operating in rotation mode with a linearly incrementing phase accumulator, CORDIC generates high-resolution, frequency-agile sine and cosine waveforms. This enables precise digital down-conversion (DDC) and carrier generation without analog phase-locked loops, achieving sub-hertz frequency resolution and instantaneous phase-continuous frequency hopping.

< 1 Hz
Frequency Resolution
04

Pipelined vs. Iterative Architectures

Hardware designers choose between two CORDIC architectures based on throughput and area constraints:

  • Iterative (Folded): A single CORDIC stage is reused across multiple clock cycles. Minimal logic resources but lower throughput.
  • Pipelined (Unrolled): Each iteration is a dedicated hardware stage, enabling one output per clock cycle after initial latency. Ideal for high-speed digital down-conversion chains in modern direct-RF sampling receivers. The trade-off is silicon area versus sample rate.
05

Generalized Hyperbolic and Linear Modes

Beyond circular trigonometric functions, the unified CORDIC formulation extends to hyperbolic and linear coordinate systems by modifying the elementary angle sequence. This generalization enables computation of:

  • Hyperbolic functions: sinh, cosh, tanh, and their inverses
  • Exponential and natural logarithm: via hyperbolic identities
  • Square root and division: via linear mode operations A single CORDIC processor can thus serve as a universal math accelerator for digital signal processing pipelines.
06

Scale Factor Correction

Each CORDIC microrotation introduces a constant scale factor gain due to the non-unitary rotation matrix. For circular mode, the cumulative gain converges to approximately 1.64676. Compensation strategies include:

  • Post-scaling: Multiply the final output by the reciprocal constant.
  • Pre-scaling: Apply the inverse factor to the initial input vector.
  • Double-iteration techniques: Modify the algorithm to maintain unity gain, eliminating the need for separate scaling multipliers at the cost of additional iterations.
CORDIC ALGORITHM INSIGHTS

Frequently Asked Questions

Explore the core mechanisms, hardware implementations, and operational principles of the CORDIC algorithm, a foundational shift-and-add technique for high-speed trigonometric and vector calculations in digital signal processing.

The CORDIC (Coordinate Rotation Digital Computer) algorithm is an iterative shift-and-add technique used to efficiently compute trigonometric functions, vector rotations, and hyperbolic functions in hardware. It works by decomposing a desired rotation angle into a sequence of pre-defined elementary angles, where each step's tangent is a power of two. This allows the rotation to be implemented using only bit-shifts and additions, avoiding expensive multiplication operations. The algorithm operates in two primary modes: rotation mode, which rotates a vector by a given angle to compute sine and cosine, and vectoring mode, which rotates a vector to the x-axis to compute magnitude and arctangent. Its elegance lies in replacing complex transcendental math with simple, highly parallelizable digital logic, making it a cornerstone of numerically controlled oscillators (NCOs) and digital down converters.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.