Lite / Building Machines That Respond / Week 15
Module check: simplifying logic
A 'majority vote' circuit can be written with 12 letters, or with 6. Both give identical answers. Why would an engineer care which one you build?
Why should I care?
Fewer gates mean a cheaper, faster, lower-power circuit and fewer places for faults. Simplification is also a check on your thinking: if the simplest form surprises you, maybe the rule was not what you meant.
- Apply Boolean laws, including complement, absorption and De Morgan's laws, to simplify an expression.
- Group 1s on a three-input Karnaugh map to find a minimal sum of products.
- Verify a simplification by comparing truth tables.
Predict
Simplify Y = A · B + A · ¬B.
- A
- B
- A · B
- It cannot be simplified
Guess first, then reveal
Y = A · (B + ¬B) = A · 1 = A. Whatever B is, the output just follows A. The two terms were really one idea written twice.
Discover
Load the majority preset and compare the row-by-row form with the simplest form. Toggle cells to make Y = A: how many literals does it need? Load 'XOR of three' and explain why nothing groups. Finally make up a function with four 1s that simplifies to a single two-letter term.
What the interactive shows (text version)
The K-map shows eight cells in two rows (A = 0, 1) and four columns (BC = 00, 01, 11, 10). Pressing a cell toggles its output. The tool lists the groups and the simplest expression: majority (rows 3, 5, 6, 7) simplifies to A·B + A·C + B·C; rows 4 to 7 simplify to A; three-input XOR (rows 1, 2, 4, 7) does not simplify.
Understand
Useful laws
Identity: A·1 = A, A + 0 = A. Null: A·0 = 0, A + 1 = 1. Complement: A·¬A = 0, A + ¬A = 1. Idempotent: A + A = A. Absorption: A + A·B = A. De Morgan: ¬(A·B) = ¬A + ¬B; ¬(A + B) = ¬A · ¬B. Each can be proved with a four-row truth table.
The Karnaugh map
A K-map is a truth table folded into a grid whose columns go 00, 01, 11, 10 (Gray code), so neighbouring cells differ in exactly one input. A group of two neighbouring 1s drops that input; a group of four drops two inputs. Cover every 1 with as few, as large groups as possible.
Always verify
A simplification is correct only if its truth table matches the original on every row. The explorer and the K-map both do this check for you; on paper, compare the two output columns.
Explain it another way
Intuitive
Simplifying logic is like tidying instructions: 'If it's raining take an umbrella; if it's not raining take an umbrella' becomes 'take an umbrella'.
Technical
Two-level minimisation finds a minimal sum-of-products cover of the function's minterms by prime implicants. K-maps do this visually for up to four or five variables; tools use algorithms such as Quine–McCluskey or heuristics for larger functions.
Mathematical
Literal count is a proxy for gate inputs. Majority: 4 three-literal minterms (12 literals) become 3 two-literal terms (6 literals). Three-input XOR has four 1s with no two adjacent on the map, so its minimal sum of products stays at 12 literals.
Applied
Chip design tools simplify logic automatically, but engineers still simplify by hand to understand a design, to spot mistakes in a specification and to build small interlocks with the fewest parts.
Derivation: Two simplifications, step by step
Distributive law (factor out A): A·B + A·¬B = A·(B + ¬B).
Complement law: B + ¬B = 1, because exactly one of them is 1. So the expression is A·1 = A.
De Morgan's law: ¬(A · B) = ¬A + ¬B and ¬(A + B) = ¬A · ¬B. Check by truth table: ¬(A·B) is 1,1,1,0 for AB = 00, 01, 10, 11, and so is ¬A + ¬B.
Majority: the row-by-row form is ¬A·B·C + A·¬B·C + A·B·¬C + A·B·C. Copy A·B·C three times (X + X = X), pair it with each other term and use the complement law: (¬A + A)·B·C + A·(¬B + B)·C + A·B·(¬C + C) = B·C + A·C + A·B, 6 literals instead of 12.
Worked example 1
Simplify A + A · B and check with a truth table.
Absorption: A + A·B = A·(1 + B) = A·1 = A. Truth table for AB = 00, 01, 10, 11: A + A·B = 0, 0, 1, 1, which is exactly A.
Common mix-ups
Every expression can be simplified.
✓ Some, like three-input XOR, are already minimal as a sum of products.K-map columns go 00, 01, 10, 11.
✓ They go 00, 01, 11, 10 so that neighbours differ in one input; otherwise groups do not simplify correctly.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
Write the row-by-row (sum of minterms) expression for your greenhouse vent rule from the previous lesson, simplify it with the K-map, then prove the two forms match by comparing truth tables in the expression explorer.
Reflect
Which law surprised you most, and how would you convince a friend it is true?
Write your answer on paper or in your own notes. Lite never stores what you write.