Use logic gates to create logic circuits from a problem statement, logic expression or truth table
Boolean Logic for IGCSE Computer Science 0478
What is Boolean Logic?
Boolean logic deals with two truth values: TRUE (1) and FALSE (0). Think of it as a light switch – it’s either on or off.
Common Logic Gates
- ??
AND – outputs 1 only if both inputs are 1.
A ∧ B - ??
OR – outputs 1 if any input is 1.
A ∨ B - ??
NOT – flips the value.
¬A - ??
XOR – outputs 1 if the inputs are different.
A ⊕ B - ??
NAND – NOT of AND.
¬(A ∧ B) - ??
NOR – NOT of OR.
¬(A ∨ B)
From Problem Statement to Logic Expression
🔍 Example Problem: “Create a circuit that outputs TRUE when exactly two of the three inputs A, B, C are TRUE.”
- Identify the condition: exactly two TRUEs.
- Write the Boolean expression: $$ (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C) ∨ (¬A ∧ B ∧ C) $$
- Use only AND, OR, NOT gates to build the circuit.
From Truth Table to Logic Expression
🔍 Example Truth Table:
| A | B | C | Output |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
From the table you can read the rows where Output = 1 and write the expression:
$$ (¬A ∧ B ∧ C) ∨ (A ∧ ¬B ∧ C) ∨ (A ∧ B ∧ ¬C) $$
Building the Circuit
Use the following steps:
- Group each product term (AND of literals) with an AND gate.
- Feed all AND outputs into a single OR gate.
- Use NOT gates to invert any input that needs ¬.
🛠️ Tip: Sketch the circuit on paper first – label each gate and wire to avoid confusion.
Exam Practice Question
Write a logic expression and draw the circuit for a system that outputs TRUE when at least two of the four inputs A, B, C, D are TRUE.
🔍 Hint: Think of it as “not fewer than two” – you can use combinations of AND, OR, and NOT.
Analogy: The Party Invitation
Imagine a party where you only want to invite guests if at least two friends are coming. Each friend’s RSVP is a gate:
- AND gate = “Both friends must say yes.”
- OR gate = “At least one friend says yes.”
- NOT gate = “Friend says no.”
By combining these gates you decide who gets the invitation card – just like building a logic circuit.
Key Takeaways
- Write the Boolean expression first – it’s the blueprint.
- Use only AND, OR, NOT to build any circuit.
- Practice converting between problem statements, expressions, truth tables, and circuits.
- Check your work by verifying the truth table of your final circuit.
Revision
Log in to practice.