In digital logic circuits, subtraction of binary numbers is performed using subtractor circuits. A half subtractor and a full subtractor are combinational circuits used for binary subtraction. Let's discuss each in detail.
A half subtractor is a basic circuit that subtracts two single-bit binary numbers. It has two inputs and two outputs:
| Input A | Input B | Difference (D) | Borrow (B) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
Where:
Diagram of Half Subtractor:
A ───┐
│
│ XOR ─── Difference
B ───┘──────┐
│
│ AND ─── Borrow
└──────────┘
A full subtractor is a more advanced circuit that subtracts three binary bits. It has three inputs:
It produces two outputs:
| A | B | Bin | Difference (D) | Borrow (Bout) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
Where:
The full subtractor can be constructed using:
Diagram of Full Subtractor:
A ───┐
│
│ XOR ─── Difference
B ───┘──────┐
│
┌──────┴──────┐
│ │
│ │
Bin ───┘ AND ─── Borrow Out
│
OR
│
└─ Borrow out
| Feature | Half Subtractor | Full Subtractor |
|---|---|---|
| Inputs | 2 inputs (A and B) | 3 inputs (A, B, and Borrow in) |
| Outputs | 2 outputs (Difference and Borrow) | 2 outputs (Difference and Borrow out) |
| Borrow Input | No borrow input | Has borrow input from the previous stage |
| Used in | Simple subtraction of two bits | Multi-bit subtraction (used in chained subtractors) |
| Complexity | Simple design with basic gates | More complex, requires XOR, AND, OR gates |
Just as full adders are used in multi-bit addition, full subtractors can be used to subtract multi-bit binary numbers. A full subtractor can be cascaded to perform multi-bit subtraction, where the borrow output from one full subtractor becomes the borrow input to the next full subtractor.
For example, to subtract two 4-bit binary numbers:
A3 A2 A1 A0
- B3 B2 B1 B0
---------------
D3 D2 D1 D0 (Difference)
Borrow Out
Open this section to load past papers