Half Subtractor Circuit

0A 0B XOR NOT AND DIFF 0 BORROW 0
DIFF = 0
BORROW = 0
A − B = 0

Truth Table

ABDiff (A⊕B)Borrow
0000
0111
1010
1100

How It Works

DIFF = A XOR B

The difference bit is 1 when A ≠ B — same as half adder's sum.

BORROW = NOT(A) AND B

Borrow is 1 only when A=0 and B=1 — we need to "borrow" from the next bit.