HS Digital Subtractor Tool

Half Subtractor Calculator

Calculate the Difference and Borrow-Out of a half subtractor using one-bit binary inputs A and B. View XOR difference logic, NOT-AND borrow logic, Boolean equations, truth-table values and step-by-step binary subtraction.

2 Binary Inputs Difference Borrow-Out XOR Logic NOT + AND Truth Table
Half Subtractor Logic Calculator A − B
Binary bit being subtracted from.
Binary bit being subtracted.
Half Subtractor Result
D=0 | Borrow=0
Difference 0
Borrow-Out 0
Mathematical A − B 0
Input Operation 0 – 0
XOR Result 0 XOR 0 = 0
NOT A NOT 0 = 1
Borrow Logic 1 AND 0 = 0
Difference Logic D = A XOR B
Borrow Logic Bout = NOT(A) AND B
Inputs: A = 0, B = 0
Difference = A XOR B = 0
NOT A = 1
Borrow-Out = (NOT A) AND B = 0
Mathematical subtraction: 0 – 0 = 0

What Is a Half Subtractor?

A half subtractor is a combinational digital logic circuit that subtracts one single binary bit from another. The two inputs are normally labeled A and B, where A is the minuend bit and B is the subtrahend bit.

The circuit produces two outputs: Difference and Borrow-Out. Difference represents the low-order subtraction result, while Borrow-Out indicates that the current position needs to borrow from the next higher binary position.

Half subtractors are useful for understanding binary subtraction, Boolean logic and the basic circuits used to construct larger subtractors.

Half Subtractor Boolean Equations

Difference Equation

The Difference output is 1 when A and B are different. Therefore the Difference function is XOR.

Difference = A XOR B

Borrow-Out Equation

A borrow is needed only when A is 0 and B is 1.

Borrow-Out = NOT(A) AND B

Half Subtractor Truth Table

A B Difference Borrow-Out Meaning
0 0 0 0 0 − 0 = 0
0 1 1 1 Borrow required
1 0 1 0 1 − 0 = 1
1 1 0 0 1 − 1 = 0

Worked Example 1: 0 − 0

A = 0
B = 0

Difference:
0 XOR 0 = 0

Borrow:
NOT(0) AND 0
1 AND 0 = 0

Difference = 0
Borrow-Out = 0

Worked Example 2: 0 − 1

A = 0
B = 1

0 cannot subtract 1 directly.
A borrow is required from the next higher bit.

Difference:
0 XOR 1 = 1

Borrow:
NOT(0) AND 1
1 AND 1 = 1

Difference = 1
Borrow-Out = 1

Worked Example 3: 1 − 0

A = 1
B = 0

Difference:
1 XOR 0 = 1

Borrow:
NOT(1) AND 0
0 AND 0 = 0

Difference = 1
Borrow-Out = 0

Worked Example 4: 1 − 1

A = 1
B = 1

Difference:
1 XOR 1 = 0

Borrow:
NOT(1) AND 1
0 AND 1 = 0

Difference = 0
Borrow-Out = 0

Why Does 0 − 1 Produce a Borrow?

At a single binary position, zero does not contain enough value to subtract one. The position must therefore borrow one unit from the next higher binary place.

Because each binary place has twice the value of the position to its right, borrowing one from the next higher position gives binary 10 at the current position.

10₂ − 1₂ = 1₂

Difference = 1
Borrow-Out = 1

Half Subtractor Logic Gates

XOR Gate

An XOR gate calculates the Difference because its output is 1 whenever A and B are different.

D = A XOR B

NOT and AND Gates

The Borrow output is created by inverting A and then ANDing that value with B.

Bout = NOT(A) AND B

Half Adder vs Half Subtractor

Feature Half Adder Half Subtractor
Main operation Binary addition Binary subtraction
Inputs A, B A, B
Primary output Sum Difference
Secondary output Carry Borrow
Primary XOR logic A XOR B A XOR B
Second equation A AND B NOT(A) AND B
Incoming carry/borrow No No

Half Subtractor vs Full Subtractor

Feature Half Subtractor Full Subtractor
Input A Yes Yes
Input B Yes Yes
Borrow-In No Yes
Difference Yes Yes
Borrow-Out Yes Yes
Suitable for middle stages No Yes

Limitations of a Half Subtractor

A half subtractor cannot accept a borrow from a previous less significant position. This makes it unsuitable by itself for every stage of general multi-bit binary subtraction.

A full subtractor adds a third input called Borrow-In, allowing the borrow produced by one stage to affect the next stage.

Where Half Subtractors Are Used

Digital Logic Education

Half subtractors demonstrate how simple Boolean gates can implement one-bit binary subtraction.

Subtractor Circuit Design

Half-subtractor logic provides a foundation for understanding full subtractors and larger subtraction circuits.

Boolean Algebra

The circuit provides practical examples of XOR, NOT and AND Boolean operations.

Computer Architecture

Studying subtractor stages helps explain how digital processors perform binary arithmetic at the logic level.

Important Half Subtractor Notes

Important: a half subtractor accepts exactly two one-bit inputs: A and B.

It does not accept an incoming borrow.

The Difference equation is A XOR B.

Borrow-Out is NOT(A) AND B.

The only input combination that directly creates a borrow is A = 0, B = 1.

Related BinaryCon Tools

Half Subtractor Calculator FAQs

What is a half subtractor?
A half subtractor is a combinational digital circuit that subtracts one single binary bit from another and produces Difference and Borrow-Out outputs.
How many inputs does a half subtractor have?
It has two one-bit inputs, normally labeled A and B.
How many outputs does a half subtractor have?
It has two outputs: Difference and Borrow-Out.
What is the Difference equation?
Difference equals A XOR B.
What is the Borrow-Out equation?
Borrow-Out equals NOT(A) AND B.
When does a half subtractor generate a borrow?
A borrow is generated when A is 0 and B is 1.
What happens when 0 is subtracted from 1?
For A = 1 and B = 0, Difference is 1 and Borrow-Out is 0.
What happens when 1 is subtracted from 0?
For A = 0 and B = 1, the Difference output is 1 and Borrow-Out is 1 because a borrow is required.
Does a half subtractor have Borrow-In?
No. A half subtractor has no Borrow-In input. A full subtractor includes this third input.
Which gates are used in a half subtractor?
Difference can be implemented with XOR, while Borrow-Out can be implemented using NOT and AND gates.
Is a half subtractor a combinational circuit?
Yes. Its outputs depend only on the current A and B inputs.
Can a half subtractor perform multi-bit subtraction by itself?
Not for all stages because it cannot accept a Borrow-In from a less significant position.
Scroll to Top