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.

IEEE 754 single-precision bit layout 31 30 23 22 0 s e f Sign Exponent (8 bits) Fraction (23 bits) 1 bit Add bias 127 Leading 1 omitted (hidden bit) Value = (−1)^s × 1.f × 2^(e − 127) e.g. −6.5 = −110.1₂ = −1.101₂ × 2² 1 10000001 10100000000000000000000 Neg. e = 2 + 127 = 129 “101” followed by 0s In hex: 0xC0D00000
IEEE 754 single-precision bit layout · View in diagrams
  • A. Correct. 130 − 127 = 3.
  • B. 130 is the stored value before removing the bias.
  • C. 2 results from taking the bias as 128.

Related calculators

Books on Computer Arithmetic Ad

As an Amazon Associate I earn from qualifying purchases.

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?

Comparisons in this topic