Produce accurate truth tables for common combinational circuits – especially the half‑adder and full‑adder – translate Boolean expressions into gate‑level diagrams, simplify expressions with Karnaugh maps, implement using NAND‑only gates, and discuss propagation delay and gate count. Extend the knowledge to simple sequential circuits (flip‑flops) and link the hardware design to algorithmic thinking (AO2) and abstract data types (ADT).
| Gate | Symbol | Boolean expression | Truth table | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| NOT | ![]() | \(\lnot A\) |
| |||||||||||||||
| AND | ![]() | \(A\cdot B\) |
| |||||||||||||||
| OR | ![]() | \(A+B\) |
| |||||||||||||||
| NAND | ![]() | \(\overline{A\cdot B}\) |
| |||||||||||||||
| NOR | ![]() | \(\overline{A+B}\) |
| |||||||||||||||
| XOR | ![]() | \(A\oplus B\) |
|
Adds two single‑bit binary numbers (inputs \(A\) and \(B\)). Outputs are Sum and Carry‑out.
| A | B | Sum (A⊕B) | Carry (A·B) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |

The XOR can be realised with four NAND gates; the AND with a single NAND followed by a NOT (implemented by a NAND with its inputs tied together).
\[
A\oplus B = \overline{\overline{A\cdot\overline{B}}\;\cdot\;\overline{\overline{A}\cdot B}}
\]

Adds three single‑bit numbers: data bits \(A, B\) and a carry‑in \(C_{\text{in}}\). Outputs are Sum and Carry‑out.
\[
\begin{aligned}
\text{Sum}&=A\oplus B\oplus C_{\text{in}}\\[2mm]
C{\text{out}}&=(A\cdot B)\;+\;\bigl(C{\text{in}}\cdot (A\oplus B)\bigr)
\end{aligned}
\]
| A | B | Cin | Sum (A⊕B⊕Cin) | Cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |

Second half‑adder adds \(S1\) to \(C{\text{in}}\) producing final sum \(S\) and carry \(C_2\).
Final carry‑out is \(C{\text{out}} = C1 + C_2\) (OR gate).
Replace every XOR, AND and OR with their NAND equivalents. The resulting circuit uses nine NAND gates.

\[
C{\text{out}} = (A\cdot B) + \bigl(C{\text{in}}\cdot (A\oplus B)\bigr)
\]
| \(C_{\text{in}}\) | AB | |||
|---|---|---|---|---|
| 00 | 01 | 11 | 10 | |
| 0 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 | 1 |
\[
\boxed{C{\text{out}} = (A\cdot B) + (A\cdot C{\text{in}}) + (B\cdot C_{\text{in}})}
\]
\[
\begin{aligned}
C{\text{out}} &= (A\cdot B) + C{\text{in}}\cdot(A\oplus B)\\
&= (A\cdot B) + C_{\text{in}}\cdot\bigl[(A\cdot\overline{B})+(\overline{A}\cdot B)\bigr]\\
&= (A\cdot B) + (A\cdot C{\text{in}}\cdot\overline{B}) + (B\cdot C{\text{in}}\cdot\overline{A})\\
&= (A\cdot B) + (A\cdot C{\text{in}}) + (B\cdot C{\text{in}}) \qquad(\text{since }X\cdot\overline{X}=0)
\end{aligned}
\]
| Symbol | Characteristic equation |
|---|---|
![]() | \(Q_{\text{next}} = S + \overline{R}\cdot Q\) |
| Symbol | Characteristic equation |
|---|---|
![]() | \(Q_{\text{next}} = J\cdot\overline{Q} + \overline{K}\cdot Q\) |
Connect the Sum output of a half‑adder to the data input of a JK flip‑flop (J = K = Sum). Clock the flip‑flop each time a new addition is performed. The register holds the Sum until the next clock pulse.

READ A, B, Cin // three input bits
S ← A XOR B XOR Cin // Sum
C1 ← A AND B // first carry term
C2 ← Cin AND (A XOR B) // second carry term
Cout ← C1 OR C2 // Carry‑out
OUTPUT S, Cout
Complexity comment: All operations are elementary Boolean gates; the algorithm runs in constant time \(O(1)\) – a requirement for AO2.

Cin ← 0.i = 0 to n‑1:(S[i], Cout) ← FullAdder(A[i], B[i], Cin).S[i] in the result array.Cin ← Cout.S[0..n‑1] holds the sum; Cin after the loop is the final carry‑out.This demonstrates how a hardware design (full‑adder) maps onto a software‑oriented ADT (array) – a useful bridge for exam questions that ask you to “describe how a 4‑bit adder could be built using the half‑adder and full‑adder blocks”.
Problem: Simplify the Boolean function
\(F(A,B,C) = \overline{A}B C + A\overline{B}C + A B\overline{C} + A B C\).
Solution steps (students should follow):
Students should verify the result by Boolean algebra.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.