Twos-complement subtraction turns A − B into A + NOT B + 1 within a chosen word width. An adder-subtractor uses a mode bit to invert B for subtraction and to set the initial carry-in. The same carry chain then handles both operations.

Worked example

In four bits, compute 7 − 3. A = 0111 and B = 0011. Invert B to 1100 and add one through the carry-in: 0111 + 1100 + 1 = 1 0100. Keeping the four-bit result gives 0100, or 4.

What to watch for

The extra carry is discarded for the modular result. Signed overflow must still be checked separately; four-bit signed arithmetic cannot represent every mathematical difference.

Try it yourself

Compute four-bit 3 − 5 using this method.

Answer: 0011 + 1010 + 1 = 1110. In four-bit twos complement, 1110 is −2.

How to study this topic

State the operand width and signedness first. Work out a decimal answer, then compare it with the binary result. Keep result bits, carry, borrow and signed overflow distinct when interpreting the circuit's output.

Explore related programmes

These recorded programmes are upcoming. This article is general educational content, not a syllabus or course sample.

Digital Electronics