When you start out with binary, one of the first questions you ask
is how can we work with binary numbers and perform the fundamental operations of addition and subtraction. Division is just repeated subtraction and multiplication is just repeated addition. The ALU using the fundamental binary adder unit is only capable of performing additon with a carry bit. So how do we do subtraction of binary numbers with the ALU? What exactly is a negative binary number?
Let A be a binary number
To find the negative number -A, such that
A - A = 0
But subtraction is just additon of a negative number
i.e. A +(-A) = 0 ---Equn.1
Clearly, this operation can be carried out by the ALU binary adder.
So all we need to do is find a number that is the negative binary representation of A, such that Equn.1 is satisfied.
Let A = b1 b2 ... bn be an n bit binary number
Let A' = c1 c2 ... cn be the 1's complement of A
i.e. for every bi = 0 let ci = 1 and vice versa
A + A' = 11...1 an n bit binary number with all bits 1
If we now add a binary 1 to A' we will have an n+1 bit binary number with all n bits 0 and the highest n+1 bit 1
Therefore if we carry out this addition in an n bit binary adder we would have the result of the addition as an n bit binary 0
We have therefore used the binary adder to perform the subtraction operation of Equn.1
This also leads us to define the 2's complement of a binary number as the (1's complement of the number) + 1, and conclude that the 2's complement of the number A is the negative binary representation of A
If at first you don't succeed, relax. You're like the rest of us.