Construct a truth table
3.2 Logic Gates and Logic Circuits – Constructing a Truth Table
What is a Truth Table?
A truth table lists every possible combination of input values for a logic circuit and shows the resulting output. Think of it like a recipe card: for each set of ingredients (inputs) you get a specific dish (output).
Common Logic Gates
- AND (∧) – outputs 1 only if all inputs are 1.
- OR (∨) – outputs 1 if at least one input is 1.
- NOT (¬) – flips the input: 0 becomes 1, 1 becomes 0.
- XOR (⊕) – outputs 1 if an odd number of inputs are 1.
- NAND, NOR, XNOR – combinations of the above.
Step‑by‑Step: Building a Truth Table
- Identify the number of inputs, n. There will be 2ⁿ rows.
- List all binary combinations from 00…0 to 11…1.
- For each row, calculate the output using the gate’s Boolean expression.
- Write the result in the final column.
Example: AND Gate with Two Inputs
| A | B | A ∧ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Practice: Build a Truth Table for a 3‑Input XOR
Use the steps above. Remember, XOR outputs 1 when an odd number of inputs are 1.
- Number of rows: 2³ = 8.
- Write all 8 combinations of A, B, C.
- Compute A ⊕ B ⊕ C for each row.
- Fill in the table.
Quick Check: Boolean Expression from a Table
If you have a truth table and want to write the Boolean expression, look for rows where the output is 1. For each such row, write a product (AND) of the inputs (use ¬ for 0). Then OR these products together.
Why Truth Tables Matter
Truth tables let you verify that a circuit does what you expect, debug errors, and design new circuits. They’re the “cheat sheet” for logic designers.
Your Turn! 🎓
- Create a truth table for a 2‑input NAND gate.
- Convert the following table into a Boolean expression.
- Explain in one sentence why a NOT gate is called an inverter.
Summary
You now know how to list every input combination, compute outputs using gate rules, and write the results in a tidy table. Mastering truth tables gives you a solid foundation for all of digital logic.
Revision
Log in to practice.