Question

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

b7  b6  b5  b4  b3 . b2  b1  b0b_7 \; b_6 \; b_5 \; b_4 \; b_3 \, . \, b_2 \; b_1 \; b_0

where the position of the binary point is between b3b_3 and b2b_2. Assume b7b_7 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?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2018 answer key

Solution

Examine whether the integer and fractional parts can be represented exactly using 5 integer bits and 3 fractional bits.

In the format b7b6b5b4b3.b2b1b0b_7 b_6 b_5 b_4 b_3 . b_2 b_1 b_0:

  • The integer part has 5 bits (b7b_7 to b3b_3), representing integers from 0 to 25−1=312^5 - 1 = 31.
  • The fractional part has 3 bits (b2,b1,b0b_2, b_1, b_0), representing fractions of the form k8\frac{k}{8} where k∈{0,1,…,7}k \in \{0, 1, \dots, 7\}, i.e., multiples of 0.1250.125.

Evaluate each number:

  1. (i) 31.50031.500: Integer 31 fits in 5 bits (11111211111_2). Fractional part 0.5=4/8=0.10020.5 = 4/8 = 0.100_2 fits in 3 bits. Represented exactly.
  2. (ii) 0.8750.875: Integer 0 fits. Fractional part 0.875=7/8=0.11120.875 = 7/8 = 0.111_2 fits in 3 bits. Represented exactly.
  3. (iii) 12.10012.100: Integer 12 fits. Fractional part 0.1=1/100.1 = 1/10. Since 10 has prime factor 5, 0.10.1 has an infinite repeating binary expansion (0.000110011…20.000110011\dots_2) and cannot be represented exactly in any finite number of binary fractional bits.
  4. (iv) 3.0013.001: Integer 3 fits. Fractional part 0.001=1/10000.001 = 1/1000 cannot be written as k/8k/8. Cannot be represented exactly.

Thus, only (iii) and (iv) cannot be represented exactly, matching option C.

Final answer

C

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2018 Computer Science and Information Technology (CS)
Question
43 of 65, printed as CS Q.33
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.