Logic design

Karnaugh maps

A K-map places truth-table values in Gray-code order so adjacent cells differ by one variable. Grouping adjacent 1s removes variables and simplifies SOP logic.

Level: FoundationRead: 5 minutesRelated: Combinational logic

Grouping rules

  • Groups contain 1, 2, 4, 8, or another power-of-two number of cells.
  • Make groups as large as possible and cover every required 1.
  • Groups may overlap, and map edges wrap around.
  • Use don't-cares only when they make a useful larger group.
1010111110101111

Opposite edges are adjacent. Visual grouping should follow Gray-code row and column labels.

Worked example

F(A,B,C,D) = Σm(0,2,5,7,8,10,13,15)

The minterms form two groups of four. In the first group B = 0 and D = 0, giving B'D'. In the second group B = 1 and D = 1, giving BD.

Simplified result: F = B'D' + BD, which is B XNOR D. A and C disappear because they change within each group.

SOP and POS

Group 1s to derive sum-of-products. Group 0s to derive product-of-sums. Choose the form that matches the required implementation and gives simpler logic.

Common mistakes

  • Ordering rows or columns as binary 00, 01, 10, 11 instead of Gray code 00, 01, 11, 10.
  • Making diagonal groups or non-power-of-two groups.
  • Missing wrap-around adjacency between opposite edges.
  • Using every don't-care even when it does not simplify the expression.