Question

In 16-bit 2's complement representation, the decimal number −28-28 is:

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2019 answer key

Solution

Convert the decimal number to binary and compute its 16-bit two's complement representation.

First, write the binary representation of +28+28 in 16 bits:

2810=16+8+4=0000 0000 0001 1100228_{10} = 16 + 8 + 4 = 0000\,0000\,0001\,1100_2

Next, compute the 1's complement by flipping all bits:

1’s complement=1111 1111 1110 00112\text{1's complement} = 1111\,1111\,1110\,0011_2

Finally, add 1 to obtain the 2's complement representation:

−2810=1111 1111 1110 00112+1=1111 1111 1110 01002-28_{10} = 1111\,1111\,1110\,0011_2 + 1 = 1111\,1111\,1110\,0100_2
Final answer

C

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2019 Computer Science and Information Technology (CS)
Question
14 of 65, printed as CS Q.4
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.