Machine-translated by Google. Questions are authored in English.
Top

Discussion

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

b7 b6 b5 b4 b3 . b2 b1 b0

where the position of the binary point is between b3 and b2. Assume b7 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?

  • A.None of (i), (ii), (iii), (iv) can be exactly represented
  • B.Only (ii) cannot be exactly represented
  • C.Only (iii) and (iv) cannot be exactly represented
  • D.Only (i) and (ii) cannot be exactly represented

Answer: C

The numbers that cannot be represented exactly are (iii) and (iv) only.

The format has five integer bits (b7 to b3), so integer parts from 0 to 31, and three fraction bits (b2 to b0), so fractions in steps of 1/8 = 0.125.

  • 31.500 = 11111.100 in binary: representable.
  • 0.875 = 7/8 = 00000.111: representable.
  • 12.100 needs 0.1, which is not a multiple of 1/8 (in binary it does not terminate): not representable.
  • 3.001 needs 0.001, smaller than the step 0.125: not representable.

So the claims that (i) or (ii) cannot be represented are false, and so is 'none can be represented'.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.