Computer Arithmetic
Which describes saturating arithmetic used in signal processing?
- AWhen a result exceeds the maximum, it is held at the maximum instead of wrapping around
- BWhen a result exceeds the maximum, the bit width grows automatically to keep the exact value
- CWhen a result exceeds the maximum, it is reset to 0 and recomputed
Show answer and explanation
Answer: A. When a result exceeds the maximum, it is held at the maximum instead of wrapping around
Ordinary integer arithmetic wraps around on overflow; in 8-bit signed arithmetic, 127 + 1 becomes −128. In audio or images that causes large errors, such as the brightest pixel suddenly turning dark. Saturating arithmetic clamps results above the maximum to the maximum (127) and below the minimum to the minimum (−128), keeping errors small. DSP and SIMD instruction sets provide it. The bit width does not grow, and results are not reset to 0.
- A. Correct. Results are clamped to the maximum or minimum instead of wrapping.
- B. The bit width stays fixed.
- C. Resetting to 0 would cause an even larger error.