The table summarises the standard graphical symbol (textual form), the Boolean function and a typical programming‑style expression for each of the six basic gates.
Gate
Symbol (textual)
Boolean Function
Typical Expression
NOT
¬A
\(\overline{A}\)
\(\overline{A}\) or !A
AND
A·B
\(A \land B\)
\(A \,\&\&\, B\)
OR
A+B
\(A \lor B\)
\(A \,||\, B\)
NAND
¬(A·B)
\(\overline{A \land B}\)
! (A \&\& B)
NOR
¬(A+B)
\(\overline{A \lor B}\)
! (A || B)
XOR
A⊕B
\(A \oplus B\)
A ^ B or A xor B
2. Truth Tables for the Six Basic Gates
2.1 NOT Gate
A
\(\overline{A}\)
0
1
1
0
2.2 AND Gate
A
B
A·B
0
0
0
0
1
0
1
0
0
1
1
1
2.3 OR Gate
A
B
A+B
0
0
0
0
1
1
1
0
1
1
1
1
2.4 NAND Gate
A
B
\(\overline{A·B}\)
0
0
1
0
1
1
1
0
1
1
1
0
2.5 NOR Gate
A
B
\(\overline{A+B}\)
0
0
1
0
1
0
1
0
0
1
1
0
2.6 XOR Gate
A
B
A⊕B
0
0
0
0
1
1
1
0
1
1
1
0
3. Universal Gates – NAND and NOR
Both NAND and NOR can be used to build any Boolean function; they are therefore called *universal* gates. Knowing how to construct the basic gates from NAND (or NOR) is a common exam requirement.
3.1 Building AND, OR and NOT with NAND only
NOT using NAND: \(\overline{A}=A\;\text{NAND}\;A\)
AND using NAND: \(A·B=\overline{\,\overline{A·B}\,}= (A\;\text{NAND}\;B)\;\text{NAND}\;(A\;\text{NAND}\;B)\)
OR using NAND: \(A+B=\overline{\overline{A}\;\cdot\;\overline{B}}=
4. Constructing Circuits – From Boolean Expression to Diagram
When a problem statement provides a Boolean expression, follow these systematic steps:
Identify each distinct sub‑expression (product terms, negations, etc.).
Select the appropriate gate for every sub‑expression.
Connect the outputs of earlier gates to the inputs of later gates, respecting the order of operations (parentheses first, then NOT, then AND, then OR).
Label every input and the final output clearly.
Check the design against a truth table (optional but recommended).
5. Constructing Circuits – From Diagram to Boolean Expression
Read the diagram from left to right (inputs → gates → output) and translate each gate back into its Boolean form.
Example 2 – Deriving the expression from a mixed‑gate circuit
Figure 3 – Example circuit (inputs A, B, D; output Y).
First gate: NAND(A,B) → \(\overline{A·B}\).
Second gate: XOR of the NAND output with D → \(\overline{A·B}\;\oplus\;D\).
Overall expression: Y = \(\overline{A·B} \oplus D\).
6. Practical Considerations
Gate delay: each gate introduces a small propagation time. In a cascade, total delay ≈ (number of gate levels) × (typical gate delay). Keep the number of levels low for faster circuits.
Fan‑in: the maximum number of inputs a gate can accept (e.g. a 2‑input AND has fan‑in = 2). Larger fan‑in may increase delay and power consumption.
Fan‑out: the number of gate inputs that can be driven by a single output. Most TTL/CMOS gates can drive several inputs; exceeding the recommended fan‑out can cause voltage‑level problems.
De Morgan’s \(\overline{A·B}= \overline{A} + \overline{B}\) and \(\overline{A+B}= \overline{A}·\overline{B}\)
Distributive \(A·(B+C)=A·B + A·C\)
7.2 Worked K‑Map Simplification
Minimise the 3‑variable function
\[
F(A,B,C)=\sum m(1,2,4,5,6,7)
\]
1. Fill the 3‑variable K‑map (AB as rows, C as columns).
AB\C
0
1
00
0
1
01
1
1
11
1
1
10
1
0
2. Form the largest possible groups of 1s (powers of two):
Group 1: the four 1s covering columns C=1 (covers minterms 1,3,5,7) → gives term \(C\).
Group 2: the four 1s covering rows AB=01 and 11 (covers minterms 2,3,6,7) → gives term \(B\).
Group 3: the two 1s at (AB=10, C=0) and (AB=00, C=0) → gives term \(\overline{C}·\overline{A}\).
3. Minimal SOP expression:
\[
F = C + B + \overline{A}\,\overline{C}
\]
4. Gate count after simplification (using only 2‑input gates):
NOT for \(\overline{A}\) and \(\overline{C}\) – 2 gates.
AND for \(\overline{A}\,\overline{C}\) – 1 gate.
OR to combine the three terms – 2 OR gates (first OR combines \(C\) and \(B\), second OR adds \(\overline{A}\,\overline{C}\)).
Total = 5 gates (compared with 7 gates for the original SOP).
7.3 Simplification Using NAND‑Only Design (example)
Design \(F = A·B\) using only NAND gates (see Section 3). The final circuit uses two NAND gates, saving one gate compared with the naïve implementation (AND + NOT). This illustrates the practical benefit of recognising universal‑gate designs.
8. Worked Example – Full Design Process
Problem Statement
Design a circuit that implements
\[
F = (A·B) + \lnot C + (D·E)
\]
Step 1 – Build the Diagram (Expression → Circuit)
AND gate for \(A·B\).
NOT gate for \(\lnot C\).
AND gate for \(D·E\).
OR gate that combines the three results.
Figure 4 – Complete circuit for the given function.
Step 2 – Truth Table for the Circuit
A
B
C
D
E
A·B
\(\lnot C\)
D·E
F
0
0
0
0
0
0
1
0
1
0
0
0
0
1
0
1
0
1
0
0
0
1
0
0
1
0
1
0
0
0
1
1
0
1
1
1
0
0
1
0
0
0
0
0
0
Step 3 – Derive the Expression from the Diagram (Circuit → Expression)
Reading Figure 4 from left to right:
First AND → \(A·B\)
NOT → \(\lnot C\)
Second AND → \(D·E\)
OR combines them → \(F = (A·B) + \lnot C + (D·E)\)
9. Practice Tasks
Expression → circuit & truth table
\(G = \lnot (X·Y) + (X·\lnot Y)\)
Draw the circuit (use a NAND for the first term, a NOT for \(\lnot Y\), an AND, then an OR).
Complete the 4‑row truth table for inputs X, Y and output G.
Circuit → expression
(Insert a diagram of a NOR feeding an XOR, for example.)
Write the Boolean expression represented by the circuit.
State the minimal number of 2‑input gates required after simplification.
Universal‑gate design
Which combination of the six basic gates yields the fewest gates for the function \(J = A \oplus B \oplus C\)?
(Hint: use two XOR gates in cascade; an alternative using only NANDs requires more gates.)
Gate‑delay analysis
The circuit in Figure 4 has three gate levels. If each gate has a propagation delay of 10 ns, what is the worst‑case delay from any input to the output F?
10. Common Pitfalls
NAND vs NOR – NAND is the negation of AND; NOR is the negation of OR. Do not confuse the two.
XOR meaning – XOR is true only when the inputs differ. It is not “OR but not AND”.
Signal flow – always draw inputs on the left and let the signal move to the right; this avoids wiring ambiguities.
Parentheses – when converting a circuit to an expression, use parentheses to preserve the intended order of operations.
Gate‑delay oversight – a circuit with many cascaded gates will be slower; aim to minimise the number of levels.
11. Summary
To succeed in the Cambridge AS & A‑Level Computer Science exam you must:
Know the symbols, Boolean functions and truth tables for NOT, AND, OR, NAND, NOR and XOR.
Be able to translate freely between Boolean expressions and gate‑level diagrams.
Recognise that NAND and NOR are universal and be comfortable designing simple circuits with them only.
Apply Boolean algebra and Karnaugh‑map techniques to simplify expressions and reduce the number of gates.
Consider practical aspects such as gate delay, fan‑in and fan‑out when evaluating a design.
Mastery of these points will give you a solid foundation for both the AS and the A‑Level extensions of the 3.2 Logic Gates and Logic Circuits topic.
Support e-Consult Kenya
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.