GATE / CS ARCHIVE

GATE CSE 2016 SET 2 / QUESTION 9

GATE CSE 2016 Set 2 Q9

Digital Logic · Number Systems & Computer Arithmetic · Full GATE CSE 2016 Set 2 paper

GATE 2016 Set 2, Q9 1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 9, GATE 2016: X is the number of distinct integers representable in 16-bit two’s complement; Y is the corresponding number for 16-bit sign magnitude. Find X−Y.
Tap to enlarge
Answer & solution

Official answer: 1.0 : 1.0

Our answer: 1

Two’s complement has 216 distinct values. Sign magnitude has two encodings of zero, leaving 216−1 distinct values. Hence X−Y=1.

Two’s-complement range is −32768 through 32767, containing 65536 integers. Sign magnitude ranges from −32767 through 32767, containing 65535 integers. Both formats have 65536 bit patterns; the question asks distinct mathematical values, so +0 and −0 count once.

Original paper, page 27 · Answer key