GATE Computer ScienceHardGATE CS (PYQ pattern)

A floating-point format has a sign bit and 3 fraction bits (so 4 significant bits including the hidden 1), with round-to-nearest, ties-to-even, and a wide exponent. Evaluate (9 + 0.25) + 0.25 and 9 + (0.25 + 0.25).

  1. A. 9 and 9
  2. B. 9 and 10
  3. C. 10 and 10
  4. D. 9.5 and 9.5

Correct answer: B. 9 and 10

Numbers in [8, 16) have spacing 1. 9.25 rounds to 9, and 9 + 0.25 rounds to 9 again. But 0.25 + 0.25 = 0.5 is exact and 9.5 is a tie between 9 and 10: ties-to-even selects 10 (mantissa 010).

More Digital Logic questions

Exams that ask this topic