Computer Arithmetic
Converting −6.25 to single precision, what is the sign–exponent–significand bit string written in hexadecimal?
- A0xC0C80000
- B0x40C80000
- 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.
- 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.