Skip to content
BetterDL

4-variable K-map

Also called: four-variable K-map, 4-variable Karnaugh map, 4-variable map, 4x4 K-map

A 16-cell Karnaugh map for a function of A, B, C and D. Rows are AB and columns are CD, both in Gray order, and the map wraps on all four edges.

A 4-variable K-map has 2⁴ = 16 cells in a 4×4 grid. Rows are AB and columns are CD, both in gray code order:

  • AB = 00: m0 m1 m3 m2
  • AB = 01: m4 m5 m7 m6
  • AB = 11: m12 m13 m15 m14
  • AB = 10: m8 m9 m11 m10

Compared with counting order, the last two rows and the last two columns are swapped. To place a minterm, write it as 4 bits: the first two pick the row and the last two pick the column. m10 = 1010 is in the bottom row (AB = 10) and the last column (CD = 10).

The map wraps both ways: left touches right, and top touches bottom. So every cell has exactly four neighbors, one for each variable you could flip.

Group sizes and term lengths:

  • 1 cell → 4 literals
  • 2 cells → 3 literals
  • 4 cells → 2 literals
  • 8 cells → 1 literal
  • 16 cells → the constant 1

This is the largest map most courses ask you to solve by hand, and it holds every trick: wraps, the four-corner group, overlaps and don't-cares.

AB\CD00011110
00
0m0
0m1
0m3
1m2
01
0m4
1m5
0m7
1m6
11
0m12
1m13
0m15
1m14
10
0m8
0m9
0m11
1m10

Worked examples

Example

F = Σm(2, 5, 6, 10, 13, 14)

Simplify the function in the map above.

  1. 1.

    Column CD = 10 is full: m2, m6, m14, m10. C = 1 and D = 0 in all four → .

  2. 2.

    m5 (row 01, column 01) has only one neighboring 1, m13, directly below. Pair → B = 1, C = 0, D = 1 → .

  3. 3.

    F = .

Example

Locating cells

Where are m12 and m5?

  1. 1.

    m12 = 1100: row AB = 11 (the third row), column CD = 00 (the first column).

  2. 2.

    m5 = 0101: row AB = 01 (the second row), column CD = 01 (the second column).

Common mistakes

  • Ordering the rows 00, 01, 10, 11. The third row is AB = 11 and the bottom row is AB = 10.

  • Forgetting the top-bottom wrap, so pairs like m1 and m9 go unnoticed.

  • Thinking a cell has more than four neighbors. Diagonal cells never count.

Practice 4-variable K-map

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

4-variable K-map is taught in Karnaugh Maps.