Computer Arithmetic

What is the largest finite value representable in FP16 (1 sign, 5 exponent bits with bias 15, 10 significand bits)?

  1. A32768
  2. B65536
  3. C65504
Show answer and explanation

Answer: C. 65504

An all-ones exponent (31) is reserved for infinity and NaN, so the maximum exponent field is 30, giving a true exponent of 30 − 15 = 15. With an all-ones significand, the value is (1 + 1 − 2⁻¹⁰) × 2¹⁵ = (2 − 2⁻¹⁰) × 32768 = 65536 − 32 = 65504. Anything larger becomes infinity, so overflow must also be watched when training in FP16. 32768 is 2¹⁵ with a zero significand, and 65536 is 2¹⁶; neither is the maximum.

  • A. 32768 is 2¹⁵ with a zero significand.
  • B. 65536 is 2¹⁶, which FP16 cannot represent.
  • C. Correct. (2 − 2⁻¹⁰) × 2¹⁵ = 65504.
Practice this topic Back to topic

More Computer Arithmetic questions

  1. How are the two FP8 formats, E4M3 (4 exponent, 3 significand bits) and E5M2 (5 exponent, 2 significand bits), usually used?
  2. In AI inference, what is the main benefit of converting (quantizing) weights from FP32 to INT8?
  3. Data ranging from −6.35 to 6.35 is quantized to symmetric INT8 (−127 to 127) centered at zero, with scale = maximum absolute value ÷ 127. Which integer represents 1.0?
  4. Why is fixed-point rather than floating-point arithmetic often used in small microcontrollers and DSPs?
  5. Which gives the resolution and range of the 16-bit signed fixed-point Q15 format (15 fraction bits)?