Computer Arithmetic
When two fixed-point numbers with 8 fraction bits are multiplied using an integer multiplier, how should the result be handled?
- AThe result is already in the 8-fraction-bit format, so nothing needs to be done
- BThe result has 4 fraction bits, so shift it left by 4
- CThe result has 16 fraction bits, so shift it right by 8 to return to the original format
Show answer and explanation
Answer: C. The result has 16 fraction bits, so shift it right by 8 to return to the original format
A number with 8 fraction bits is stored as an integer equal to the real value times 2⁸. Multiplying two gives a value scaled by 2⁸ × 2⁸ = 2¹⁶, so the result has 16 fraction bits. Returning to the 8-fraction-bit format means dividing by 2⁸, that is, shifting right by 8 and rounding if needed. Products have more bits, so intermediate results are normally kept in a wider format. Addition leaves the fraction width unchanged, but multiplication adds the widths.
- A. Multiplication adds the fraction widths, so the format changes.
- B. The fraction does not shrink; it becomes 8 + 8 = 16 bits.
- C. Correct. With 16 fraction bits, shift right by 8 to restore the format.