Fixed-point arithmetic

What Is Fixed-Point Arithmetic?

Fixed-point arithmetic is a method of representing and computing with real numbers in digital hardware by placing the radix point at a predetermined, fixed position within a binary word. Unlike floating-point formats, which allocate bits dynamically between exponent and mantissa, fixed-point formats assign a fixed number of bits to the integer part and a fixed number to the fractional part. This approach trades the wide dynamic range of floating-point for lower hardware complexity, faster execution, and reduced power consumption, making it the dominant numerical format in embedded processors, digital signal processors, and custom silicon for constrained applications.

The position of the binary point is not stored in the word itself; it is implied by the programmer's or designer's convention for a given variable. A 16-bit word might represent values in the range -1 to nearly +1 with 15 fractional bits, or values up to 255 with 8 integer bits and 8 fractional bits, depending on the declared format. This flexibility is entirely managed in software or hardware design rather than by the storage format itself.

Representation and Precision

Fixed-point numbers are typically stored in two's-complement binary, with the most significant bit serving as the sign bit. The resolution of the representation, the smallest increment it can distinguish, is determined directly by the number of fractional bits: with n fractional bits, the resolution is 2^(-n). A 16-bit fixed-point format with 15 fractional bits achieves a resolution of approximately 3 × 10^(-5). As discussed in the ScienceDirect overview of fixed-point arithmetic, this precision is adequate for most audio, control, and communications signal processing tasks when the signal levels are properly scaled to use the full word width.

Arithmetic Operations and Overflow

Addition and subtraction in fixed-point arithmetic follow the same rules as integer arithmetic, provided that both operands share the same implied binary-point position. Multiplication of two Q-format numbers produces a result with twice as many fractional bits, requiring a shift and truncation step to return to the original format. Division is handled either by scaling or by using reciprocal approximations. The chief hazard in fixed-point computation is overflow: when the result of an addition exceeds the representable range, the value wraps around or saturates depending on the hardware configuration. Programmers must scale variables and intermediate results carefully, or use extended-precision accumulators. Many digital signal processors provide 40-bit or 64-bit accumulator registers specifically to reduce overflow risk during long multiply-accumulate sequences, as described in the Texas Instruments comparison of fixed- and floating-point DSPs.

Quantization and Scaling

When a continuous or high-precision value is converted to a fixed-point representation, the rounding or truncation that occurs is called quantization error. A 16-bit fixed-point system introduces roughly 3,000 times more quantization noise than a 32-bit floating-point system for the same input range. Managing this noise requires the designer to scale signals so that they remain near full scale without overflowing, a process sometimes called dynamic range management. In practice, the tradeoff is acceptable: fixed-point digital signal processors execute multiply-accumulate operations at speeds approaching 20 times faster than equivalent floating-point implementations, with substantially lower silicon area and power draw. The IEEE Xplore paper on fixed-point multiplication for signal processing examines efficient hardware architectures that exploit the regularity of fixed-point formats to minimize gate count while maintaining signal integrity.

Applications

Fixed-point arithmetic has applications in a wide range of disciplines, including:

  • Digital audio and speech processing, where 16-bit or 24-bit fixed-point formats provide adequate dynamic range at low chip cost
  • Wireless baseband processing, where DSPs executing fixed-point FFTs and FIR filters must meet strict power budgets
  • Motor and power-electronics control loops, where fixed-point microcontrollers compute PID algorithms in real time
  • Machine learning inference on embedded hardware, where quantized fixed-point weights reduce memory and multiply cost
Loading…