GATE | GATE CS 2010 | Question 8

P is a 16-bit signed integer. The 2’s complement representation of P is (F87B)16.The 2’s complement representation of 8*P
(A) (C3D8)16
(B) (187B)16
(C) (F878)16
(D) (987B)16

Answer: (A)

Explanation: P = (F87B)16 is -1111 1000 0111 1011 in bianry

Note that most significant bit in the binary representation is 1, which implies that the number is negative. To get the value of the number perform the 2’s complement of the number. We get P as -1925 and 8P as -15400

Since 8P is also negative, we need to find 2’s complement of it (-15400)
Binary of 15400 = 0011 1100 0010 1000
2’s Complement = 1100 0011 1101 1000 = (C3D8)16

Quiz of this Question

GATE CS Corner    Company Wise Coding Practice

Recommended Posts:

0 Average Difficulty : 0/5.0
No votes yet.