Full Subtractor
Definition
A full subtractor is a combinational logic circuit that subtracts one binary digit and a borrow input from another binary digit, producing a difference output and a borrow output.
It has three inputs:
A
- : minuend bit
B
- : subtrahend bit
Bin
- : borrow input from the previous stage
And two outputs:
D
- : difference
Bout
- : borrow output to the next stage
The circuit follows binary subtraction rules and is used when subtracting multi-bit binary numbers, where each stage may need to borrow from the next higher bit.
Main Content
1. Full Subtractor Inputs and Outputs
- The full subtractor works on three binary inputs:
- A = the bit being subtracted from
- B = the bit being subtracted
- Bin = the borrow from the previous lower bit position
- It produces two outputs:
- Difference (D) = result of subtraction at that bit
- Borrow output (Bout) = indicates whether the current stage needs to borrow from the next higher stage
The logical meaning of the inputs is important:
A
- is the current bit of the minuend
B
- is the current bit of the subtrahend
Bin
- is necessary because in multi-bit subtraction, a lower bit may force the current bit to borrow
The output is interpreted as:
D = 0 or 1
- , depending on subtraction result
Bout = 1
- when the subtraction at that stage cannot be completed without borrowing
Truth table of full subtractor:
| A | B | Bin | D | 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 |
This table is the foundation for deriving the Boolean expressions and logic implementation.
2. Boolean Expressions and Logic Functions
- The difference output of a full subtractor is given by:
- D = A ⊕ B ⊕ Bin
- The borrow output is given by:
- Bout = A'B + A'Bin + BBin
- Another common equivalent form is:
- Bout = A'B + Bin(A' ⊕ B)
Here:
⊕
- means XOR
'
- means NOT
Meaning of the difference equation:
- XOR gives output 1 when inputs are different
- In subtraction, the difference bit becomes 1 when an odd number of inputs are 1
Meaning of the borrow equation:
- Borrow occurs when the subtrahend or incoming borrow is too large for the current minuend bit
- The expression shows all cases where borrowing is required:
- If A = 0 and B = 1, borrow is needed
- If A = 0 and Bin = 1, borrow is needed
- If B = 1 and Bin = 1, borrow is needed
These equations are extremely useful because they allow the circuit to be built using basic gates such as XOR, AND, OR, and NOT.
3. Implementation Using Logic Gates and Half Subtractors
- A full subtractor can be implemented in two common ways:
- Using basic logic gates
- Using two half subtractors and one OR gate
Using basic logic gates
A direct implementation uses:
- XOR gates for the difference
- AND, OR, and NOT gates for the borrow
For difference:
- First XOR: A ⊕ B
- Second XOR: (A ⊕ B) ⊕ Bin
For borrow:
- Generate borrow terms:
- A'B
- A'Bin
- BBin
- Then combine them with OR gates
This method is straightforward and helps in understanding the circuit at the Boolean level.
Using two half subtractors
A half subtractor subtracts one bit from another and gives difference and borrow. A full subtractor can be built as follows:
- First half subtractor subtracts B from A
- Output difference: D1 = A ⊕ B
- Borrow: B1 = A'B
- Second half subtractor subtracts Bin from D1
- Final difference: D = D1 ⊕ Bin = A ⊕ B ⊕ Bin
- Borrow: B2 = D1'Bin
- Final borrow output:
- Bout = B1 + B2
This method is important because it shows how more complex arithmetic circuits are often constructed from simpler ones.
Block representation:
A ─────┐
│ ┌────────────┐
B ──────┼─────►│ Half │── D1 ───┐
│ │ Subtractor │ │
└─────►└────────────┘ │
▼
Bin ───────────────────────────────►┌────────────┐
│ Half │── D
│ Subtractor │
└────────────┘
Borrow outputs combined:
B1 + B2 = Bout
Working / Process
1. Compare the input bits
- The circuit first examines the minuend bit A, subtrahend bit B, and incoming borrow Bin.
- It determines whether subtraction can be done directly or whether a borrow is required.
2. Generate the difference
- The difference is calculated using XOR operations.
- If the number of 1s among the inputs is odd, the difference output becomes 1.
- If the number of 1s is even, the difference output becomes 0.
3. Determine the borrow output
- If A is smaller than B or smaller than Bin after accounting for the current subtraction, the circuit generates a borrow.
- This borrow is passed to the next higher bit stage in multi-bit subtraction.
Example 1: Subtract 1 - 0 - 0
- A = 1, B = 0, Bin = 0
- Difference = 1
- Borrow = 0
Example 2: Subtract 0 - 1 - 0
- A = 0, B = 1, Bin = 0
- Difference = 1
- Borrow = 1
Example 3: Subtract 0 - 0 - 1
- A = 0, B = 0, Bin = 1
- Difference = 1
- Borrow = 1
These examples show how the full subtractor handles direct subtraction and borrowing in different cases.
Advantages / Applications
Essential for multi-bit binary subtraction
- It allows subtraction in binary numbers with more than one bit by handling borrow propagation between stages.
Useful in arithmetic logic units (ALUs)
- Full subtractors are core components in ALUs inside microprocessors and digital computers for arithmetic operations.
Foundation for larger arithmetic circuits
- They are used in subtractor arrays, binary comparators, and other complex digital systems where subtraction is required.
Summary
- A full subtractor subtracts three binary inputs: A, B, and Bin.
- It produces two outputs: difference and borrow.
- It is commonly built using XOR, AND, OR, and NOT gates or by combining two half subtractors.
- Important terms to remember: full subtractor, difference, borrow, minuend, subtrahend, borrow input, borrow output, combinational logic.