Worked examples — Truth tables construction
Before anything, we only ever use two symbols for a signal:
The scenario matrix
Every truth-table problem you can be asked is one (or a blend) of these cells. Each worked example below is tagged with the cell(s) it covers.
| # | Case class | What makes it tricky | Covered by |
|---|---|---|---|
| C1 | 2 inputs, single gate | the baseline, all-0s & all-1s corners | Ex 1 |
| C2 | NOT inside an OR/AND | evaluate the inside first (intermediate column) | Ex 2 |
| C3 | 3 inputs, mixed AND+OR | precedence NOT→AND→OR, 8 rows | Ex 3 |
| C4 | Degenerate input (a variable that cancels out) | column that turns out irrelevant | Ex 4 |
| C5 | Constant / limiting output (always 0 or always 1) | tautology & contradiction | Ex 5 |
| C6 | Equivalence proof (two different-looking expressions, same table) | compare column-by-column | Ex 6 |
| C7 | Real-world word problem | translate English → Boolean → table | Ex 7 |
| C8 | Exam twist: precedence trap vs | the classic wrong reading | Ex 8 |
Ex 1 — C1: baseline, 2 inputs, single OR gate
Steps:
- Count inputs → rows. Two inputs, so rows. Why this step? Fix the size before filling, so you can't skip or duplicate a row.
- Lay the input columns by binary count : right column ; left column . Why this step? Binary counting is a checksum that all combos appear exactly once.
- Apply OR to each row. unless both are . Why this step? OR only fails (gives 0) at the single all-0 corner.
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Verify: Exactly one row is (the all-0s corner), three are . That matches "at least one 1". Row count . ✓
Ex 2 — C2: NOT living inside a bigger expression
Steps:
- Rows: . Binary columns as before.
- Make an intermediate column . Flip every value. Why this step? We solve the small inside piece first, so the outer AND becomes trivial ([divide-and-conquer](Boolean Algebra Laws)).
- AND with . Both must be . Why this step? AND lights up only where both intermediate values are .
| 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 |
Verify: Exactly one row is — the row , matching "A false and B true". ✓
Ex 3 — C3: three inputs, mixed AND + OR (precedence)
Steps:
- Rows: . Right column toggles every row; every 2; every 4. Why this step? Guarantees all 8 combinations, no gaps.
- Intermediate column . only in the two rows where . Why this step? AND binds tighter than OR, so it must be computed first — build it as its own column so you never mis-order.
- OR that with . if either or .
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Verify: Rows with (four of them) are all . The extra row is also . Total = 5 ones. ✓ Read the -rows off directly and you have the SOP form.
Ex 4 — C4: a degenerate input (does the variable matter?)
Steps:
- Rows: .
- Intermediates: , then , then . Why this step? Three small pieces beat one error-prone mental leap.
- OR the two product terms.
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 0 | 1 |
Verify: The column equals the column exactly — never changes the answer. So . This is the law (see Boolean Algebra Laws). is a degenerate input here. ✓
Ex 5 — C5: limiting outputs — always 1, and always 0
Steps:
- Rows: each has input → rows. (The smallest non-trivial table.)
- Intermediate , then combine. Why this step? These two are the boundary cases every table lives between.
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
Verify:
- is in every row → a tautology (always true). Output column has zero 0s.
- is in every row → a contradiction (always false). Output column has zero 1s. These are the two limiting shapes of any output column. ✓
Ex 6 — C6: equivalence proof (De Morgan)
Steps:
- One shared input block, rows, so we compare fairly.
- Build : intermediate , then bar it.
- Build : intermediates , then OR. Why this step? Two expressions are logically equal iff their output columns are identical row-by-row.
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Verify: and columns are identical (). Therefore — this is De Morgan's Law, proved by table. ✓ (Boolean Algebra Laws)
Ex 7 — C7: real-world word problem
Steps:
- Translate English → Boolean. "Engine on" . "Unbuckled" . "And" . So . Why this step? Word problems are just Boolean expressions in disguise — nail the translation first.
- Rows: two inputs → .
- Intermediate , then AND with .
| Meaning | ||||
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | engine off → silent |
| 0 | 1 | 0 | 0 | engine off → silent |
| 1 | 0 | 1 | 1 | on & unbuckled → BUZZ |
| 1 | 1 | 0 | 0 | on & buckled → silent |
Verify: The buzzer fires in exactly one row — engine on (), unbuckled () — which is precisely the real safety rule. Units check: output is a bit (buzz/silent), inputs are bits. ✓
Ex 8 — C8: exam twist — the precedence trap
Steps:
- Rows: three inputs → .
- Correct column : intermediate , then OR with .
- Wrong column : intermediate , then AND with . Why this step? Putting both side by side exposes exactly which rows the trap corrupts.
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Verify: Compare columns and . They differ in rows : rows and — 2 rows disagree. has 5 ones, has 3 ones. The correct answer is . ✓
Coverage check — did we hit every cell?
Every cell in the matrix has a fully worked, verified example. ✓
Active recall
Recall Test yourself
- In Ex 4, why did vanish from the answer? ::: Because , so ; the variable cancels.
- What is the output column of a tautology like ? ::: All s (zero zeros).
- How do you prove two expressions are equivalent? ::: Build both tables; they must match row-by-row.
- Correct reading of ? ::: — AND binds tighter than OR.
- In how many rows do and disagree? ::: 2 rows (both with ).
Connections
- Logic Gates AND OR NOT — the atomic tables every example combines.
- Boolean Algebra Laws — Ex 4 and Ex 6 are laws proved by table.
- Sum of Products (SOP) — read the -rows of Ex 3 straight off.
- Karnaugh Maps — the same 8 rows redrawn as a grid.
- Binary Number System — the counting that orders every table.
- Combinational Logic Circuits — the hardware Ex 7 describes.