6.5 Full Subtractor: Subtracting With an Incoming Borrow

Identify the full subtractor's three inputs (A, B, Bin) and two outputs (Difference, Bout), state the Difference equation, and avoid the common confusion between borrow-in and carry-in when chaining full adders and full subtractors.

The full subtractor extends the half subtractor exactly the way the full adder extends the half adder: it adds a third input, Bin (borrow-in), so it can correctly subtract B and any incoming borrow from A, producing a Difference bit and a Bout (borrow-out) that can feed the next-higher bit position's borrow-in. Chaining full subtractors together — analogous to chaining full adders — is what makes it possible to subtract binary numbers of arbitrary width, with each stage correctly propagating any borrow generated by a lower bit position upward.

Inputs and outputs

A full subtractor takes exactly three inputs: A (the minuend bit), B (the subtrahend bit), and Bin (the borrow-in from the previous, less-significant bit position). It produces exactly two outputs: Difference (the result bit for this position) and Bout (the borrow-out, to be passed into the next-higher bit position's Bin).

This input/output structure is a direct parallel to the full adder's (A, B, Cin) inputs and (SUM, Cout) outputs — the roles are the same, only the arithmetic operation and the exact polarity of the borrow logic differ from the carry logic.

The Difference equation

The Difference output of a full subtractor is D = A ⊕ B ⊕ Bin — the same three-input XOR pattern used for the full adder's SUM, because XOR's 'odd number of 1s' behavior correctly tracks the least-significant result bit for subtraction just as it does for addition. This is a genuinely useful pattern to internalize: whenever three single-bit quantities are being combined and the least-significant result bit is being asked for, a three-input XOR is very often the right starting point, regardless of whether the surrounding operation is addition or subtraction.

The Bout (borrow-out) equation, by contrast, is not identical to the full adder's Cout — its correct form is Bout = A'B + A'Bin + BBin (a borrow is generated whenever A is 0 and either B or Bin is 1, or whenever both B and Bin are 1 regardless of A), reflecting that a borrow condition depends on A being too small, not on an excess of 1-bits the way a carry does.

Do not confuse Borrow-in with Carry-in

A frequent and costly mistake when working with adders and subtractors side by side is treating Bin (borrow-in) and Cin (carry-in) as interchangeable, or wiring a full adder's Cout directly into a full subtractor's Bin (or vice versa) as if the two signals meant the same thing. They do not: Cin represents an overflow being pushed up from a lower-order addition, while Bin represents a deficiency being pushed up from a lower-order subtraction — the underlying arithmetic conditions that generate each signal are fundamentally different (excess vs. shortfall), even though both are single-bit signals that get chained from one stage to the next in superficially similar ways.

This distinction matters concretely in real subtractor circuits: many practical implementations build subtraction by adding the two's complement of the subtrahend (using ordinary full adders with Cin doing the work), specifically to avoid needing a separate borrow chain at all — but whenever a design does use an explicit borrow-based full subtractor, mixing up Bin and Cin will silently produce incorrect results that can be very difficult to trace back to the root cause.

Full subtractor inputs, outputs, and Difference equation

Bin (borrow-in) and Cin (carry-in) look structurally similar but represent different arithmetic conditions — never substitute one for the other. Difference = A ⊕ B ⊕ Bin mirrors the full adder's SUM = A ⊕ B ⊕ Cin exactly in form.

Inputs:  A, B, Bin
Outputs: Difference, Bout

Difference = A ⊕ B ⊕ Bin

(Bout, by the same style of derivation as full-adder Cout, but for a deficiency condition:
 Bout = A'B + A'Bin + BBin)

Code Examples

With A=0 and both B=1 and Bin=1 demanding value from a bit that has nothing to give, the subtraction is doubly short — it both produces Difference=0 (an odd count of 1s among A,B,Bin: here two 1s, B and Bin, which is even, so 0⊕1⊕1=0) and forces Bout=1, propagating the shortfall onward to the next, higher bit position exactly the way a full adder propagates an excess via Cout. Expected result: Difference=0, Bout=1

Difference = A ⊕ B ⊕ Bin, computed the same three-input-XOR way as a full adder's SUM.

This illustrates the spec's tricky problem directly: do not confuse borrow-in with carry-in. Even though Cout and Bout are both single-bit 'overflow-style' signals produced by adjacent-stage combinational logic, they encode opposite arithmetic conditions (excess vs. shortfall) and must never be cross-wired between an adder chain and a subtractor chain.

Common mistake: Wiring a carry-out signal from an adder stage into a borrow-in input of a subtractor stage (or vice versa), because both are single 'overflow' bits that look interchangeable.

A=0, B=1, Bin=1

Difference = A XOR B XOR Bin = 0 XOR 1 XOR 1 = 0
Bout       = A'B + A'Bin + BBin = (1)(1) + (1)(1) + (1)(1) = 1

Result: Difference=0, Bout=1
Interpretation: A already needed to borrow just to cover B (0-1), and there is also an incoming
borrow (Bin=1) to account for -- both deficiencies compound, so a borrow must again be passed
up to the next bit position, and the difference bit works out to 0.
INCORRECT wiring:  Full-Adder-stage-0.Cout ----> Full-Subtractor-stage-1.Bin
                    (treats an addition overflow signal as if it were a subtraction shortfall signal)

CORRECT wiring:     Full-Adder-stage-0.Cout ----> Full-Adder-stage-1.Cin
                     Full-Subtractor-stage-0.Bout ----> Full-Subtractor-stage-1.Bin
                     (carry chains only connect to carry chains; borrow chains only connect to borrow chains)

Full subtractor block diagram

A full subtractor mirrors a full adder's structure, but its borrow chain must stay entirely separate from any carry chain.

A   B   Bin
   |   |    |
   +---+----+---> [ Difference = A XOR B XOR Bin ]
   |   |    |
   +---+----+---> [ Bout = A'B + A'Bin + BBin ]

  Inputs:  A, B, Bin       Outputs: Difference, Bout
  Bout of one stage wires into Bin of the next stage in a multi-bit subtractor chain
  -- never into a Cin of an adder chain, and never fed from a Cout of an adder chain.

Important Rules

A full subtractor has three inputs (A, B, Bin) and two outputs (Difference, Bout).

Difference = A ⊕ B ⊕ Bin — the same three-input XOR pattern used for a full adder's SUM.

Bout signals a borrow whenever A is too small to cover B and Bin combined.

Never wire a Cout (carry-out) into a Bin (borrow-in), or a Bout into a Cin — carry chains and borrow chains represent different arithmetic conditions and must stay separate.

Why most real hardware avoids explicit borrow chains

Most production CPU and microcontroller ALUs avoid building a dedicated borrow-chain subtractor at all: instead, subtraction A−B is implemented as A + (two's complement of B), which reduces to A + B' + 1, computable with the exact same full-adder hardware already used for addition (with Cin fixed to 1 and B routed through an inverter). This is more hardware-efficient than duplicating an entire second borrow-propagation chain, and it is precisely why understanding the explicit Difference/Borrow formulation in this lesson is most valuable as a conceptual and educational foundation — and directly useful in specialized subtractor circuits (some BCD arithmetic units and dedicated comparator logic) — even where it is not the default industrial implementation choice.

How It's Built From Other Gates

(A XOR B), Bin Full subtractor Difference path: Difference = A XOR B XOR Bin, the same two-stage XOR chain used for the full adder's SUM.

How It's Built From Other Gates

A'B, A'Bin, BBin Full subtractor Bout path: Bout = A'B + A'Bin + BBin — a borrow propagates out whenever A is 0 and either B or Bin is 1, or whenever B and Bin are both 1 regardless of A.

Treating Bin (borrow-in) and Cin (carry-in) as the same kind of signal and wiring them interchangeably between adder and subtractor stages.

Keep carry chains (Cin/Cout, used by adders) and borrow chains (Bin/Bout, used by subtractors) completely separate; each represents a different arithmetic condition (excess vs. shortfall) even though both are single propagated bits.

The spec's tricky problem states this directly: do not confuse Borrow-in with Carry-in. Cross-wiring them produces a circuit that compiles and simulates without an obvious structural error, yet silently computes incorrect results.

[tricky] What is the key mistake to avoid when connecting a chain of full subtractors alongside a chain of full adders in the same design? A. Confusing Borrow-in (Bin) with Carry-in (Cin) and wiring one chain's propagated signal into the other chain's input B. Forgetting to include an XOR gate in the Difference logic C. Using more than three inputs on a single full subtractor D. Connecting Bout to the next stage's Bin, which is actually the correct wiring

A. Confusing Borrow-in (Bin) with Carry-in (Cin) and wiring one chain's propagated signal into the other chain's input — The spec's tricky problem is explicit: do not confuse Borrow-in with Carry-in. Cin propagates an addition's excess (overflow), while Bin propagates a subtraction's deficiency (shortfall); wiring them together produces silently incorrect arithmetic even though the circuit structure looks superficially valid.

Which equation correctly gives the Difference output of a full subtractor? A. D = A ⊕ B ⊕ Bin B. D = A'B + A'Bin + BBin C. D = A · B · Bin D. D = A + B + Bin

A. D = A ⊕ B ⊕ Bin — The spec gives Difference = A ⊕ B ⊕ Bin directly, mirroring the full adder's three-input XOR SUM formula. The A'B + A'Bin + BBin form is the Bout (borrow-out) equation, not the Difference.

Compute Difference and Bout for A=1, B=0, Bin=1 in a full subtractor, and explain the result in terms of borrowing.

Difference = A⊕B⊕Bin = 1⊕0⊕1 = 0. Bout = A'B + A'Bin + BBin = (0)(0) + (0)(1) + (0)(1) = 0. Result: Difference=0, Bout=0 — A=1 was exactly enough to cover both B=0 and Bin=1 (1−0−1=0) with nothing left over and no need to borrow from the next bit position.

First subtract B and Bin from A directly: 1 − 0 − 1 = 0, with no shortfall, since A already had enough to cover both.