Create and complete truth tables from logic expressions or circuits
Boolean Logic & Truth Tables 📊
Boolean logic is the backbone of digital circuits and computer programs. It uses only two values: True (1) and False (0). In this lesson we’ll learn how to write logic expressions, create truth tables, and translate circuits into tables.
What is Boolean Logic?
Think of Boolean logic like a recipe that only uses two ingredients: True and False. The “cooking” rules are the logical operators:
- AND ($\land$): both ingredients must be True.
- OR ($\lor$): at least one ingredient is True.
- NOT ($\lnot$): flips the truth value.
Basic Boolean Operations
Let’s see how each operator works with a simple truth table.
| A | B | A ∧ B | A ∨ B | ¬A |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Creating Truth Tables from Expressions
Follow these steps to build a truth table for any Boolean expression:
- List all input variables (e.g.,
A,B,C). - Determine the number of rows: 2n where n is the number of variables.
- Fill in all possible combinations of 0 and 1.
- Evaluate the expression for each row and write the result.
Example: For the expression (A ∧ B) ∨ ¬C, the truth table would look like this:
| A | B | C | (A ∧ B) ∨ ¬C |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
From Circuits to Truth Tables
Logic gates are the physical representation of Boolean operators:
- AND gate – output is 1 only if all inputs are 1.
- OR gate – output is 1 if at least one input is 1.
- NOT gate – flips the input.
To convert a circuit into a truth table, simply:
- Identify all input wires.
- Write the gate logic for each intermediate node.
- Use the same truth‑table method as above.
Example: A 3‑input NAND gate (¬(A ∧ B ∧ C)) has the following table:
| A | B | C | NAND |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
Practice Problems 🚀
Fill in the missing columns for each expression. Use the same colour scheme as the examples.
- Expression:
A ∨ (B ∧ C) - Expression:
¬(A ∨ B) ∧ C - Expression:
(A ∧ ¬B) ∨ (¬A ∧ B)(XOR)
Exam Tips 📌
Know the symbols: ∧ for AND, ∨ for OR, ¬ for NOT.
Always write all input combinations: 2n rows for n variables.
Log in to practice.Revision