Subtractors are digital circuits used to subtract one binary number from another. Like adders, subtractors are essential components in arithmetic units (ALUs) of digital systems and processors. The basic operation of subtraction in binary involves borrowing, and subtractors are designed to handle this process.
There are two main types of subtractors:
We'll explore both types of subtractors in detail, along with their design and applications.
A half subtractor is the simplest subtractor circuit that subtracts two binary digits. It subtracts two single-bit numbers and produces two outputs:
A half subtractor does not take into account any borrow from a previous stage, hence the term "half."
| A | B | Difference (D) | Borrow (B) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
A full subtractor is a more general subtractor that can handle the subtraction of two binary digits with a borrow input. It subtracts three bits:
The full subtractor produces two outputs:
| A | B | Borrow_in (Bin) | Difference (D) | Borrow_out (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 | 0 |
Handling Borrowing:
Difference Calculation:
Carry/Borrow Propagation:
In a multi-bit binary subtraction, we need to chain multiple full subtractors together. Each subtractor handles a pair of bits (from the two numbers being subtracted) and takes the borrow from the previous subtractor. This is similar to how a ripple carry adder works.
For an -bit subtraction:
This process is known as ripple borrowing because the borrow bit ripples through all stages from the least significant bit to the most significant bit.
If we want to subtract two 4-bit binary numbers and , we would use four full subtractors:
The final borrow-out () will represent whether a borrow occurred from the most significant bit.
To speed up the operation of subtractors, borrow lookahead logic is sometimes used. Borrow lookahead subtractors use parallel logic to generate the borrow signal for all stages simultaneously, rather than waiting for the borrow to propagate through each stage. This significantly reduces the delay in multi-bit subtractions, just as carry lookahead adders reduce delay in multi-bit additions.
Arithmetic Logic Units (ALUs): Subtractors are essential components of ALUs, which perform arithmetic operations like addition, subtraction, and comparison in processors.
Digital Signal Processing (DSP): Subtractors are used in DSP systems for signal manipulation, especially when performing operations like filtering or image processing.
Binary Counters: Subtractors are used in digital counters and timers, where counting down is necessary.
Control Systems: Subtractors are used in control systems for error detection and correction, where the difference between expected and actual values is important.
Subtractors are fundamental circuits in digital systems, used to perform binary subtraction. From the simple half subtractor to the more complex full subtractor and borrow lookahead techniques, subtractors are essential for various applications, including processors, ALUs, and DSP systems. Understanding the design and operation of subtractors is crucial for building efficient arithmetic circuits in digital systems.
Open this section to load past papers