IAE Academy

GATE 2023 CS Q.45: solution and answer

GATE 2023 · CSQ.45 · 2 marks · MCQ

Consider the IEEE-754 single precision floating point numbers P=0xC1800000 and Q=0x3F5C2EF4.
Which one of the following corresponds to the product of these numbers (i.e., ), represented in the IEEE-754 single precision format?

  1. (A)

    0x404C2EF4

  2. (B)

    0x405C2EF4

  3. (C)

    0xC15C2EF4

  4. (D)

    0xC14C2EF4

See the question in the paper

Answer and solution

ANSWER

The product is 0xC15C2EF4, option (C).

Official answer: CSource: Official answer key, GATE 2023 CS (IIT Kanpur)

  1. IEEE 754 single precision: , with 1 sign bit, 8 exponent bits and 23 fraction bits.

  2. = 0xC1800000 = : sign , exponent bits , fraction . So .

  3. = 0x3F5C2EF4 = : sign , exponent bits , fraction bits (that is 0x5C2EF4). So .

  4. Multiply: . Since the significand of is exactly , the product significand is , which is already normalised, so the fraction stays 0x5C2EF4 and no rounding is needed.

  5. Result: sign , exponent , fraction .

  6. Assemble the bits: , which is 0xC15C2EF4. This is option (C).

KEY IDEA

P is exactly , so multiplying by it only flips the sign and adds 4 to the exponent of Q. The fraction field is unchanged and there is no rounding: exponent , sign 1, fraction 0x5C2EF4.

WATCH OUT FOR

Forgetting that the stored exponent is biased: adding the two biased exponents (131 + 126) without subtracting 127 once. Another slip is mis-aligning the 9 leading bits (sign plus exponent) when regrouping into hex, which gives 0x40.. or 0xC14C.. in place of 0xC15C...

From the GATE 2023 CS paper. Every question of this paper · Download the full paper · All 18 Number systems questions, with notes

More Number systems questions