Embedded Control Systems in C/C++: An Introduction for Software Developers Using MATLAB

8.6: Fixed-Point Mathematics

8.6 Fixed-Point Mathematics

The development and implementation of controller designs up to this point have been based on double-precision floating-point mathematics in the MATLAB environment. Although it is sometimes possible to implement embedded controllers with floatingpoint math, many lower cost embedded processors do not support floating-point operations. Even on those that do, the execution of floating-point operations can be much slower and more memory intensive than similar computations that use fixed-point mathematics.

Fixed-point math uses integers to represent continuous values. The fixed-point representation has two differences from the continuous representation of a value.

  • The range (from minimum value to maximum value) of a fixed-point integer is extremely limited compared to a floating-point representation.

  • Fixed-point integers are quantized with a resolution dependent on the number of bits in the integer representation.

Although both of these limitations also apply to MATLAB's double-precision floatingpoint values, they are negligible in most circumstances of interest to us. In fixed-point mathematics, however, these limitations can cause serious degradation or outright failure of a control system algorithm.

Fixed-point representations of continuous variables employ a scale factor to adjust the range of the integer representation so that it matches the expected range of the continuous value. This helps to minimize quantization errors. However, it is important to ensure that the continuous value does not exceed the range of the integer representation. This typically results in wraparound (erroneously jumping from positive full-scale to negative full-scale, or vice versa) in the fixed-point computation. To prevent these errors, you must usually...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Math Calculation Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.