Picture it as a single lamp on the board. Every letter you will meet (A, B, D…) is one of these lamps — either dark or glowing.
Figure s01 — A bit as a lamp. Left: dark lamp = value 0. Right: glowing lamp = value 1. There is no in-between state; this "strictly on-or-off" fact is what makes truth tables finite and buildable.
Why the topic needs it: subtraction of "binary numbers" means subtraction of columns of bits. If you don't picture each letter as a lamp that is strictly on-or-off, the truth tables below look like magic. They are not — they are just "try every possible pattern of lamps."
Do 3−5 in your head. You can't — 3 is smaller. On paper you'd "borrow from the next column." The same thing happens with single bits: 0−1 can't stay 0−1, so we grab value from the column above.
Figure s02 — Borrowing in one column. The top bit is A=0, the bottom is B=1, so 0−1 is impossible. We pull a bundle worth 2 (yellow arrow) from the higher column, compute 0+2−1=1 giving the difference D=1, and send a "you owe 1" flag upward (pink arrow): that flag is Bout=1.
Why the topic needs it: the entire difference between a subtractor and an adder is this one signal. An adder pushes a carry up; a subtractor pulls a borrow down. Same picture, opposite direction.
Why the topic needs it: the HS ignores incoming borrow (no Bin). The FS accepts Bin so it can be chained. That single extra input is the only structural difference between the two circuits.
The bar can also sit over a whole expression, not just one letter. For example A⊕B means "first compute A⊕B, then flip the result." So A⊕B=1 exactly when A and B are the same (because A⊕B is 1 when they differ, and the bar flips that).
Why the topic needs it: the borrow only happens when the top bit is 0. But formulas multiply things that are true (=1). So to say "top bit is 0" as a 1-signal, we write Aˉ — it equals 1 exactly when A=0. That is why the borrow is AˉB and not AB.
So AˉB+BBin is read as ((Aˉ)⋅B)+(B⋅Bin) — the bar hits only A, each AND-group forms first, then OR joins them. A bar over a group, like A⊕B, always needs the whole expression evaluated first because the bar sits over all of it.
Why the topic needs it:Bout=AˉB+AˉBin+BBin literally reads "borrow if (top is 0 AND bottom is 1) OR (top is 0 AND borrow-in) OR (bottom is 1 AND borrow-in)." AND builds each condition; OR collects them.
Figure s03 — XOR reads "1 when they differ." The four columns show every (A,B) pair as two lamps; the output is 1 (pink) only in the two middle cases where one lamp is on and the other off. This "1 when different" rule is exactly the difference bit D.
Extending to three:A⊕B⊕Bin is 1 when an odd number of the three are 1. That is why the full-subtractor difference is a three-way XOR — it counts parity, and an odd count means one leftover candy.
D is 1 in every row where an odd number of inputs are 1 — that is three-input XOR. Bout is 1 in every row where a borrow is needed. Grouping those five borrow-rows gives the standard sum-of-products form.
Real hardware doesn't build a separate subtractor; it reuses an adder. The claim is:
A−B=A+Bˉ+1(mod2n)
Let us derive it rather than quote it. Every step is a WHAT / WHY.
Step 1 — What is Bˉ as a number? For an n-bit value, flipping every bit turns B into (2n−1)−B. Why: the all-ones n-bit number equals 2n−1, and flipping B is the same as computing all-ones minusB bit by bit (no borrow ever, since each column is 1−Bi). So:
Bˉ=(2n−1)−B
Step 2 — Add the +1.Why: we want a clean 2n−B (the "two's complement" of B), and Step 1 gave us one short of that.
Bˉ+1=(2n−1)−B+1=2n−B
Step 3 — Add A.Why: our goal is A−B, so start from A and add the quantity from Step 2.
A+Bˉ+1=A+(2n−B)=2n+(A−B)
Step 4 — Drop the 2n.Why:2n is one bit wider than our n-bit result; it lands in bit position n, which our n-bit output cannot hold, so it falls off. Discarding it is precisely what "(mod2n)" means (keep only the low n bits).
A+Bˉ+1(mod2n)=A−B
Recall Self-test: can you answer each before moving on?
A bit can take which values? ::: Only 0 or 1.
What do HS and FS stand for? ::: Half Subtractor (no borrow-in) and Full Subtractor (with borrow-in Bin).
In A−B, which letter is the top (subtracted-from) bit? ::: A.
What does Aˉ equal when A=0? ::: Aˉ=1 (NOT flips it).
What does the overbar physically signal in a borrow formula? ::: "The top bit is 0" expressed as a 1-signal — the boss is broke.
B vs Bout vs Bin — which one is the bottom input operand? ::: Plain B; the others are borrow flags going up (Bout) and coming in (Bin).
In boolean algebra, what does + mean and what is 1+1? ::: OR; 1+1=1.
What does A⋅B (or AB) mean? ::: AND — true only when both are 1.
Which binds tightest: NOT, AND, or OR? ::: NOT (the bar) binds tightest, then AND, then OR.
Does AˉB mean (NOT A)⋅B or NOT(A⋅B)? ::: (NOT A)⋅B — the bar covers only what it sits on.
A⊕B equals 1 in which case? ::: When A and Bdiffer.
Half-subtractor formulas? ::: D=A⊕B and Bout=AˉB.
Full-subtractor formulas? ::: D=A⊕B⊕Bin and Bout=AˉB+AˉBin+BBin.
Why is the difference bit D=A⊕B? ::: Leftover is 1 exactly when the two bits differ — the definition of XOR.
What does "(mod2n)" throw away? ::: Any value at or above 2n — the bit in position n (a carry, not a borrow) — keeping only the low n bits.
Derive A−B=A+Bˉ+1: what is Bˉ as a number? ::: Bˉ=(2n−1)−B, so Bˉ+1=2n−B, and A+(2n−B)=2n+(A−B); drop the 2n.