Handle Overflows and Underflows
- Updated2025-10-10
- 1 minute(s) read
You can handle overflows and underflows using either saturation or a quantizer wrap.
Fixed-point numbers can represent only numbers of a finite range. Overflows occur when a number is greater than the maximum representable number within the range. Underflows occur when a number is less than the minimum representable number within the range.
The saturation mode of the output quantizer is preferred over the wrap mode in most real-world applications because the saturation mode helps avoid signal discontinuities, or sudden changes in the amplitudes. However, the saturation mode is more complicated than the wrap mode. For internal quantizers, such as the sum quantizer, the wrap mode is preferred because this mode allows intermediate overflows and underflows within a certain range as long as the final output does not contain overflows or underflows. Use the overflow mode input of the Fixed-Point Tools VIs to specify an appropriate setting for handling overflows and underflows.