3.3.4 · D5Combinational Circuits

Question bank — Subtractors

1,389 words6 min readBack to topic

Before we start, a quick vocabulary anchor so nothing below uses an undefined symbol:


True or false — justify

A half subtractor and a half adder produce the same difference/sum bit
True. Both are — the XOR (parity) of the two inputs. Only the carry vs borrow output differs, and that only by a bar over .
The half-subtractor borrow equals the half-adder carry
False. They differ by the bar: borrow needs the top bit 0 (), carry needs it 1 (). Check row : borrow is 1 but .
For , a borrow-out occurs exactly when in that column
True. In a single unsigned bit column, means , which is precisely the condition for the half subtractor.
The difference bit of a full subtractor is 1 whenever an odd number of are 1
True. is the three-input parity function, which outputs 1 for exactly one or exactly three 1s.
Feeding into an adder gives and needs a dedicated subtractor circuit
False (the second half). It gives , and the whole point is you reuse the adder — no separate subtractor hardware is built.
In , the trailing can be dropped if
False. The is what converts one's complement () into two's complement; drop it and every result is off by one, regardless of .
Swapping to compute instead of just swaps which operand wears the bar in the borrow term
True. borrows on ; borrows on . The "smaller top forces the borrow" rule flips accordingly.
The final borrow-out of a multi-bit subtraction being 0 means the answer is non-negative
True. A leftover borrow means the top number was smaller (), so no final borrow signals and a non-negative difference.

Spot the error

"Borrow for half subtractor is because we take from ."
Wrong operand is barred. We borrow when the top bit can't cover the bottom, i.e. , giving . is the row , which needs no borrow.
"Full-adder carry is , so full-subtractor borrow is ."
The must become (and the XOR group gets a bar): . Copying the adder verbatim ignores that borrow needs a broke top bit.
"Two's complement of is just ."
That is one's complement. Two's complement is ; the missing is supplied as carry-in on the adder.
"Since , the half subtractor and half adder are literally the same circuit."
They share the XOR difference/sum gate but differ on the second output: adder produces carry , subtractor produces borrow . Different gate feeding that output, so not the same circuit.
"In the final (bit-2) borrow was 1, so the answer must be negative."
The bit-2 borrow-out was 0 for ; a 0 final borrow means so the result is non-negative. A 1 there would signal a negative (wrap-around) result.
"To make an adder subtract, invert instead of ."
You invert the subtrahend (via XOR gates controlled by one line) and set carry-in to 1. Inverting would compute , the wrong direction.

Why questions

Why is the borrow called "borrow" and not "carry"?
In addition an overflow is pushed up as a carry; in subtraction a shortage pulls a value down from the next column, so the higher column then "owes one" — that owed note travels out as the borrow.
Why does borrowing add exactly (not ) to the current column?
This is binary, so one unit of the next-higher place is worth . Borrowing that bundle turns a shortfall into .
Why is the full-subtractor difference an XOR of three inputs rather than something more complex?
The difference bit only cares about parity — whether the running subtraction leaves the least bit set. An odd count of 1s among leaves a 1, which is exactly three-input XOR.
Why do real CPUs not build a dedicated subtractor at all?
Because lets one adder do subtraction by inverting and setting carry-in to 1; a single control line turns the same hardware into an adder or subtractor, saving gates.
Why does a borrow-out from the two-stage view equal (OR) and not ?
A borrow is needed overall if either internal subtract needed one, so it's a logical OR of the two stage borrows, not an AND.
Why does replacing with turn the adder's carry formula into the subtractor's borrow formula?
Carry "generates" when both bits push a 1 upward (); borrow "generates" when the top bit is missing while the bottom demands (). The structural roles match; only the top-bit polarity flips.

Edge cases

Half subtractor with : is there ever a borrow?
No. Nothing is being taken away (), so and . The degenerate empty column.
Full subtractor with all inputs 1 (): why is borrow still 1 even though ?
We compute , which needs a borrow. The incoming borrow () alone exceeds what's left after , so the term fires and .
Column where : does the incoming borrow force a borrow-out?
No. exactly, so it consumes the borrow-in without needing to borrow further: .
What does a final borrow-out of 1 after subtracting two same-width numbers mean?
It means , so the true difference is negative; in fixed-width two's-complement arithmetic the result has wrapped around by .
Multi-bit subtraction: what must the borrow-in to the lowest (LSB) full subtractor be?
It must be 0 — there is no column below the least significant bit to owe anything, so the chain starts with .
Subtracting a number from itself, , across all bits: what are all the difference and borrow bits?
Every column has equal bits (), so each and each — a clean zero result with no borrow anywhere.
Two's-complement route for when : does the discarded carry-out appear?
Yes. , whose is exactly the carry-out you throw away, leaving difference — matching the direct subtractor's all-zero result.

Connections

  • Subtractors — the parent note these traps drill.
  • Adders — every "adder vs subtractor" trap traces back to the shared XOR and the barred .
  • Twos-Complement-Representation — source of the and the discarded carry.
  • Adder-Subtractor-Circuit — the "one control line, invert , carry-in 1" traps live here.
  • XOR-Gate — parity intuition behind both difference and controlled inversion.
  • Ripple-Carry-Chains — the multi-bit borrow-propagation edge cases.