6.4 Half Subtractor: Subtracting One Bit From Another
Derive the half subtractor's Difference and Borrow equations, contrast them against the half adder's SUM and CARRY, and explain precisely when a borrow is generated.
The half subtractor is the subtraction counterpart to the half adder: it computes A − B for two single input bits, producing a Difference bit and a Borrow bit that signals whether the subtraction required 'borrowing' from the next-higher bit position (just as, in ordinary decimal subtraction, subtracting a larger digit from a smaller one requires borrowing from the column to its left). Like the half adder, it operates on exactly two bits with no facility for an incoming borrow from a lower-order bit position, which sets up the same limitation the full subtractor is built to remove.
Deriving Difference and Borrow from binary subtraction
Binary subtraction of two single bits follows the same four cases as addition, but subtraction rather than addition: 0−0=0, 0−1 requires a borrow (giving a difference bit of 1, since borrowing turns 0 into 2 in binary place value, and 2−1=1), 1−0=1, and 1−1=0. Reading off the Difference column, it is 1 exactly when A and B differ, and 0 when they are equal — the same XOR pattern seen in the half adder's SUM, so Difference = A ⊕ B.
Reading off the Borrow column, a borrow is needed only in the single case A=0, B=1 — that is, only when the bit being subtracted (B) is 1 while the bit being subtracted from (A) is 0, which is exactly what NOT-A AND B expresses. This gives Borrow = A'B, where A' denotes the complement (NOT) of A.
Contrast with the half adder
It is worth noticing explicitly how close the half subtractor's equations are to the half adder's: Difference = A ⊕ B is identical in form to SUM = A ⊕ B (XOR does not distinguish addition from subtraction, since a same-bit or different-bit pattern is symmetric either way). Borrow = A'B, however, is not the same as CARRY = A·B — Borrow requires A to be 0, while CARRY requires A to be 1, because a carry is generated by an excess (both bits high) while a borrow is generated by a deficiency (subtracting a 1 from a 0).
This asymmetry between CARRY and Borrow is the key conceptual point of this lesson: addition and subtraction are not simply mirror images of each other at the single-bit level, even though their 'primary' output (SUM vs. Difference) happens to share the same XOR formula.
The same limitation as the half adder
Exactly as the half adder cannot accept an incoming carry, the half subtractor has only two inputs and cannot accept an incoming borrow from a lower-order bit position. It is therefore only directly correct for the least-significant bit of a multi-bit subtraction; every higher bit position of a real multi-bit subtractor needs a full subtractor (the next topic), which adds a Bin (borrow-in) input analogous to the full adder's Cin.
Half subtractor equations
Exactly 2 inputs (A, B) and 2 outputs (Difference, Borrow) — no borrow-in input exists. Difference has the same formula as the half adder's SUM; Borrow is NOT the same formula as CARRY.
Difference = A ⊕ B
Borrow = A'B (NOT A, AND B)Code Examples
Only the row A=0,B=1 produces a Borrow, exactly matching the intuition that subtracting a 1 from a 0 forces a borrow from the next bit position. Every other row's Difference matches the XOR pattern already familiar from the half adder's SUM output.
Borrow = 1 only for A=0, B=1 — subtracting 1 from 0 is the sole case that requires a borrow.
This case is the spec's own tricky-problem scenario: a borrow is generated when subtracting 1 from 0. Conceptually, this mirrors ordinary decimal subtraction — just as subtracting 7 from 3 in a single decimal digit forces a borrow of 10 from the next column (giving 13−7=6), subtracting 1 from 0 in binary forces a borrow of 2 (binary's base) from the next bit position, giving (0+2)−1=1 as the difference bit. Expected result: Difference=1, Borrow=1
A=0, B=1 → Difference=1, Borrow=1, because subtracting 1 from 0 requires borrowing from the next bit position.
A B | Difference Borrow
0 0 | 0 0
0 1 | 1 1
1 0 | 1 0
1 1 | 0 0
Difference = A XOR B: 0^0=0, 0^1=1, 1^0=1, 1^1=0 -- matches exactly
Borrow = A'B: A=0,B=1 -> A'=1, A'B=1 ; all other rows give A'B=0 -- matches exactlyA=0, B=1
Difference = A XOR B = 0 XOR 1 = 1
Borrow = A'B = (NOT 0) AND 1 = 1 AND 1 = 1
Result: Difference=1, Borrow=1
Interpretation: 0 - 1 cannot be represented directly in a single unsigned bit, so a borrow of 2 is taken
from the next higher bit position: (0 + 2) - 1 = 1, matching Difference=1.Half subtractor block diagram
A half subtractor is one XOR gate (Difference) plus one NOT gate and one AND gate (Borrow), computing A minus B.
______
A ---| |
| XOR |---- Difference (A XOR B)
B ---|______|
A ---[NOT]---+
| ______
B -----------+---| AND |---- Borrow (A' AND B)
'---|______|
Inputs: A, B Outputs: Difference, Borrow
No borrow-in input exists on a half subtractor.Important Rules
Difference = A ⊕ B (identical formula to the half adder's SUM).
Borrow = A'B — a borrow is generated only when A=0 and B=1 (subtracting 1 from 0).
A half subtractor has no borrow-in input and can only correctly compute the least-significant bit of a multi-bit subtraction.
Borrow and CARRY are not the same formula, despite both half adder and half subtractor sharing the XOR-based primary output.
Where subtractor logic is used
Standalone subtractor circuits are less commonly built as dedicated hardware in modern CPUs than adders are, because most ALUs implement subtraction by adding the two's complement of the subtrahend (using an adder together with an XOR-based complementing stage) rather than building a separate subtractor datapath. Even so, understanding the half and full subtractor's Difference/Borrow logic directly is valuable both as a conceptual stepping stone to two's-complement arithmetic and in specialized contexts — such as certain arithmetic units, BCD subtraction circuits, and digital comparator designs — where an explicit borrow chain is used rather than complement-and-add.
How It's Built From Other Gates
Half subtractor Difference path: Difference = A XOR B, the same XOR pattern as the half adder's SUM.
How It's Built From Other Gates
Half subtractor Borrow path: Borrow = A'B — A is inverted first, then AND'd with B, since a borrow is only needed when A=0 and B=1.
Assuming Borrow uses the same formula as CARRY (A·B) because both circuits look structurally similar.
Use Borrow = A'B, since a borrow is generated by a deficiency (A=0, B=1), not an excess (A=1, B=1) the way a carry is.
CARRY (A·B) signals that the sum of two 1-bits overflowed a single bit; Borrow (A'B) signals that subtracting a 1 from a 0 underflowed a single bit — these are different conditions, and using CARRY's formula for Borrow gives 0 in exactly the case (A=0,B=1) where a borrow is actually needed.
Treating the case A=0, B=1 as an error condition or as producing Difference=0, since '0 minus 1 doesn't exist' in unsigned single-bit arithmetic.
Compute the difference correctly as 1, understanding that a borrow of 2 (binary's base) from the next bit position makes (0+2)−1=1 well-defined, exactly the way decimal subtraction borrows 10 from the next column.
The spec's tricky problem states this directly: a borrow is generated when subtracting 1 from 0. The half subtractor's job is precisely to compute a correct, well-defined Difference and Borrow pair for this case, not to treat it as invalid.
[tricky] In a half subtractor, in which single input combination is Borrow equal to 1? A. A=0, B=1 (subtracting 1 from 0) B. A=1, B=1 (both inputs are 1) C. A=1, B=0 (subtracting 0 from 1) D. A=0, B=0 (both inputs are 0)
A. A=0, B=1 (subtracting 1 from 0) — The spec's tricky problem states this directly: a borrow is generated when subtracting 1 from 0. Formally, Borrow = A'B, which evaluates to 1 only when A=0 and B=1 — every other combination correctly produces Borrow=0.
Why is Borrow = A'B, and not simply A·B, in a half subtractor? A. Because a borrow signals a deficiency (A too small relative to B), which occurs specifically when A=0 and B=1, unlike a carry, which signals an excess (both A and B being 1) B. Because A'B and A·B always produce identical results for any A and B C. Because Borrow is only defined for negative numbers, requiring a complement D. Because half subtractors do not use AND gates at all
A. Because a borrow signals a deficiency (A too small relative to B), which occurs specifically when A=0 and B=1, unlike a carry, which signals an excess (both A and B being 1) — A carry (as in a half adder) is generated by an excess — both inputs being 1, exceeding what a single bit can hold. A borrow is generated by the opposite condition — a deficiency where A is 0 but B is 1, meaning there is nothing in A to subtract B from without reaching into the next higher bit position. A'B captures exactly and only that deficiency case.
Construct the Borrow truth table for a half subtractor from first principles (not from the A'B formula) by reasoning about when subtracting B from A requires a borrow, then confirm it matches A'B.
A=0,B=0: 0−0=0, no borrow. A=0,B=1: 0−1 is negative for a single unsigned bit, borrow needed. A=1,B=0: 1−0=1, no borrow. A=1,B=1: 1−1=0, no borrow. Only A=0,B=1 needs a borrow, which matches Borrow=A'B exactly, since A'B is 1 only when A=0 and B=1.
A borrow is needed exactly when A is smaller than B for single bits, i.e., when A=0 and B=1.