Cambridge A-Level Computer Science 9618 – 3.2 Logic Gates and Logic Circuits
3.2 Logic Gates and Logic Circuits
In this section we review the basic logic gates used in digital electronics and construct the corresponding truth tables. Understanding these tables is essential for designing and analysing combinational circuits.
Learning Objective
Construct the truth table for each of the logic gates listed below.
Basic Logic Gates
AND gate – \$A \cdot B\$
OR gate – \$A + B\$
NOT gate – \$\overline{A}\$ (inverter)
NAND gate – \$\overline{(A \cdot B)}\$
NOR gate – \$\overline{(A + B)}\$
XOR gate – \$A \oplus B\$ (exclusive‑OR)
XNOR gate – \$\overline{(A \oplus B)}\$ (exclusive‑NOR)
Truth Tables
1. AND Gate (\$A \cdot B\$ )
A
B
Output \$A \cdot B\$
0 0 0
0 1 0
1 0 0
1 1 1
2. OR Gate (\$A + B\$ )
A
B
Output \$A + B\$
0 0 0
0 1 1
1 0 1
1 1 1
3. NOT Gate (Inverter) – \$\overline{A}\$
A
Output \$\overline{A}\$
0 1
1 0
4. NAND Gate – \$\overline{(A \cdot B)}\$
A
B
Output \$\overline{(A \cdot B)}\$
0 0 1
0 1 1
1 0 1
1 1 0
5. NOR Gate – \$\overline{(A + B)}\$
A
B
Output \$\overline{(A + B)}\$
0 0 1
0 1 0
1 0 0
1 1 0
6. XOR Gate – \$A \oplus B\$
A
B
Output \$A \oplus B\$
0 0 0
0 1 1
1 0 1
1 1 0
7. XNOR Gate – \$\overline{(A \oplus B)}\$
A
B
Output \$\overline{(A \oplus B)}\$
0 0 1
0 1 0
1 0 0
1 1 1
Extended Example – 3‑Input AND Gate
For gates with more than two inputs the principle is the same: the output is true only when all inputs are true.
A
B
C
Output \$A \cdot B \cdot C\$
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
Suggested diagram: Symbolic representation of each gate (AND, OR, NOT, NAND, NOR, XOR, XNOR) with input and output lines.
Summary
Identify the logical operation required.
List all possible input combinations (binary counting).
Apply the definition of the gate to each combination to determine the output.
Record the results in a truth table.
Mastering these truth tables provides the foundation for building more complex combinational circuits such as adders, multiplexers, and decoders.