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

  1. Cells m0 (AB=00, CD=00), m2 (AB=00, CD=10), m8 (AB=10, CD=00), m10 (AB=10, CD=10) are all 1.
  2. Their AB rows are {00,10}\{00, 10\} (Gray labels), which is row 0 and row 3 — adjacent through edge wrap.
  3. Their CD cols are {00,10}\{00, 10\} (cols 0 and 3) — also adjacent through edge wrap.
  4. In every cell B=0B = 0 and D=0D = 0; AA and CC each take both values across the group, so they drop out.
  5. Group 1: BDB' \cdot D'.

Step 2: the central 2×2 group

  1. Cells m5 (AB=01, CD=01), m7 (AB=01, CD=11), m13 (AB=11, CD=01), m15 (AB=11, CD=11).
  2. In every cell B=1B = 1 and D=1D = 1; AA and CC drop out as before.
  3. Group 2: BDB \cdot D.

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.