IAE Academy

GATE 2024 CS2 Q.14: solution and answer

GATE 2024 · CS2Q.14 · 1 mark · MCQ

The format of a single-precision floating-point number as per the IEEE 754 standard is: Sign (1 bit), Exponent (8 bits), Mantissa (23 bits). Choose the largest floating-point number among the following options.

GATE 2024 CS2 question 14: A header box split into three cells: Sign (1 bit), Exponent (8 bits), Mantissa (23 bits).Tap to open full size
Figure from the GATE 2024 CS2 paper. It is part of the question.
Figure description

A header box split into three cells: Sign (1 bit), Exponent (8 bits), Mantissa (23 bits). Each option is a three-cell bit pattern (Sign | Exponent | Mantissa). (A) 0 | 0111 1111 | 1111 1111 1111 1111 1111 111. (B) 0 | 1111 1110 | 1111 1111 1111 1111 1111 111. (C) 0 | 1111 1111 | 1111 1111 1111 1111 1111 111. (D) 0 | 0111 1111 | 0000 0000 0000 0000 0000 000.

  1. (A)

    Figure — Sign 0, Exponent 0111 1111, Mantissa 1111 1111 1111 1111 1111 111

  2. (B)

    Figure — Sign 0, Exponent 1111 1110, Mantissa 1111 1111 1111 1111 1111 111

  3. (C)

    Figure — Sign 0, Exponent 1111 1111, Mantissa 1111 1111 1111 1111 1111 111

  4. (D)

    Figure — Sign 0, Exponent 0111 1111, Mantissa 0000 0000 0000 0000 0000 000

Answer and solution

ANSWER

The largest floating-point number is option (B), with exponent field 1111 1110 and all-ones mantissa, about 3.4 x 10^38.

Official answer: BSource: Official answer key, GATE 2024 CS2 (IISc Bengaluru)

  1. All four options have sign bit , so all are non-negative and can be compared by exponent field first, then by mantissa.

  2. For IEEE 754 single precision, a normal number (exponent field ) has value .

  3. Option (C) has exponent field , which is reserved. With a non-zero mantissa (here all ones) it encodes NaN, which is not a number, so it cannot be the largest. (C) is ruled out.

  4. Option (A) has , so its value is .

  5. Option (D) has and mantissa , so its value is .

  6. Option (B) has , so its value is . This is the largest finite single-precision number.

  7. Order of the valid numbers: (D) (A) (B). So the largest floating-point number is (B).

KEY IDEA

In IEEE 754 single precision, the exponent field 1111 1111 is reserved for infinity and NaN. The largest finite number therefore uses exponent 1111 1110 (254) with an all-ones mantissa.

WATCH OUT FOR

Picking (C) because it has the largest-looking bit pattern. An all-ones exponent with a non-zero mantissa is NaN, not a number.

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

More Number systems questions