IAE Academy

GATE 2018 CS Q.33: solution and answer

GATE 2018 · CSQ.33 · 2 marks · MCQ

Consider the unsigned 8-bit fixed point binary number representation below,

where the position of the binary point is between and . Assume is the most significant bit. Some of the decimal numbers listed below cannot be represented exactly in the above representation:

(i) 31.500 (ii) 0.875 (iii) 12.100 (iv) 3.001

Which one of the following statements is true?

  1. (A)

    None of (i), (ii), (iii), (iv) can be exactly represented

  2. (B)

    Only (ii) cannot be exactly represented

  3. (C)

    Only (iii) and (iv) cannot be exactly represented

  4. (D)

    Only (i) and (ii) cannot be exactly represented

See the question in the paper

Answer and solution

ANSWER

Option C: only (iii) 12.100 and (iv) 3.001 cannot be represented exactly.

Official answer: CSource: Official answer key, GATE 2018 CS (IIT Guwahati)

  1. The format has 5 integer bits () and 3 fraction bits (). The integer part therefore lies in , and the fraction is a multiple of .

  2. A decimal number is exactly representable only if its integer part is at most and its fractional part is one of .

  3. (i) : the integer part fits in 5 bits, and . So it is and is exactly representable.

  4. (ii) . So it is and is exactly representable.

  5. (iii) : the integer part fits, but the fraction is not a multiple of (it lies strictly between and ). It cannot be represented exactly.

  6. (iv) : the integer part fits, but the fraction is not a multiple of (it lies strictly between and ). It cannot be represented exactly.

  7. Only (iii) and (iv) cannot be represented exactly, so the answer is option C.

KEY IDEA

With 3 fraction bits, the fraction must be a multiple of , and with 5 integer bits the integer part must be at most 31. Check each number's fraction against these multiples.

WATCH OUT FOR

Treating a number as representable just because its integer part fits, or because the decimal fraction looks short (such as 0.1 or 0.001). A fraction is exact only when it is a sum of .

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

More Number systems questions