Fig. 1 — Half SubtractorInteractive simulation

A half subtractor computes the one-bit operation A − B. It produces a Difference bit and a Borrow bit, but it has no borrow input from a less-significant stage.

What You'll Learn

  • Compute one-bit Difference and Borrow outputs for A − B.
  • Derive D = A ⊕ B and B_out = A̅B from the four-row truth table.
  • Identify the only input combination that generates a borrow.
  • Distinguish a half subtractor from both a half adder and a full subtractor.
  • Use a half subtractor as the least-significant stage of a wider subtractor.

How It Works

The Difference output is the XOR of A and B. It is HIGH whenever the two input bits differ, which is the least-significant bit of the arithmetic result. The Borrow output is HIGH only for A = 0 and B = 1, because subtracting 1 from 0 requires one unit to be borrowed from the next binary position.

The circuit implements Difference with one XOR gate. A passes through a NOT gate, and the inverted value is ANDed with B to form Borrow. Thus D = A ⊕ B and B_out = A̅B.

A half subtractor is analogous to a half adder only in interface size: both accept two input bits. Their XOR outputs have the same truth pattern, but the second output is different. A half adder generates Carry = AB, whereas a half subtractor generates Borrow = A̅B. Because there is no borrow-in input, this circuit is suitable for the least-significant stage; higher stages require full subtractors.

Truth Table

The two output bits describe A − B. Borrow is asserted when the local subtraction needs one unit from the next more-significant position.

InputsOutput
ABDifferenceBorrow
00000 − 0 = 0; no borrow is required.
01110 − 1 requires a borrow and leaves Difference = 1 at this bit position.
10101 − 0 = 1; no borrow is required.
11001 − 1 = 0; no borrow is required.

Boolean Expression

D=A⊕BD = A \oplus B

The Difference bit is HIGH exactly when A and B differ.

Bout=A‾BB_{out} = \overline{A} B

Borrow is HIGH only when the minuend bit A is 0 and the subtrahend bit B is 1.

Try It Step-by-Step

Set the listed controls in the embedded circuit, then compare the observed modeled state with the expected result.

  1. 1
    A=0B=0
    Expected:Difference = 0, Borrow = 0
    What you'll see:The circuit begins at the zero-result case with both indicators LOW.
  2. 2
    A=0B=1
    Expected:Difference = 1, Borrow = 1
    What you'll see:The Difference light and Borrow light both turn on: borrowing supplies 2 at this position, and 2 − 1 leaves 1.
  3. 3
    A=1B=0
    Expected:Difference = 1, Borrow = 0
    What you'll see:Only Difference is HIGH because 1 − 0 equals 1 directly.
  4. 4
    A=1B=1
    Expected:Difference = 0, Borrow = 0
    What you'll see:Equal HIGH inputs cancel, so both outputs return LOW.

Components Used

Applications and Design Context

Least-significant subtraction stage. The lowest bit of a ripple-borrow subtractor has no incoming borrow, so a half subtractor can replace a full subtractor there.

Arithmetic education. The circuit makes the relationship between a binary truth table and gate-level subtraction explicit.

Increment/decrement and comparison logic. Borrow generation appears in decrementers and in unsigned magnitude tests implemented through subtraction.

ALU building blocks. Although production ALUs commonly reuse an adder through two's-complement arithmetic, the half-subtractor equations remain a useful direct model of borrow behavior.

Frequently Asked Questions

Why is the result for 0 − 1 shown as Difference 1 with Borrow 1?

Borrowing one unit from the next binary position contributes 2 at the current position. The local calculation becomes 2 − 1 = 1, while Borrow records the debt passed to the next stage.

Why is it called a half subtractor?

It handles A and B but not an incoming borrow. A full subtractor adds B_in so identical cells can be cascaded at every higher bit position.

Is a half subtractor the inverse of a half adder?

No. They share the XOR pattern for Difference or Sum, but subtraction is not the logical inverse of addition. Their second equations differ: Borrow = A̅B, while Carry = AB.

Can half subtractors alone form a multi-bit subtractor?

Not directly, because stages above bit 0 must accept a borrow from the preceding stage. Use one half subtractor at bit 0 and full subtractors for the remaining positions.

Do real processors use separate subtractor circuits?

Many processors perform A − B by complementing B, adding 1, and using the existing adder. Direct borrow equations are still important for understanding unsigned subtraction and for specialized arithmetic structures.

Continue Learning