Arithmetic Representation
Numerical computation using a predetermined number of digits for both the integer and fractional parts allows for high speed processing on hardware without dedicated floating point units. In fixed point math, the position of the radix point remains static throughout all operations, which simplifies the underlying logic gates required for addition and multiplication. This method is common in low power microcontrollers where silicon area and power consumption are constrained.
The programmer must manually track the scaling of variables to prevent overflow or loss of precision.
Processing Efficiency
Execution speed for integer based calculations typically exceeds that of software emulated floating point routines by a substantial margin. Because the hardware treats every value as a standard integer, simple bit shifts can handle the scaling required after a multiplication. This efficiency allows high speed control loops to run at kilohertz rates on inexpensive hardware.
Reducing the cycle count for each calculation also lowers the overall power draw of the sensing system.
Precision Loss
Rounding errors and quantization noise accumulate more quickly in this format than in wider dynamic range systems. When two large numbers are multiplied, the resulting value might exceed the available bit depth, requiring a shift that discards the least significant bits. Careful selection of the scaling factor is necessary to balance the need for range against the need for resolution.
Scaling Rule
Definition of the fractional part determines the smallest increment that the system can represent. A common format like Q15 allocates fifteen bits to the fraction and one to the sign, providing a range from negative one to nearly positive one. This fixed structure means that very large or very small values cannot be represented simultaneously without a change in the scaling logic.
Developers use simulation tools to verify that the expected input ranges do not saturate the chosen fixed point math format during operation.