1. Introduction
In Computer System Architecture (CSA), half adder and half subtractor are basic combinational logic circuits used to perform simple binary addition and binary subtraction of two single-bit inputs.
These are fundamental building blocks for designing complex arithmetic operations inside processors (ALU – Arithmetic Logic Units).
2. Half Adder
Definition
A Half Adder is a combinational circuit that performs the addition of two single-bit binary numbers.
It produces two outputs:
- Sum (S): Represents the result of addition.
- Carry (C): Represents overflow if the sum exceeds 1.
Inputs and Outputs
- Inputs: A, B (two binary digits)
- Outputs: Sum (S), Carry (C)
Truth Table
A | B | Sum (S) | Carry (C) |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
Boolean Expressions
- Sum (S) = A ⊕ B (A XOR B)
- Carry (C) = A · B (A AND B)
Logic Diagram
A -----|⊕|---- Sum
|
|
B -----|
A -----|&|---- Carry
|
|
B -----|
- XOR Gate for Sum
- AND Gate for Carry
Working
- If both inputs are 0 → Sum = 0, Carry = 0
- If one input is 1 → Sum = 1, Carry = 0
- If both inputs are 1 → Sum = 0, Carry = 1 (because 1 + 1 = 10 in binary)
3. Half Subtractor
Definition
A Half Subtractor is a combinational circuit that performs the subtraction of two single-bit binary numbers.
It produces two outputs:
- Difference (D): Represents the result of subtraction.
- Borrow (B): Represents if a ‘borrow’ is needed.
Inputs and Outputs
- Inputs: A, B (minuend and subtrahend)
- Outputs: Difference (D), Borrow (B)
Truth Table
A | B | Difference (D) | Borrow (B) |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
Boolean Expressions
- Difference (D) = A ⊕ B (A XOR B)
- Borrow (B) = (¬A) · B
Here:
- ¬A means NOT A.
- Borrow occurs when A is 0 and B is 1.
Logic Diagram
A -----|⊕|---- Difference
|
|
B -----|
A ---|¬|--+---|&|---- Borrow
|
B -----------|
- XOR Gate for Difference
- NOT gate and AND gate combination for Borrow
Working
- If both inputs are 0 → Difference = 0, Borrow = 0
- If A is 0 and B is 1 → Difference = 1, Borrow = 1 (because you need to borrow 1)
- If A is 1 and B is 0 → Difference = 1, Borrow = 0
- If both are 1 → Difference = 0, Borrow = 0
🌟 Summary Table
Feature | Half Adder | Half Subtractor |
---|---|---|
Purpose | Adds two bits | Subtracts two bits |
Inputs | A, B | A, B |
Outputs | Sum, Carry | Difference, Borrow |
Sum/Diff | A ⊕ B | A ⊕ B |
Carry/Borrow | A · B | (¬A) · B |
🎯 Key Points to Remember
- Half Adder: Adds two bits — useful in basic addition units.
- Half Subtractor: Subtracts two bits — useful in arithmetic circuits.
- XOR Gate is used in both circuits for Sum and Difference.
- Half Adder cannot add three bits (for that, we use Full Adder).
- Half Subtractor cannot handle borrow from previous stage (for that, we use Full Subtractor).