GATE / CS ARCHIVE

GATE CSE 2019 / QUESTION 4

Sixteen-bit two’s-complement encoding of −28

Digital Logic · Number Systems & Computer Arithmetic · Full GATE CSE 2019 paper

GATE 2019, Q4 1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 4, GATE 2019: Find the 16-bit two's-complement representation of decimal −28. Choices: A 1111 1111 0001 1100; B 0000 0000 1110 0100; C 1111 1111 1110 0100; D 1000 0000 1110 0100.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (5 steps)

Method: represent the positive magnitude at the specified width, complement every bit, and add one.

1. Positive 28 is 16 + 8 + 4, so its 16-bit binary representation is 0000 0000 0001 1100.
2. Complement all 16 bits: 1111 1111 1110 0011.
3. Add one: 1111 1111 1110 0100, which is hexadecimal FFE4.
4. Check by the modular interpretation: a negative integer −28 is encoded as 216 − 28 = 65508. FFE4 has unsigned value 65508 and signed value 65508 − 65536 = −28.

Result: C. Setting just the most significant bit would be sign-magnitude encoding, not two's complement; retaining the positive low byte after filling leading ones would also give the wrong number.

Original paper, page 4 · Answer key