Question
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 . The representation of X in hexadecimal notation is
Official answer and solution
- Official answer
- A
- From
- Official GATE 2014 answer key
Solution
Convert the decimal value -14.25 to IEEE-754 single-precision floating point binary format and then to hexadecimal.
-
Sign Bit ():
The number is negative (), so sign bit . -
Binary Conversion of Magnitude :
- Integer part: .
- Fractional part: .
- Magnitude: .
-
Normalized Scientific Notation:
Exponent .
-
Biased Exponent ():
-
Mantissa ():
Drop the leading implicit 1 and pad to 23 bits: -
Hexadecimal Encoding:
Combine fields :Group into 4-bit nibbles:
1100=C0001=10110=60100=40000=00000=00000=00000=0
Result: C1640000H (Option A).
A
Forgetting the bias of 127 in IEEE-754 single-precision format, or confusing positive and negative sign bits.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 2
- Question
- 55 of 65, printed as CS Q.45
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.