3.1.12 · D3Boolean Algebra & Logic Gates

Worked examples — Don't-care conditions in K-maps

3,390 words15 min readBack to topic

This page is the drill hall for the parent topic. Before we simplify anything, let us agree on the vocabulary from line one so nobody is lost.


The scenario matrix

Every don't-care problem you will ever meet falls into one of these cells. Each row is a distinct decision situation; the rightmost column names the example that covers it.

# Case class What is special about it Covered by
C1 Use the — it enlarges a group Absorbing drops a variable Example 1
C2 Ignore the — using it would cost a term The tempting leads to waste Example 2
C3 All- region (degenerate) A whole block is don't-care Example 3
C4 Zero real 1s (empty output) Only 's and 's — limiting case Example 4
C5 Real-world word problem (BCD ≥ threshold) Translate words → minterms → map Example 5
C6 POS side (group the 's, helps there too) Don't-cares work for zeros as well Example 6
C7 Exam twist: used differently in SOP vs POS Same map, two answers, both valid Example 7
C8 Full-1 + (whole map is 1/X) Output collapses to constant Example 8

Example 1 — C1: the that earns its keep

Forecast: Before reading on — guess: does the at cell 5 help, and to what single expression does this collapse?

The map (rows , columns in Gray order ):

A\BC 00 01 11 10
0 0 1(1) 1(3) 0
1 0 X(5) 1(7) 0

The figure below shows this same map with the winning group already drawn — look at the teal rounded box (the size-4 group) and the plum arrow (the being pulled in to complete it) as you read the steps.

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

Step 1 — Circle the real 1s and note the wildcard. Cells are locked-1. Cell is . Why this step? You must know what is forced before deciding what is optional. The 1s MUST be covered; the is a bonus.

Step 2 — Notice all four ones-and-wildcard lie in the region. In this map, columns and are exactly the cells where . Those are cells — the two middle columns boxed in teal in the figure. Why this step? A group must be a rectangle of size a power of two (). is a legal size-4 block. Size-4 in a 3-variable map means two variables vanish, leaving one literal.

Step 3 — Set the at 5 to and draw the size-4 group. Why this step? Setting (the plum arrow in the figure) completes the block. A size-4 block where the only constant coordinate is simplifies to (both and take every value inside, so they cancel).

Step 4 — Compare against forcing . Why this step? To prove the actually saved hardware. Forced : largest all-1 groups are and , so — two AND-terms, three literals.

Verify: Enumerate. at minterms . Required 1s ✅, and cell 5 being 1 is legal (it was ). correctly outputs 0 for all cells. Literal count dropped from 3 to 1. ✔


Example 2 — C2: the tempting you must refuse

Forecast: Guess: should you grab the lonely at 10, or leave it?

Step 1 — Map the real 1s. Minterms all have (top-left block). That is a clean size-4 group . Why this step? The four required 1s already form a perfect power-of-two block by themselves — no wildcard needed.

Step 2 — Look at the at 10. Minterm , i.e. . It sits far from the block, with no adjacent 1. Why this step? To use an it must share an edge with a group that already covers a real 1. Cell 10 has no such neighbour among the 1s.

Step 3 — Refuse the ; treat it as . Why this step? Any group containing cell 10 would either be a group of only (a fake gang → forbidden by Rule 2) or would drag the block out of shape and split it. Absorbing it earns nothing and costs a term.

Verify: exactly at minterms ✅ and at minterm 10 (allowed, it was ). One term, two literals — the minimum. Grabbing 10 would have forced a second product term for zero benefit. ✔


Example 3 — C3: an entire don't-care region

Forecast: Guess: with a huge don't-care region, does collapse to a single literal?

The figure shows the full 4-variable map: the four real 1s boxed in teal (), and the sprawling plum-arrowed don't-care region deliberately left outside every box — trace how the teal box hugs only the 1s.

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

Step 1 — Locate the real 1s. . Every one of them has and — the four cells inside the teal box in the figure. Why this step? Spotting a shared pattern tells us the target term before we even group.

Step 2 — Ask which 's let a group grow. Cells with are minterms (already all our 1s). No larger legal rectangle exists that keeps only real 1s + helpful 's without picking up a forced 0. The don't-cares include and which have — grabbing those would break the pattern. Why this step? You only absorb an if it keeps a valid power-of-two shape AND enlarges the group. Here the 1s already form a perfect size-4 block, so no can help — that is why the plum region stays unboxed.

Step 3 — Take the size-4 block ; leave the whole don't-care region uncovered. Why this step? Rule 2: never build a group of only 's. The don't-care region, though big, is not covered because doing so adds terms covering inputs we don't care about.

Verify: at minterms ✅, and everywhere else — including all the don't-cares, which is perfectly legal. One term, two literals. ✔


Example 4 — C4: zero real ones (limiting case)

Forecast: Guess the simplest when there is not a single required 1.

Step 1 — Count the forced 1s. There are none. Why this step? The whole grouping game exists to cover 1s. If there are no 1s, there is nothing you are obliged to cover.

Step 2 — Apply Rule 2 to every . Any group here would contain only 's (a fake gang). Forbidden. Why this step? Covering an is always optional; with no 1s to justify a term, every possible group is pure waste.

Step 3 — Assign all 's to and conclude. Why this step? The cheapest circuit is no circuit. With everything set to 0, is the constant 0.

Verify: satisfies every required output (there are none to violate) and legally sets each to 0. Hardware cost: a wire tied to ground — the absolute minimum. ✔


Example 5 — C5: real-world BCD threshold

Forecast: Guess how many product terms the final has.

Step 1 — Words → minterms. Digits and : that is , all set to 1. Digits never occur → at minterms . Digits → 0. Why this step? You cannot map before you translate the specification into which cells are , , and .

AB\CD 00 01 11 10
00 0 0 0 0
01 0 1(5) 1(7) 1(6)
11 X(12) X(13) X(15) X(14)
10 1(8) 1(9) X(11) X(10)

Step 2 — Big group using . Minterms (real 1s) plus the entire bottom-two-rows don't-care region give all cells with : , a size-8 block. Why this step? Size-8 in a 4-variable map kills three variables → a single literal. Setting the six 's there to 1 is legal and free.

Step 3 — Two size-4 groups for using 's , and read off the terms. share . share . Combined with :

Why this step? Cells alone form an L-shape (not a legal rectangle), so they cannot become one term. Each size-4 rectangle collapses to the product of exactly the variables that stay constant across all four of its cells: in only and never change (both ), giving ; in only and stay constant, giving . Summing the three groups (one term per rectangle) yields .

Verify: Digit : ✅ (). Digit : ✅ (). Digit : ✅. Every valid digit is machine-checked below. ✔


Example 6 — C6: don't-cares on the POS (zero-grouping) side

Forecast: Guess: on the zeros' side, does the help too, and what is the POS?

Step 1 — Identify the 0-cells. at minterms (the cells). Cell 5 is still . Why this step? For POS we group the 0s; each 0-group gives a sum (OR) factor. Same rules apply — an may join a 0-group if it enlarges it.

Step 2 — Group all cells. are exactly the cells — a size-4 block. Do we even need the ? Cell 5 has , so it is not a natural member of the block; we leave it out (set to 1, as in Ex.1). Why this step? The zeros already form a clean size-4 block on their own. A 0-group where the constant coordinate is contributes the factor .

Step 3 — Write the POS. A size-4 group of 0s with means " is 0 whenever ", i.e. the factor is . Why this step? In POS, each 0-group becomes an OR-factor made of the variables that stay constant across it, written in the form that is 0 on that group; here only is constant (), so the single factor is .

Verify: Here SOP and POS coincide because the function is just . exactly at cells ✅. Consistent with Example 1. ✔


Example 7 — C7: exam twist — the pulled two different ways

Forecast: Guess: does the SOP set while the POS sets ?

The figure shows the tiny map. The teal box is the SOP group (row , using the ); the plum arrow flags the tempting-but-illegal POS pairing you must not draw.

Figure — Don't-care conditions in K-maps
A\B 0 1
0 1(0) X(1)
1 0(2) 1(3)

Step 1 — Minimal SOP (group the 1s, use the ). Real 1s: , (a diagonal — not adjacent, no group of both). But (row ) is a size-2 block if we set at 1 to 1, giving . Cell 3 alone gives . Why this step? Setting lets minterm 0 pair up into instead of standing alone as .

Step 2 — Absorb to the tightest SOP. (absorption law). Why this step? still has a redundant ; the absorption identity removes a literal, giving the minimal SOP.

Step 3 — Minimal POS (group the 0s) — watch the trap.

So the only legal 0-group is the lone cell by itself. Why this step? A POS factor comes from a rectangle of 0s; the single 0 at gives the OR-factor (the sum that is 0 exactly there).

Step 4 — Compare the two sides. The helped the SOP (set to 1 to build ) but was legally unusable in the POS. The lesson: an that helps SOP may do nothing for POS — always re-evaluate per side, never copy the assignment across. Why this step? This is the exact exam trap: students copy the SOP's "" onto the POS side and mis-group. Deciding afresh per side is the safeguard.

Verify: : at ✅, ✅, ✅, (the ) (legal). is the same expression ✅. Both sides agree on . ✔


Example 8 — C8: whole map is 1's and 's

Forecast: Guess when six cells are 1 and the other two are .

Step 1 — Set both 's to 1. Cells are ; making them 1 fills the entire map. Why this step? When every non- cell is already 1, filling the 's to 1 lets one giant group swallow the whole map — bigger group, fewer literals.

Step 2 — One size-8 group over all 8 cells, and read the result. A group covering the entire 3-variable map means every variable takes both values → all variables cancel, leaving no literals at all. Why this step? A product term is the AND of the variables that stay constant across its group. In a size-8 group covering the whole map, no variable stays constant, so nothing survives — the term degenerates to the constant .

Verify: outputs 1 at all six required minterms ✅ and sets the two 's to 1 (legal). Hardware: a wire tied high — the minimum. If instead we had forced , the largest group would be giving (two terms) — worse. ✔


Recall Which case did each example teach?

Ex1 :::: C1 — use the to drop a variable (). Ex2 :::: C2 — refuse the lonely (). Ex3 :::: C3 — ignore a whole don't-care region (). Ex4 :::: C4 — no real 1s → . Ex5 :::: C5 — BCD "≥5" word problem (). Ex6 :::: C6 — group the 0s for POS (). Ex7 :::: C7 — SOP vs POS use the differently (). Ex8 :::: C8 — full-1/X map collapses to .

Connections

  • Karnaugh Maps (K-maps) — the grid every example lives on.
  • Sum of Products (SOP) and Product of Sums (POS) — SOP groups 1s, POS groups 0s (Ex6, Ex7).
  • BCD - Binary Coded Decimal — source of the Ex5 don't-cares.
  • Boolean Simplification — absorption used in Ex7.
  • Quine-McCluskey Method — the algorithmic cousin for many variables.
  • Logic Gates & Hardware Cost — why fewer terms/literals is the whole point.