Computer Arithmetic

Converting −6.25 to single precision, what is the sign–exponent–significand bit string written in hexadecimal?

  1. A0xC0C80000
  2. B0x40C80000
  3. C0xC0A80000
Show answer and explanation

Answer: A. 0xC0C80000

6.25 in binary is 110.01, normalized as 1.1001 × 2². The sign is negative, so 1; the stored exponent is 2 + 127 = 129 = 1000 0001; and the significand is the fraction 1001 followed by zeros. Laid out, 1 10000001 1001000…0 groups into 1100 0000 1100 1000 0000 …, which is 0xC0C80000. 0x40C80000 has sign bit 0 and represents +6.25, and 0xC0A80000 has significand 0101 and represents −5.25.

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. Sign 1, exponent 129, significand 1001 gives 0xC0C80000.
  • B. 0x40C80000 has sign 0 and is +6.25.
  • C. 0xC0A80000 has a different significand and is −5.25.

Related calculators

Books on Computer Arithmetic Ad

As an Amazon Associate I earn from qualifying purchases.

More Computer Arithmetic questions

  1. Which correctly describes representing decimal 0.1 as a binary floating-point number?
  2. In many programming languages, why is the double-precision comparison 0.1 + 0.2 == 0.3 false?
  3. What is the machine epsilon (the gap between 1 and the next larger representable number) in IEEE 754 single precision?
  4. Which gives the approximate number of reliable decimal digits for single and double precision?
  5. What is the role of IEEE 754 subnormal numbers?

Comparisons in this topic