Write logic expressions from circuits or truth tables
Boolean Logic: Writing Logic Expressions from Circuits or Truth Tables
What is Boolean Logic? 🤔
Think of Boolean logic like a set of rules for a light switch. The switch can only be in two positions: ON (1) or OFF (0). Boolean logic uses the same two values (0 and 1) to describe the behaviour of digital circuits.
The basic operations are:
- AND ($\land$) – both inputs must be 1 for the output to be 1.
- OR ($\lor$) – at least one input is 1 for the output to be 1.
- NOT ($\lnot$) – flips the value (0 becomes 1, 1 becomes 0).
From Circuits to Logic Expressions 🔌
Suppose you have a simple circuit with two inputs, A and B, and the following gates:
- A NOT gate (produces
¬A) - A AND gate that takes
¬AandBas inputs - An OR gate that combines the output of the AND gate with
A
To write the logic expression, follow these steps:
- Start with the innermost gate:
¬A ∧ B. - Take the output of that gate and OR it with the other input:
(¬A ∧ B) ∨ A.
The final expression is: $F = (\lnot A \land B) \lor A$.
From Truth Tables to Logic Expressions 📊
A truth table lists every possible combination of inputs and the resulting output. From this table we can build a Sum of Products (SOP) expression.
| A | B | C | F |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
1️⃣ Identify rows where the output F is 1.
2️⃣ For each of those rows, write a product (AND) term that matches the input values.
3️⃣ Combine all product terms with OR (∪) to get the SOP expression.
For the table above, the rows with output 1 are the 2nd, 3rd, 5th, and 8th rows. The corresponding product terms are:
¬A ∧ ¬B ∧ C¬A ∧ B ∧ ¬CA ∧ ¬B ∧ ¬CA ∧ B ∧ C
Exam Tips for Writing Logic Expressions 📝
- Always label each gate or table row clearly.
- When converting a circuit, start from the input side and work towards the output.
- For truth tables, use the Sum of Products method first; if time allows, simplify using Karnaugh maps.
- Check your final expression by plugging in a few test values.
- Remember that
¬(A ∨ B) = ¬A ∧ ¬B(De Morgan’s law) – handy for simplifying.
Practice Problems 🧩
- Given the circuit:
- A OR gate with inputs
BandC - The output of the OR gate goes into a NOT gate
- The output of the NOT gate is then ANDed with
A
- A OR gate with inputs
- From the truth table below, write the SOP expression:
X Y Z G 0 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 - Convert the following Boolean expression to a simplified form using De Morgan’s law: $\lnot(A \lor \lnot B) \land C$
Revision
Log in to practice.