Full Subtractor Calculator
Calculate the Difference and Borrow-Out of a full subtractor using binary inputs A, B and Borrow-In. View XOR, NOT, AND and OR logic, Boolean equations, truth-table values and step-by-step binary subtraction.
What Is a Full Subtractor?
A full subtractor is a combinational digital logic circuit that performs one-bit binary subtraction while also processing an incoming borrow from a less significant position.
The three inputs are normally called A, B and Borrow-In. A is the minuend bit, B is the subtrahend bit, and Borrow-In represents a borrow received from a previous subtraction stage.
The circuit produces a Difference output and a Borrow-Out output. Borrow-Out can be passed to the next more significant subtraction stage.
Full Subtractor Boolean Equations
Difference Equation
The Difference bit is obtained by XORing all three inputs.
Borrow-Out Equation
Borrow-Out indicates that the current stage requires a borrow from the next higher binary position.
Alternative Full Subtractor Borrow Equation
The Borrow-Out function can also be represented in an expanded Boolean form.
Both forms describe the same full-subtractor borrow behavior.
Full Subtractor Truth Table
| A | B | Borrow-In | Difference | Borrow-Out | A − B − Bin |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 | -1 |
| 0 | 1 | 0 | 1 | 1 | -1 |
| 0 | 1 | 1 | 0 | 1 | -2 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 | -1 |
Worked Example 1: A = 1, B = 0, Bin = 1
B = 0
Bin = 1
Mathematical subtraction:
1 − 0 − 1 = 0
Difference:
1 XOR 0 XOR 1 = 0
Borrow-Out:
0
Final:
Difference = 0
Borrow-Out = 0
Worked Example 2: A = 0, B = 1, Bin = 1
B = 1
Bin = 1
0 − 1 − 1 = -2
A borrow is required from the next higher binary position.
Difference = 0
Borrow-Out = 1
Worked Example 3: A = 1, B = 1, Bin = 1
B = 1
Bin = 1
1 − 1 − 1 = -1
Difference = 1
Borrow-Out = 1
How Full Subtractor Logic Works
Difference Stage
XOR logic combines A, B and Borrow-In to determine the Difference bit.
Direct Borrow Condition
When A is 0 and B is 1, the subtraction requires a borrow.
Borrow-In Condition
Borrow-In can force another borrow when A XOR B is 0.
Final Borrow-Out
The direct-borrow and Borrow-In terms are ORed together.
Full Subtractor vs Half Subtractor
| Feature | Half Subtractor | Full Subtractor |
|---|---|---|
| A input | Yes | Yes |
| B input | Yes | Yes |
| Borrow-In | No | Yes |
| Total inputs | 2 | 3 |
| Difference | Yes | Yes |
| Borrow-Out | Yes | Yes |
| Can process previous borrow | No | Yes |
| Multi-bit subtraction stages | Limited | Suitable |
Full Subtractor Using Two Half Subtractors
A full subtractor can conceptually be constructed using two half subtractors and an OR gate.
A − B
→ Difference D1
→ Borrow B1
Half Subtractor 2:
D1 − Bin
→ Final Difference
→ Borrow B2
Final Borrow-Out:
Bout = B1 OR B2
Full Subtractors in Multi-Bit Binary Subtraction
For wider binary values, full subtractor stages can be chained. The Borrow-Out of a lower-order stage becomes the Borrow-In of the next more significant stage.
FS1: A1 − B1 − Bout1 → D1 + Bout2
FS2: A2 − B2 − Bout2 → D2 + Bout3
FS3: A3 − B3 − Bout3 → D3 + Bout4
Full Adder vs Full Subtractor
| Feature | Full Adder | Full Subtractor |
|---|---|---|
| Main operation | Addition | Subtraction |
| Third input | Carry-In | Borrow-In |
| Main output | Sum | Difference |
| Secondary output | Carry-Out | Borrow-Out |
| Primary XOR equation | A XOR B XOR Cin | A XOR B XOR Bin |
| Used in | Multi-bit addition | Multi-bit subtraction |
Important Full Subtractor Notes
Its Difference output is calculated as A XOR B XOR Bin.
Borrow-Out indicates that the current stage requires value from the next more significant binary position.
For A = 0, B = 1 and Bin = 1, Difference is 0 and Borrow-Out is 1.
The mathematical value shown in the calculator is useful for explaining the logic condition; the Difference and Borrow-Out together are the actual full-subtractor outputs.