CSC213 ยท 2079 ยท 5 marks
Explain the binary adder-subtractor circuit with suitable diagram.
Explain the binary adder-subtractor circuit with suitable diagram. [5]
Quick answer
A binary adder-subtractor is a combinational circuit that can perform both addition and subtraction of binary numbers using a single circuit, controlled by a mode select input.
Binary Adder-Subtractor Circuit
Introduction
Working Principle
The circuit uses the concept of 2's complement subtraction:
A - B = A + (2's complement of B) = A + (1's complement of B) + 1
- When Mode M = 0 โ Circuit performs Addition: A + B
- When Mode M = 1 โ Circuit performs Subtraction: A - B (i.e., A + B' + 1)
The key component used is the XOR gate:
| M | Bi | XOR Output (M โ Bi) |
|---|---|---|
| 0 | 0 | 0 (passes B unchanged) |
| 0 | 1 | 1 (passes B unchanged) |
| 1 | 0 | 1 (complements B) |
| 1 | 1 | 0 (complements B) |
So when M = 1, each bit of B is complemented (1's complement), and M = 1 is also fed into the carry-in (C0) of the first Full Adder, which adds 1, completing the 2's complement.
Circuit Diagram (4-bit Adder-Subtractor)
B3 A3 B2 A2 B1 A1 B0 A0
| | | | | | | |
XOR | XOR | XOR | XOR |
| M----+ | M----+ | M----+ | M----+---> C0 (Carry In)
| | | | | | | |
FA <--C3 FA <--C2 FA <--C1 FA <-- M
| | | |
S3 S2 S1 S0
Diagram:
B3 A3 B2 A2 B1 A1 B0 A0
| | | | | | | |
C3 FA C2 FA C1 FA C0 FA <-- C0 = M
| | | |
S3 S2 S1 S0
Each stage consists of a Full Adder (FA) where:
- One input is Ai
- Other input is M โ Bi (XOR of mode bit and Bi)
- Carry ripples from stage to stage
- Initial carry C0 = M
Operation Summary
| Mode (M) | Operation | Expression |
|---|---|---|
| M = 0 | Addition | S = A + B, C0 = 0 |
| M = 1 | Subtraction | S = A + B' + 1 = A - B, C0 = 1 |
Overflow Condition
While adding two n-bit binary numbers, the result may be a number with (n+1) bits -- this situation is called overflow.
In the adder-subtractor, overflow can be detected by checking if the final carry out is inconsistent with the sign bits of the operands.
Conclusion
The binary adder-subtractor efficiently combines addition and subtraction in one circuit using XOR gates and Full Adders, with the mode input M controlling the operation. This reduces hardware complexity significantly compared to having separate adder and subtractor circuits.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.