Here's the complete process end to end, using a real function throughout rather than switching examples partway: a 3-input majority function, which outputs 1 whenever two or more of its three inputs are 1. It's a genuinely useful building block in real circuits — voting logic, error-correction hardware, redundant sensor systems — not just a teaching example.
Step 1: Build the truth table
| A | B | C | F |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Four rows output 1: whenever at least two of the three inputs are 1. That's minterms 3, 5, 6, and 7.
Step 2: Plot it on a K-map
Placed on a 3-variable map (2 rows for A, 4 Gray-code columns for BC), those four minterms form a specific pattern: three of them are pairwise adjacent to each other in three different ways, with no isolated cells.
Step 3: Find every valid group
Minterms 3 (011) and 7 (111) differ only in A — a valid pair, reducing to BC. Minterms 5 (101) and 7 (111) differ only in B — a valid pair, reducing to AC. Minterms 6 (110) and 7 (111) differ only in C — a valid pair, reducing to AB. Minterm 7 belongs to all three pairs at once, which is normal — groups are allowed to overlap.
Step 4: Check for essential prime implicants
Minterm 3 only appears in the BC pair, so BC is essential. Minterm 5 only appears in the AC pair, so AC is essential. Minterm 6 only appears in the AB pair, so AB is essential. All three groups turn out to be essential, and together they already cover every required minterm — including minterm 7, which every one of them covers anyway.
Step 5: Write the minimal expression
Three terms, two literals each — the minimal sum-of-products form for a 3-input majority function, and a good illustration that "minimal" doesn't always mean "few terms." Here, three overlapping 2-literal terms genuinely is the smallest correct expression; there's no single-term or two-term expression that produces the same truth table.