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 −14.25-14.25. The representation of X in hexadecimal notation is

Choose one option
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.

  1. Sign Bit (SS):
    The number is negative (−14.25-14.25), so sign bit S=1S = 1.

  2. Binary Conversion of Magnitude 14.2514.25:

    • Integer part: 1410=1110214_{10} = 1110_2.
    • Fractional part: 0.2510=0.0120.25_{10} = 0.01_2.
    • Magnitude: 14.2510=1110.01214.25_{10} = 1110.01_2.
  3. Normalized Scientific Notation:

    1110.012=1.110012×23.1110.01_2 = 1.11001_2 \times 2^3.

    Exponent e=3e = 3.

  4. Biased Exponent (EE):

    E=e+Bias=3+127=13010=100000102.E = e + \text{Bias} = 3 + 127 = 130_{10} = 10000010_2.
  5. Mantissa (MM):
    Drop the leading implicit 1 and pad to 23 bits:

    M=110010000000000000000002.M = 11001000000000000000000_2.
  6. Hexadecimal Encoding:
    Combine fields (S∣E∣M)(S \mid E \mid M):

    1⏟S 1000001⏟E[7..1] 0⏟E[0] 11001000000000000000000⏟M\underbrace{1}_{S} \ \underbrace{1000001}_{E[7..1]} \ \underbrace{0}_{E[0]} \ \underbrace{11001000000000000000000}_{M}

    Group into 4-bit nibbles:

    • 1100 = C
    • 0001 = 1
    • 0110 = 6
    • 0100 = 4
    • 0000 = 0
    • 0000 = 0
    • 0000 = 0
    • 0000 = 0

Result: C1640000H (Option A).

Final answer

A

Common trap

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.