K-maps — worked example
Digital Logic 101 · Karnaugh Maps · Example
Minimise F(A,B,C,D) = Σm(0, 2, 5, 7, 8, 10, 13, 15)
Eight 1-cells on a 16-cell map. Plot them and look for the largest rectangles of 1s, remembering that 1, 2, 4, 8, and 16 are the allowed group sizes per axis dimension.
AB\CD 00 01 11 10
00 1 0 0 1 ← rows AB=00, CD ∈ {00,10}
01 0 1 1 0 ← rows AB=01, CD ∈ {01,11}
11 0 1 1 0 ← rows AB=11, CD ∈ {01,11}
10 1 0 0 1 ← rows AB=10, CD ∈ {00,10}Two natural groups jump out: the four corners (a 4-cell group) and the central 2×2 block. Each is the largest rectangle that covers its 1-cells exactly.
Step 1: the corner group
- Cells m0 (AB=00, CD=00), m2 (AB=00, CD=10), m8 (AB=10, CD=00), m10 (AB=10, CD=10) are all 1.
- Their AB rows are (Gray labels), which is row 0 and row 3 — adjacent through edge wrap.
- Their CD cols are (cols 0 and 3) — also adjacent through edge wrap.
- In every cell and ; and each take both values across the group, so they drop out.
- Group 1: .
Step 2: the central 2×2 group
- Cells m5 (AB=01, CD=01), m7 (AB=01, CD=11), m13 (AB=11, CD=01), m15 (AB=11, CD=11).
- In every cell and ; and drop out as before.
- Group 2: .
Combine
Every 1-cell sits in one of the two groups, so the minimum SOP is:
F = B'·D' + B·D (= XNOR of B and D)From eight 4-literal minterms down to a 2-product, 2-literal-each sum-of-products. Verify it on the Simulate page by clicking the same eight cells.