P is a 16-bit signed integer. The 2's complement representation of P is…

2024

P is a 16-bit signed integer. The 2's complement representation of P is (F87B)₁₆. The 2's complement representation of 8*P is

  1. A.

    (C3D8)₁₆

  2. B.

    (187B)₁₆

  3. C.

    (F87B)₁₆

  4. D.

    (987B)₁₆

Attempted by 31 students.

Show answer & explanation

Correct answer: A

In binary arithmetic, multiplying a signed integer by 8 (which is 23) is exactly equivalent to shifting the bits to the left by 3 positions (<< 3).

  1. Convert P from Hexadecimal to Binary:

    P = (F87B)16

    • F = 1111

    • 8 = 1000

    • 7 = 0111

    • B = 1011

    P = (1111 1000 0111 1011)2

  2. Shift Left by 3 Bits (P X 23):

    When shifting a 16-bit number left by 3 bits, the 3 leftmost bits drop off, and 3 zeros are introduced on the right side:

    • Original: 1111 1000 0111 1011

    • Shifted: 1100 0011 1101 1000

  3. Convert back to Hexadecimal:

    Group the resulting binary string into sets of 4 bits from left to right:

    • 1100 = C

    • 0011 = 3

    • 1101 = D

    • 1000 = 8

    Result = (C3D8)16

Explore the full course: Tpsc Assistant Technical Officer