The value of a float type variable is represented using the single-precision…
2014
The value of a float type variable is represented using the single-precision 32-bit floating point format of IEEE-754 standard that uses 1 bit for sign, 8 bits for biased exponent and 23 bits for mantissa. A float type variable X is assigned the decimal value of −14.25. The representation of X in hexadecimal notation is
- A.
C1640000H
- B.
416C0000H
- C.
41640000H
- D.
C16C0000H
Attempted by 127 students.
Show answer & explanation
Correct answer: A
Answer: C1640000H
Convert the magnitude 14.25 to binary: 14 = 1110₂ and 0.25 = 0.01₂, so 14.25 = 1110.01₂.
Normalize to form 1.x × 2^E: 1110.01₂ = 1.11001₂ × 2³.
Compute the biased exponent: E = 3, biased exponent = 3 + 127 = 130 = 10000010₂.
Form the mantissa (fraction) from the bits after the leading 1: .11001 → pad to 23 bits → 11001000000000000000000₂.
Sign bit: 1 (since the number is negative).
Combine bits: sign | exponent | mantissa = 1 10000010 11001000000000000000000₂ = 11000001011001000000000000000000₂.
Convert to hexadecimal by grouping into 4 bits: 1100 0001 0110 0100 0000 0000 0000 0000 = C1640000H.
Common pitfalls:
A hex value with sign bit 0 but correct exponent and mantissa encodes a positive magnitude (e.g., +14.25), so watch the sign bit.
Small changes in the mantissa change the fractional part (e.g., .11001₂ vs .11011₂), producing different magnitudes such as 14.25 vs 14.75.