🧠 Introduction
A Binary Adder/Subtractor is a combinational circuit that can perform both addition and subtraction of two binary numbers using the same hardware.
👉 Instead of making two separate circuits (one adder and one subtractor), we design one smart circuit that can add or subtract based on a control input.
🎯 Purpose
- To add two binary numbers OR
- To subtract one binary number from another
using a single circuit.
⚙️ Working Principle
- The circuit uses a Parallel Adder (multiple Full Adders).
- It takes two binary numbers: A and B.
- A control signal called Mode (M) decides the operation:
- If M = 0 → Perform Addition (A + B)
- If M = 1 → Perform Subtraction (A – B)
👉 Subtraction is done by using 2’s Complement Method:
- Take 1’s complement of B (invert all bits of B)
- Add 1 to it (carry-in becomes 1)
Thus, subtraction becomes:
A - B = A + (1's complement of B) + 1
🛠️ Circuit Structure
The circuit contains:
- XOR gates to complement B when needed
- Full Adders to perform the binary addition
📈 Block Diagram
Each bit has the following connection:
B[i] --|XOR|--- B'[i] ---> Full Adder
|M|
A[i] ------------------> Full Adder
Cin ---- Carry In ---> Full Adder
Sum[i] ---> Output
Carry Out --> Next Full Adder
- XOR gate decides whether to invert B[i] or not.
- Cin = M (control bit):
- M=0 → Add
- M=1 → Subtract
📑 Truth Table
Mode (M) | Operation | Action on B | Cin |
---|---|---|---|
0 | A + B (Addition) | Use B as it is | 0 |
1 | A – B (Subtraction) | 1’s complement of B | 1 |
🧩 Detailed Working
For Addition (M = 0):
- B[i] XOR 0 = B[i] → B remains unchanged
- Cin = 0
- Operation: A + B
For Subtraction (M = 1):
- B[i] XOR 1 = ¬B[i] → B gets complemented (1’s complement)
- Cin = 1
- Operation: A + (1’s complement of B) + 1 (i.e., A – B)
🔥 Example: 4-bit Binary Adder/Subtractor
Suppose we have:
- A = 0101 (5 in decimal)
- B = 0011 (3 in decimal)
👉 Addition (M=0):
0101 (A)
+ 0011 (B)
---------
1000 (8)
👉 Subtraction (M=1):
- 1’s complement of B = 1100
- Add Cin = 1
0101 (A)
+ 1100 (¬B)
+ 1 (Cin)
---------
0010 (2)
Thus, 5 – 3 = 2 ✅
🧠 Important Components
Component | Function |
---|---|
XOR Gate | Complements B bits based on Mode M |
Full Adder | Performs addition of A, modified B, and Carry In |
Control Signal (M) | Decides Addition or Subtraction |
🌟 Advantages of Binary Adder/Subtractor
- Single circuit can perform two operations (saving hardware cost).
- Fast — just by changing Mode (M) signal.
- Simple design — only need XOR gates + Full Adders.
⚡ Applications
- Arithmetic Logic Units (ALUs) inside CPUs
- Digital calculators
- Microprocessors and Microcontrollers
- Digital systems that require fast arithmetic operations
🎯 Summary
Feature | Binary Adder/Subtractor |
---|---|
Operations | Addition or Subtraction |
Controlled by | Mode (M) |
Hardware | XOR Gates + Full Adders |
Addition Method | Direct addition |
Subtraction Method | 2’s complement (invert B + add 1) |
Major Use | In ALUs, CPUs, Digital Devices |
✏️ Pro Tip for Exams
- Always draw the Block Diagram with XOR gates and Full Adders.
- Explain the working separately for M=0 and M=1 cases.
- Use simple examples like 4-bit addition/subtraction to show clarity.