2's complement of a variable when variable is multiplied by some constant

112 Views Asked by At

P is a 16-bit signed integer. The 22's complement representation of P is $(F87B)_{16}$. The 2's complement representation of 8×P is

One method is to use left shift to solve this. We use left shift 3 times to get the result.

Result is -

$(C3D8)_{16}$

But I am trying to solve it using one another method but not successful. So I want to know what's wrong in following method -

2's complement of P = $(F87B)_{16}$

1's complement of P = $(F87A)_{16}$

Original P = $(0785)_{16}$

Now 8P = $(6280)_{16}$

It's 2's complement = $(9D80)_{16}$

Wrong answer.

1

There are 1 best solutions below

2
On

Your mistake is, that you used decimal representation in $785_{10} \times 8 = 6280_{10}$ instead of hexadecimal. Correct: $$785_{16} \times 8 = 3C28_{16}$$ and the 2's complement is $C3D8_{16}$.