Question
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?
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 :
- The integer part has 5 bits ( to ), representing integers from 0 to .
- The fractional part has 3 bits (), representing fractions of the form where , i.e., multiples of .
Evaluate each number:
- (i) : Integer 31 fits in 5 bits (). Fractional part fits in 3 bits. Represented exactly.
- (ii) : Integer 0 fits. Fractional part fits in 3 bits. Represented exactly.
- (iii) : Integer 12 fits. Fractional part . Since 10 has prime factor 5, has an infinite repeating binary expansion () and cannot be represented exactly in any finite number of binary fractional bits.
- (iv) : Integer 3 fits. Fractional part cannot be written as . Cannot be represented exactly.
Thus, only (iii) and (iv) cannot be represented exactly, matching option C.
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.