Two's Compliment
The two's compliment of a number is defined as that number which when added to the original number will result in a sum of zero.
The binary number 110110110110 has a two's compliment of 001001001010:
110 110 110 110
001 001 001 001
Ignore the carried 1 ( 1) 000 000 000 000
Subtraction can also be preformed using the two's compliment method.
To subtract A from B, A must be expressed as it's two's compliment and then the value of B is added to it, e.g.
111 000 Two's compliment of A (i.e. -A)
101 111 B(47) base 10
(1) 100 111 B-A ( 39) base 10
Ignore the carry
0 comments:
Post a Comment