CleverSphere

Karnaugh maps: practice problems with answers

A Karnaugh map arranges the truth table so that neighbouring cells differ in exactly one variable. Groups of ones then give you the minimal formula directly.

Rules

  • Group sizes: 1, 2, 4, 8 or 16 cells, always rectangular
  • Rows and columns run in Gray code: 00, 01, 11, 10
  • The edges are neighbours too
  • Groups as large as possible, as few as possible
  • A term keeps only the variables that stay constant in the group

Your turn

Three problems on this topic. Any equivalent formula counts.

  1. 1 · Karnaugh map
  2. 2
  3. 3

Find the minimal DNF from the Karnaugh map.

AB \ CD00011110
001000
011110
110010
100000

Minimal DNF (at most 9 literals)

Number of blocks (product terms)

Type formulas like A'B + C, ¬A ∧ B or !A & B. Any equivalent way of writing it counts. The symbol buttons insert a character.

Worked example

Find the minimal DNF from the Karnaugh map.

A \ BC00011110
00011
10111

Worked solution

  1. 1Form the largest blocks of 1, 2, 4 or 8 adjacent cells (also across the edge). Prime implicants: B · A ∧ C
  2. 2Smallest selection covering every 1: B · A ∧ C (2 blocks, 3 literals)
  3. 3Result: F = B ∨ (A ∧ C)

Typical mistake: Rows and columns run in Gray code (00, 01, 11, 10): the edges are neighbours too.

Find the minimal DNF from the Karnaugh map.

AB \ CD00011110
001110
010100
110101
101110

Worked solution

  1. 1Form the largest blocks of 1, 2, 4 or 8 adjacent cells (also across the edge). Prime implicants: ¬B ∧ ¬C · ¬B ∧ D · ¬C ∧ D · A ∧ B ∧ C ∧ ¬D
  2. 2Smallest selection covering every 1: ¬B ∧ ¬C · ¬B ∧ D · ¬C ∧ D · A ∧ B ∧ C ∧ ¬D (4 blocks, 10 literals)
  3. 3Result: F = (¬B ∧ ¬C) ∨ (¬B ∧ D) ∨ (¬C ∧ D) ∨ (A ∧ B ∧ C ∧ ¬D)

Typical mistake: Rows and columns run in Gray code (00, 01, 11, 10): the edges are neighbours too.

Common questions

May groups overlap?

Yes. A one can be in several groups if that makes the group larger.

Is there always just one minimal solution?

No, sometimes several are equally good. The trainer accepts any of them.

Related

More topics