[Math] Add Hexadecimal that is in 2’s complement.

binary

Perform the following additions. The corresponding 16-bit binary numbers are in 2's complement notation. Provide your answers in hexadecimal.

I'm not sure about this one, am I doing the 2's complement conversion correctly?

x7D96 + x7412

0111 1011 1001 0110
+

0111 0100 0001 0010 =

1110 1111 1010 0111 2's complement notation

0001 0000 0101 1000
=
x1058

Best Answer

You missed a stage out to get the twos complement you first invert all the bits then add one and throw away the carry

So starting with:

1110 1111 1010 0111

We invert to get

0001 0000 0101 1000

Then add 1 to get

0001 0000 0101 1001

And throw the carry away if any to get

0001 0000 0101 1001 = 0x1059