Computer Arithmetic

In IEEE 754 single precision, if the stored exponent field is 130, what is the actual exponent (power of two)?

  1. A3
  2. B130
  3. C2
Show answer and explanation

Answer: A. 3

To allow negative exponents, the exponent field stores the true exponent plus a bias. The single-precision bias is 127, so the actual exponent is 130 − 127 = 3, multiplying the significand by 2³ = 8. A stored 127 means 2⁰ = 1, and 1 means 2⁻¹²⁶. Stored values 0 and all ones (255) are reserved for subnormals and for infinity and NaN. Taking 130 as the exponent forgets the bias.

  • A. Correct. 130 − 127 = 3.
  • B. 130 is the stored value before removing the bias.
  • C. 2 results from taking the bias as 128.
Practice this topic Back to topic

More Computer Arithmetic questions

  1. What is the effect of not storing the leading 1 of the significand (the hidden bit) in IEEE 754 normalized numbers?
  2. What is the hexadecimal bit pattern of decimal 1.0 in IEEE 754 single precision?
  3. Converting −6.25 to single precision, what is the sign–exponent–significand bit string written in hexadecimal?
  4. Which correctly describes representing decimal 0.1 as a binary floating-point number?
  5. In many programming languages, why is the double-precision comparison 0.1 + 0.2 == 0.3 false?