First, write each number in binary form:
DAB7 = 1101 1010 1011 0111
5634 = 0101 0110 0011 0100
Now take the two's complement of 5634 in two steps:
1's complement: 1010 1001 1100 1011
Add 1 to make the 2's complement: 1010 1001 1100 1100
Now add to find your result:
1101 1010 1011 0111 + 1010 1001 1100 1100 = 1000 0100 1000 0011
And write the result in hex:
8483
This works because the two's complement is the negative of the original number.
Chat with our AI personalities