Fixed-Point Blockset    

Limitations on Range

Limitations on the range of a fixed-point word occur for the same reason as limitations on its precision. Namely, fixed-point words have limited size. For a general discussion of range and precision in the Fixed-Point Blockset, refer to Range and Precision.

In binary arithmetic, a processor may need to take an n-bit fixed-point number and store it in m bits, where . If m < n, the range of the number has been reduced and an operation can produce an overflow condition. Some processors identify this condition as Inf or NaN. For other processors, especially digital signal processors (DSPs), the value saturates or wraps. If m > n, the range of the number has been extended. Extending the range of a word requires the inclusion of guard bits, which act to "guard" against potential overflow. In both cases, the range depends on the word's size and scaling.

The Fixed-Point Blockset supports saturation and wrapping for all fixed-point data types, while guard bits are supported only for fractional data types. As shown below, you can select saturation or wrapping with the Saturate to max or min when overflows occur or Saturate on integer overflow checkbox, and you can specify guard bits with the Output data type parameter.


  Example: Maximizing Precision Saturation and Wrapping