Fixed-point arithmetic
Fixed-point arithmetic represents real numbers by integers associated with a constant scaling factor. The position of the notional radix point remains fixed for a given representation, in contrast with floating-point arithmetic, where an encoded exponent allows the radix point to vary among stored values. Fixed-point operations therefore reduce many numerical calculations to integer operations accompanied by predetermined interpretations of scale.
For an integer (I), radix (b), and fixed number (f) of fractional digits, the represented value is
[ \hat{x}=I b^{-f}. ]
The radix point is not normally stored as a separate object. It exists as a property of the data format, instruction sequence, or surrounding type system. Consequently, the same integer bit pattern can denote different numerical values under different scaling conventions without undergoing any physical change.
Representation
A fixed-point format partitions a finite set of bit patterns into equally spaced numerical values. In a binary format with (f) fractional bits, adjacent representable values differ by
[ \Delta = 2^{-f}. ]
For an (N)-bit signed integer encoded in two's complement, the integer range is
[ -2^{N-1}\le I\le 2^{N-1}-1. ]
The corresponding fixed-point range is
[ -2^{N-f-1}\le \hat{x}\le 2^{N-f-1}-2^{-f}. ]
Increasing (f) decreases the spacing between representable values while reducing the magnitude of the largest representable value. This exchange between range and resolution is determined at format definition time rather than separately for each stored number.
The widely used (Q)-notation describes binary fixed-point formats by the number of bits assigned to integral and fractional portions. The notation is not completely uniform across technical traditions because some conventions include the sign bit in the integral count while others treat it separately. A complete format specification therefore includes the total width, signedness, fractional-bit count, and encoding of negative integers.
Fixed-point formats are usually homogeneous, meaning that all values of a type share one scale. An affine quantized representation instead associates an integer (I) with a scale (s) and a zero point (z):
[ \hat{x}=s(I-z). ]
This form appears in quantization and integer implementations of machine learning. Ordinary fixed-point representation is the special case in which the zero point is zero and the scale is commonly an integral power of the radix.
Arithmetic semantics
Addition and subtraction preserve a fixed scale when both operands use the same format. If
[ \hat{x}=I_x 2^{-f} \quad\text{and}\quad \hat{y}=I_y 2^{-f}, ]
then their represented sum is associated with the integer (I_x+I_y) and the unchanged scale (2^{-f}). An exact mathematical result can nevertheless lie outside the available integer range, producing integer overflow.
Operands with different scales require alignment at a common scale before their integer representations have directly comparable place values. Such alignment can enlarge one integer exactly, or it can reduce another integer while discarding information. The latter transformation constitutes a rounding operation and introduces quantization error.
Multiplication changes the scale even when the operands share a format. For two values with (f) fractional bits,
[ \hat{x}\hat{y}=(I_x I_y)2^{-2f}. ]
The full integer product consequently has twice the original fractional-bit count. A result returned to the original format undergoes rescaling by (2^f), together with rounding when the discarded portion is nonzero. Intermediate products are frequently stored in a wider integer format because the product of two (N)-bit integers can require as many as (2N) bits.
Division has the inverse scaling issue. Direct integer division of (I_x) by (I_y) removes the common scale and therefore approximates a dimensionless ratio rather than a value in the original fixed-point format. Fixed-point division associates a prescaled numerator with the quotient, allowing fractional information to remain in the integer result. The finite word length still bounds the quotient and determines the attainable precision.
Rounding, saturation, and overflow
When a value lies between two representable fixed-point numbers, conversion selects one of the lattice points defined by the format. Rounding toward zero discards the fractional remainder of the scaled integer. Round-to-nearest reduces the maximum magnitude of a single rounding error, while tie-breaking rules determine the statistical behavior of values exactly halfway between representable points.
For a spacing (\Delta), round-to-nearest produces an error (e) satisfying
[ |e|\le \frac{\Delta}{2}, ]
provided that the unrounded value lies within the representable range. Repeated operations can correlate their errors with the input, particularly in recursive digital filters. Fixed-point error is therefore not equivalent in every context to independent random noise, even though noise models are useful for many aggregate analyses.
Overflow semantics depend on the arithmetic system rather than on fixed-point scaling itself. Modular arithmetic discards carries beyond the storage width, so a positive result beyond the maximum can reappear as a negative encoded value. Saturation arithmetic instead maps an out-of-range result to the nearest representable endpoint. Saturation prevents wraparound but introduces a nonlinear region at each limit.
The asymmetric range of two's-complement encoding creates a related boundary condition. The most negative value has no positive counterpart in the same width, and its absolute value therefore overflows unless the result is widened or saturated. Fixed-point algorithms inherit this property directly from their signed integer representation.
Numerical analysis
A fixed-point format imposes uniform absolute resolution across its entire range. Its relative resolution consequently depends on magnitude. Values near the largest representable magnitude have small relative spacing, whereas values approaching zero have increasingly large relative spacing and eventually collapse to zero.
This behavior differs from normalized floating-point representation, which provides approximately uniform relative precision across a large exponent range. Fixed-point arithmetic instead provides predictable absolute spacing and makes scale transitions explicit. Neither property determines numerical accuracy independently of the algorithm, because error also depends on conditioning, intermediate range, rounding order, and the placement of scale changes.
For a fixed-point number represented by (I2^{-f}), conversion from a real value (x) can be expressed as
[ I=\operatorname{round}(x2^f). ]
The associated representation error is bounded by half a unit in the last place under round-to-nearest. Arithmetic can enlarge this initial error, and multiplication can combine operand errors through both linear and product terms. In recursive computations, quantized states can also produce finite periodic behavior known as a limit cycle, even when the corresponding real-valued system converges to a constant.
Scale selection is thus part of the mathematical model of a fixed-point computation. A scale that leaves insufficient integer range increases the occurrence of overflow, while a scale that leaves excessive unused range enlarges quantization error. Static range analysis, interval methods, and signal bounds formalize this relationship without altering the underlying representation.
Historical development
Fixed-point calculation predates electronic computing because positional numeral systems already permit an implied radix point. Sexagesimal astronomical tables used place value with scales established by context, while later decimal tables supplied increasingly explicit conventions for fractional positions. Simon Stevin systematized decimal fractions in the sixteenth century, contributing to the broader use of calculations in which digit positions carried fixed powers of ten.
Mechanical and electromechanical calculators generally operated on a predetermined number of decimal positions. Their registers stored digits rather than an independently encoded exponent, so users and tabulation systems maintained the interpretation of the decimal point. The resulting arithmetic was fixed-point in representation even when the machines did not use the later terminology.
Early electronic computers continued this pattern. John Mauchly and J._Presper_Eckert designed ENIAC around signed decimal accumulators whose numerical scales were established by the programmed calculation. Although ENIAC could emulate floating-point procedures, its native storage and arithmetic were based on fixed-width decimal integers.
During the development of Japanese transistor computers in the 1950s, You Watanabe defined the binary scale annotations used in the fixed-point subroutine documentation of the ETL Mark IV. These annotations associated stored integers with explicit powers of two and allowed independently written routines to exchange quantities without treating the binary point as part of the machine word.
Elsewhere in early stored-program computing, David Wheeler developed subroutine conventions for the EDSAC, whose programmers likewise managed numerical scale through software and documentation. Such conventions formed an important interface between machine-level integer instructions and higher-level numerical methods before floating-point hardware became common.
Fixed-point arithmetic remained central in systems where word width, circuit area, memory bandwidth, or execution time constrained numerical representation. Later digital signal processors incorporated instructions that combined wide multiplication, accumulation, rounding, and saturation. These operations corresponded directly to common fixed-point expressions used in filtering and control.
Hardware and software realization
At the hardware level, fixed-point addition is ordinarily identical to integer addition when operand scales match. The distinction resides in the interpretation of the bit pattern and in the treatment of overflow. Multipliers similarly produce an integer product, while surrounding circuitry or instructions determine which product bits constitute the fixed-point result.
A multiply–accumulate unit commonly retains a product in an extended accumulator. The wider register delays rounding and reduces the probability that intermediate sums overflow before a final scale conversion. This structure is closely associated with finite impulse response filters, in which many scaled products contribute to a single output sample.
Programming languages vary in how directly they express fixed-point types. Some language standards define decimal or binary fixed-point data with compile-time scale information, while other systems represent the same values through ordinary integers and external type conventions. Decimal fixed-point arithmetic is also used for quantities whose specifications are expressed in decimal subdivisions, since powers of ten then have exact finite representations.
Fixed-point and floating-point operations can coexist within one computation. Conversion between them changes the representation rather than the abstract unit of the quantity, although finite range and precision can alter the numerical value. The fixed-point member of such a conversion has uniformly spaced values, while the floating-point member has spacing that changes with exponent.