GATE Computer ScienceVery hardGATE CS (PYQ pattern)

0.1 stored in IEEE 754 single precision (round to nearest) has the bit pattern 0x3DCCCCCD. Relative to the exact value 0.1, the stored value is

  1. A. larger, by 0.2 ulp (1 ulp = 2⁻²⁷ here)
  2. B. smaller, by 0.2 ulp (1 ulp = 2⁻²⁷ here)
  3. C. larger, by 0.8 ulp (1 ulp = 2⁻²⁷ here)
  4. D. larger, by 0.2 ulp (1 ulp = 2⁻²³ here)

Correct answer: A. larger, by 0.2 ulp (1 ulp = 2⁻²⁷ here)

0.1 = 1.1001 1001 …₂ × 2⁻⁴, so 1 ulp = 2⁻⁴⁻²³ = 2⁻²⁷. The infinite fraction is 0x4CCCCC.CCC…, i.e. 0x4CCCCC + 0.8 ulp. Rounding to nearest goes up to 0x4CCCCD, adding 0.2 ulp, so the stored value exceeds 0.1 by 0.2 × 2⁻²⁷ ≈ 1.49 × 10⁻⁹.

More Digital Logic questions

Exams that ask this topic