Skip to content
Official PYQ · 2016

GATE CS 2016 Set 2 Q09 — Number Representations (Fixed and Floating Point)

Explain with AI
Let XX be the number of distinct 1616-bit integers in 2′s2's complement representation. Let YY be the number of distinct 1616-bit integers in sign magnitude representation Then X−YX - Y is______.
View worked solution

Answer: 1

To find the value of X−YX - Y, we analyze the number of distinct integers representable in both systems using 1616 bits (n=16n = 16):

  • 2's Complement Representation (XX):
    In nn-bit 2's complement, every unique bit pattern represents a unique integer because there is only a single representation for zero (00).
    Thus, the number of distinct integers is:
    X=216=65536X = 2^{16} = 65536
  • Sign-Magnitude Representation (YY):
    In nn-bit sign-magnitude, there are two distinct representations for zero: +0+0 and −0-0.
    Because of this redundancy, the number of distinct integers is reduced by 11:
    Y=216−1=65535Y = 2^{16} - 1 = 65535

Therefore, the difference is:

X−Y=216−(216−1)=1X - Y = 2^{16} - (2^{16} - 1) = 1

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Number Representations (Fixed and Floating Point) questions