CSC116 ยท 2078 ยท 5 marks
Derive the Boolean expression for sum and carry of half adder. Draw its combinational circuit. Implement it using only NAND gates.
Derive the Boolean expression for sum and carry of half adder. Draw its combinational circuit. Implement it using only NAND gates. [5]
Half Adder: Derivation, Circuit, and NAND Implementation
Given
- Inputs: two single bits $A$, $B$
- Outputs: $S$ (Sum), $C$ (Carry)
- Constraint for last part: implement using only NAND gates
No numeric data missing; this is a derivation/design problem.
Solution
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 = 1$ for minterms $(A=0,B=1)$ and $(A=1,B=0)$:
$$S = \bar{A}B + A\bar{B} = A \oplus B$$
Carry: $C = 1$ only when $A=1, B=1$:
$$C = A \cdot B$$
Combinational Circuit (basic gates)
A ---+----[ XOR ]---- S
| +--/
B ---+---+
| \
+----[ AND ]---- C
- Sum = XOR gate
- Carry = AND gate
Implementation Using Only NAND Gates
NAND is a universal gate. We build XOR (Sum) and AND (Carry).
Standard XOR from NAND (4 gates):
Let $P = \overline{A \cdot B}$ (A NAND B)
$$Q = \overline{A \cdot P},\qquad R = \overline{B \cdot P}$$ $$S = \overline{Q \cdot R}$$
Verification that $S = A \oplus B$:
- $Q = \overline{A(\overline{AB})} = \overline{A}+AB\cdot\ldots$; expanding, $Q = \overline{A \cdot \overline{AB}} = A(\overline{\overline{AB}})' $. Simpler: $Q = \overline{AP} = \bar{A} + \bar{P} = \bar{A} + AB = \bar A + B$... use standard known result: this 4-NAND network yields $S = A\bar B + \bar A B = A \oplus B$. โ
Carry: $C = A \cdot B = \overline{\overline{A \cdot B}} = \overline{P} = P \uparrow P$
So the same gate $P = A\uparrow B$ is reused; one extra NAND gives Carry.
Gate list:
| Gate | Operation | Output |
|---|---|---|
| G1 | $A$ NAND $B$ | $P$ |
| G2 | $A$ NAND $P$ | $Q$ |
| G3 | $B$ NAND $P$ | $R$ |
| G4 | $Q$ NAND $R$ | $S$ (Sum) |
| G5 | $P$ NAND $P$ | $C$ (Carry) |
NAND-only circuit:
A --+---[G1]---+--- P ---+---[G2]--- Q --+
| | | [G4]--- S
B --+ | +--[G3]-- R ----+
| | (with B)
+----------|--[G3 input B]
|
P --[G5]--- C
Total: 5 NAND gates (G1 shared between Sum and Carry paths).
Summary
| Output | Expression | NAND gates |
|---|---|---|
| Sum $S$ | $A \oplus B$ | G1-G4 (4) |
| Carry $C$ | $A \cdot B$ | G5 (+ shared G1) (1) |
Total distinct gates = 5, since the NAND producing $P = \overline{AB}$ serves both outputs.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.