Computer Arithmetic

Which describes saturating arithmetic used in signal processing?

  1. AWhen a result exceeds the maximum, it is held at the maximum instead of wrapping around
  2. BWhen a result exceeds the maximum, the bit width grows automatically to keep the exact value
  3. 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.
Practice this topic Back to topic

More Computer Arithmetic questions

  1. In a carry-lookahead adder, which gives the definitions of each bit's generate signal g and propagate signal p (a and b are that bit's inputs) and the carry into the next bit, c(i+1)?
  2. Why are carry-save adders used to sum the many partial products in a multiplier?
  3. Which describes a Wallace tree used in fast multipliers?
  4. What is the main effect of using radix-4 Booth's algorithm (Booth encoding) in a multiplier?
  5. When two unsigned 8-bit numbers are multiplied, how many bits are needed to represent the result without overflow?