Two’s complement provides a uniform way to perform subtraction by converting the subtrahend to its negative representation and then adding.
Determine the number of bits required (including a sign bit).
Find the binary representation of the subtrahend.
Invert all bits (one’s complement).
Add 1 to obtain the two’s complement.
Add this result to the minuend.
If a carry out of the most‑significant bit occurs, discard it.
Example: \$101012 - 001112\$ using 5‑bit two’s complement
Subtrahend: \$00111_2\$
One’s complement: \$11000_2\$
Two’s complement: \$11001_2\$ (add 1)
Add to minuend:
1 0 1 0 1
+ 1 1 0 0 1
-------------
1 0 0 1 0 0
Discard the overflow carry (the leftmost 1): result \$00100_2\$.
Result: \$001002 = 4{10}\$, which is the correct difference \$21{10} - 7{10} = 14_{10}\$ when interpreted as a signed 5‑bit number (the example demonstrates the importance of choosing enough bits to avoid overflow).
3. Practice Questions
Add \$11012\$ and \$01112\$. Show each step.
Subtract \$01012\$ from \$10102\$ using the direct borrow method.
Subtract \$00102\$ from \$01102\$ using two’s complement with a 4‑bit word length.
Explain why two’s complement allows a single addition circuit to handle both addition and subtraction.
4. Summary
Binary addition uses a simple carry rule; the result may be one bit longer than the operands.
Binary subtraction can be performed by borrowing or by adding the two’s complement of the subtrahend.
Two’s complement simplifies hardware design because subtraction becomes addition, and it uniquely represents negative numbers.
Suggested diagram: A step‑by‑step illustration of binary addition with carries, and a separate diagram showing the two’s complement conversion process.