3.1.12 · D2Boolean Algebra & Logic Gates

Visual walkthrough — Don't-care conditions in K-maps

2,002 words9 min readBack to topic

Step 0 — What is even on the grid? (building the picture from zero)

A K-map (Karnaugh map, see Karnaugh Maps (K-maps)) is just a re-drawn truth table where the 16 input combinations become 16 boxes on a grid. Rows are labelled by the pair , columns by the pair . The magic ordering is Gray order — chosen so that neighbouring boxes differ in exactly one bit. That single-bit-neighbour property is the whole reason grouping works, and we'll lean on it hard.

Figure — Don't-care conditions in K-maps

Look at the picture: the mint boxes are the real s, the lavender boxes are the wildcards, the pale boxes are the locked s. Nothing is grouped yet. Our job: cover every mint box with as few, as large, groups as possible — borrowing lavender boxes only when it helps.


Step 1 — Read the axis labels: which boxes mean ?

Figure — Don't-care conditions in K-maps

The red band in the figure is the whole half. Notice what lives there: two real s (digits ) and six boxes (digits ). That mix is the opportunity.


Step 2 — Grow the biggest group: absorb six don't-cares to get

Figure — Don't-care conditions in K-maps

WHY it's legal (and free): the six lavender boxes were . Calling them costs nothing, and it let a group of two real s balloon into a group of eight → one literal instead of several. This is exactly the parent's Rule 1: absorb an only when it enlarges a group that already covers a real . It does — so we do.


Step 3 — The remaining s: digits in the row

Figure — Don't-care conditions in K-maps

The figure highlights digits (mint, still exposed) and points at the three lavender helpers directly below (and ), which we're about to borrow.


Step 4 — First helper group: gives

Figure — Don't-care conditions in K-maps

WHY: and are both pinned on () throughout the group, while and each swing through both values and cancel. So this group of four costs just two literals, , and it covers real s at .


Step 5 — Second helper group: gives

Figure — Don't-care conditions in K-maps

WHY this second group and not just one? Digit () is not inside the previous group — it has . So still needs covering. The group mops it up, sharing the already-covered (overlap between groups is allowed and free), and it collapses to . Notice we again borrowed s () purely to reach size-four → two literals instead of a clutter of size-two terms.


Step 6 — Assemble and read off the answer

Figure — Don't-care conditions in K-maps

Step 7 — The degenerate check: what if we had refused the don't-cares?

Figure — Don't-care conditions in K-maps

The figure contrasts the two outcomes side by side: left = don't-cares refused (many small groups, tangled expression), right = don't-cares embraced (, three clean groups). Fewer terms means fewer gates — the payoff spelled out in Logic Gates & Hardware Cost.


The one-picture summary

Figure — Don't-care conditions in K-maps

One frame, three coloured groups laid over the finished map — red swallowing the whole bottom half, coral down the -column pair, butter down the -column pair — with the equation printed beside it. That is the entire derivation compressed to a glance.

Recall Feynman retelling — the whole walkthrough in plain words

We wanted a circuit that lights up when a decimal digit is or more. We drew 16 boxes, one per 4-bit pattern, arranged so neighbours differ by one bit. The digits we care about () got a "yes" (1); digits can never show up in decimal, so we wrote — a wildcard we may read as or , whichever is convenient. First we noticed the whole bottom half of the grid means "". It held two real yeses () plus six wildcards — so we called all six wildcards "yes", drew one giant group of eight, and everything except cancelled: that whole region is just . Then the leftover yeses () each got a small group, again borrowing nearby wildcards to reach size four: one gave , the other gave . Add the three: . If we'd chickened out and called every wildcard , the expression would've been longer and the circuit more expensive. The one rule that kept us honest: a wildcard may join a gang of yeses to make it bigger, but you never build a gang of only wildcards.


Connections

  • Karnaugh Maps (K-maps) — the grid and Gray ordering we read positions from.
  • Sum of Products (SOP) and Product of Sums (POS) — why each group becomes one OR-ed product term.
  • BCD - Binary Coded Decimal — source of the don't-cares.
  • Boolean Simplification — the adjacency cancellation that drops variables.
  • Quine-McCluskey Method — the algorithmic version of this same grouping.
  • Logic Gates & Hardware Cost — why fewer terms = cheaper hardware.
Recall Quick self-test

Why did the eight-box group collapse to just ? ::: is the only variable constant across all eight boxes; each take both values and cancel. Which don't-cares did we use, and why? ::: ; borrowing them let groups reach size four/eight, dropping variables. Why not a lone group around ? ::: It would contain no real — an all- group is wasted hardware. Final expression? ::: .