Skip to content
Part IA Michaelmas Term

Don't-Care Conditions

Motivation

Sometimes certain input combinations never occur in a given application, or the designer does not care about the output value for those combinations. These are called don’t-care conditions. When simplifying a Boolean function, don’t-cares can be treated as either 0 or 1, whichever yields the simplest expression. This extra flexibility often leads to more minimal circuits.

Don’t-cares are denoted by XX on a Karnaugh map.

Example: BCD to 7-Segment Decoder

Binary Coded Decimal (BCD) represents decimal digits 0-9 using 4 bits (0000 to 1001). The six combinations 1010 through 1111 (decimal 10-15) never occur in valid BCD input. In a BCD to 7-segment decoder, the outputs for these six input combinations are don’t-cares: we do not care what the display shows because the input will never be presented.

This means we have 6 don’t-care conditions (cells m10m_{10} through m15m_{15}) on a 4-variable K-map for each output segment. By choosing to treat some don’t-cares as 1s, we can form larger groups and simplify the output expression significantly.

K-Map with Don’t-Cares

Don’t-cares are marked as XX on the K-map. The grouping strategy is:

  • Treat an XX as 1 if it helps form a larger group (leading to fewer literals).
  • Treat an XX as 0 (ignore it) if including it would not enlarge any group.

In other words: use don’t-cares opportunistically to maximise group sizes, but do not include them if they do not help.

Worked Example

Simplify f=aˉbˉd+aˉcd+acdf = \bar{a} \cdot \bar{b} \cdot d + \bar{a} \cdot c \cdot d + a \cdot c \cdot d with don’t-care conditions: aˉbˉcˉdˉ\bar{a} \cdot \bar{b} \cdot \bar{c} \cdot \bar{d}, aˉbˉcd\bar{a} \cdot \bar{b} \cdot c \cdot d, aˉbcˉd\bar{a} \cdot b \cdot \bar{c} \cdot d.

First, identify all the terms and don’t-cares as minterm indices.

ff minterms:

  • aˉbˉd\bar{a} \cdot \bar{b} \cdot d: a=0,b=0,d=1a=0, b=0, d=1aˉbˉd\bar{a}\bar{b}d covers aˉbˉcˉd\bar{a}\bar{b}\bar{c}d (m1m_1) and aˉbˉcd\bar{a}\bar{b}cd (m3m_3). m1m_1 = 0001, m3m_3 = 0011.
  • aˉcd\bar{a} \cdot c \cdot d: a=0,c=1,d=1a=0, c=1, d=1aˉcd\bar{a}cd covers aˉbˉcd\bar{a}\bar{b}cd (m3m_3) and aˉbcd\bar{a}bcd (m7m_7).
  • acda \cdot c \cdot d: a=1,c=1,d=1a=1, c=1, d=1acdacd covers abˉcda\bar{b}cd (m11m_{11}) and abcdabcd (m15m_{15}).

So ff minterms (1s): m1,m3,m7,m11,m15m_1, m_3, m_7, m_{11}, m_{15}.

Don’t-cares:

  • aˉbˉcˉdˉ\bar{a} \cdot \bar{b} \cdot \bar{c} \cdot \bar{d}: m0m_0 (0000)
  • aˉbˉcd\bar{a} \cdot \bar{b} \cdot c \cdot d: m3m_3 (0011) — note this is already a minterm of ff, so it does not add a new don’t-care
  • aˉbcˉd\bar{a} \cdot b \cdot \bar{c} \cdot d: m5m_5 (0101)

K-map (4 variables, a,b,c,da, b, c, d):

abcd0001111000X1101X1111101\begin{array}{c|cccc} ab \setminus cd & 00 & 01 & 11 & 10 \\ \hline 00 & X & 1 & 1 & \\ 01 & & X & 1 & \\ 11 & & & 1 & \\ 10 & & & 1 & \end{array}

Grouping without using don’t-cares: the 1s at m1,m3,m7,m11,m15m_1, m_3, m_7, m_{11}, m_{15} would require multiple small groups.

Grouping using don’t-cares: Column cd=11cd=11 contains 1s at all four rows (m3,m7,m11,m15m_3, m_7, m_{11}, m_{15}), forming a group of 4. Constant: c=1,d=1c=1, d=1; aa and bb vary. Term: cdc \cdot d. This covers four of the five 1s.

The remaining 1 at m1m_1 (0001) can pair with the don’t-care at m0m_0 (0000) to form a group of 2: constant a=0,b=0,c=0a=0, b=0, c=0; dd varies. Term: aˉbˉcˉ\bar{a} \cdot \bar{b} \cdot \bar{c}. Alternatively, m1m_1 could pair with the don’t-care at m5m_5 (0101) for a vertical group: constant b=0,c=0,d=1b=0, c=0, d=1; aa varies. Term: bˉcˉd\bar{b} \cdot \bar{c} \cdot d.

Both options yield valid simplified expressions with the same gate cost (1 AND-2 + 1 AND-3 + 1 OR-2):

f=cd+aˉbˉcˉf = c \cdot d + \bar{a} \cdot \bar{b} \cdot \bar{c} f=cd+bˉcˉdf = c \cdot d + \bar{b} \cdot \bar{c} \cdot d

Alternative: Use more don’t-cares for even larger group

What if we treat both m0m_0 and m5m_5 as 1s? Then m0m_0 (0000) and m1m_1 (0001) give aˉbˉcˉ\bar{a}\bar{b}\bar{c}. And m5m_5 and m7m_7 give aˉbd\bar{a}bd, which is another term. But remember, all we need is a covering set: a minimum set of prime implicants that covers ALL the 1s. The don’t-cares DON’T need to be covered; they are optional. The two solutions above both cover all 1s (the column group covers m3,m7,m11,m15m_3, m_7, m_{11}, m_{15}; the second group covers m1m_1). Done.

Another Worked Example: BCD Counter Decoder

Consider a BCD to decimal decoder with 4 inputs (a,b,c,da, b, c, d) and 10 outputs (y0y_0 through y9y_9). Input combinations 1010 to 1111 are don’t-cares. Let us design the output y9y_9, which is TRUE only when the BCD input is 9 (binary 1001).

Truth table for y9y_9:

abcdy9y_9
00000
00010
00100
00110
01000
01010
01100
01110
10000
10011
1010X
1011X
1100X
1101X
1110X
1111X

Without don’t-cares: y9=abˉcˉdy_9 = a \cdot \bar{b} \cdot \bar{c} \cdot d (a single minterm, 4 literals).

With don’t-cares: Plot on K-map.

abcd0001111000000001000011XXXX1001XX\begin{array}{c|cccc} ab \setminus cd & 00 & 01 & 11 & 10 \\ \hline 00 & 0 & 0 & 0 & 0 \\ 01 & 0 & 0 & 0 & 0 \\ 11 & X & X & X & X \\ 10 & 0 & 1 & X & X \end{array}

The 1 is at m9m_9 (1001): ab=10ab=10, cd=01cd=01. The Xs are at m10m_{10} through m15m_{15}: rows ab=10ab=10 (cols 10,11) and ab=11ab=11 (all four cols).

Without don’t-cares, y9=abˉcˉdy_9 = a \cdot \bar{b} \cdot \bar{c} \cdot d (4 literals).

With don’t-cares, m9m_9 (1001) pairs with m11m_{11} (1011, X) horizontally: constant a=1,b=0,d=1a=1, b=0, d=1; cc varies. Term: abˉda \cdot \bar{b} \cdot d (3 literals). But we can do better: m9m_9, m11m_{11}, m13m_{13} (1101, X), and m15m_{15} (1111, X) form a 2×2 rectangle (rows 10 and 11, columns 01 and 11). Constant: a=1,d=1a=1, d=1; bb and cc vary. Term: ada \cdot d (2 literals).

Check: ada \cdot d is 1 when a=1a=1 and d=1d=1. This covers m9m_9 (1001), m11m_{11} (1011), m13m_{13} (1101), and m15m_{15} (1111). The latter three are all don’t-cares, so this is valid.

y9=ady_9 = a \cdot d

This is a dramatic simplification: from 4 literals down to 2, made possible by treating the don’t-cares as 1s to form a larger group.

Important Definitions

When discussing K-map simplification with don’t-cares:

Prime Implicant: A product term that cannot be combined with any other term to eliminate a variable. On a K-map, a prime implicant corresponds to a maximal group of adjacent 1s (and optionally Xs) that cannot be enlarged while remaining rectangular. A group is not a prime implicant if it can be expanded to a larger valid group.

Essential Prime Implicant: A prime implicant that covers at least one minterm (a 1, not a don’t-care) that is NOT covered by any other prime implicant. Essential prime implicants MUST be included in the final expression.

Covering Set: A minimum set of prime implicants that includes all essential prime implicants plus any non-essential prime implicants needed to cover the remaining uncovered 1s. The covering set gives the minimal SOP expression.

K-Map Example Illustrating Definitions

Consider the K-map below for a 4-variable function. Let 1s be at: m4,m5,m6,m8,m9,m10,m13m_4, m_5, m_6, m_8, m_9, m_{10}, m_{13}. Don’t-cares: m0,m7,m15m_0, m_7, m_{15}.

abcd0001111000X0111X1111X10111\begin{array}{c|cccc} ab \setminus cd & 00 & 01 & 11 & 10 \\ \hline 00 & X & & & \\ 01 & 1 & 1 & X & 1 \\ 11 & & 1 & X & \\ 10 & 1 & 1 & & 1 \end{array}

Prime implicants:

  • PI1: Row ab=01ab=01 (all four cells: m4,m5,m7,m6m_4, m_5, m_7, m_6). m7m_7 is X, the rest are 1s. Group of 4: aˉb\bar{a} \cdot b.

  • PI2: Column cd=01cd=01, rows 01 and 11 (m5,m13m_5, m_{13}). Rows 01 and 11 are adjacent in Gray code. Constant: b=1,c=0,d=1b=1, c=0, d=1; aa varies. Term: bcˉdb \cdot \bar{c} \cdot d.

  • PI3: Row ab=10ab=10 has 1s at m8,m9,m10m_8, m_9, m_{10} but a gap at m11m_{11} (empty), so no group of 4. Two groups of 2: m8m_8 and m9m_9 (horizontal, columns 00 and 01) → abˉcˉa \cdot \bar{b} \cdot \bar{c}; m8m_8 and m10m_{10} (horizontal wrap, columns 00 and 10) → abˉdˉa \cdot \bar{b} \cdot \bar{d}.

  • PI4: m13m_{13} (1101) and m15m_{15} (1111) in row ab=11ab=11, columns 01 and 11 (adjacent in Gray code). m13m_{13} is 1, m15m_{15} is X. Horizontal group of 2: constant a=1,b=1,d=1a=1, b=1, d=1; cc varies. Term: abda \cdot b \cdot d.

Prime implicants found:

  • aˉb\bar{a} \cdot b (covers m4,m5,m6m_4, m_5, m_6)
  • bcˉdb \cdot \bar{c} \cdot d (covers m5,m13m_5, m_{13} — rows 01 and 11 are adjacent in Gray code, so the vertical group in column cd=01cd=01 is valid)
  • abˉcˉa \cdot \bar{b} \cdot \bar{c} (covers m8,m9m_8, m_9)
  • abˉdˉa \cdot \bar{b} \cdot \bar{d} (covers m8,m10m_8, m_{10})
  • abda \cdot b \cdot d (covers m13,m15m_{13}, m_{15})

Essential prime implicants: Look at each 1-minterm and see how many PIs cover it:

  • m4m_4: covered only by aˉb\bar{a} \cdot b → essential.
  • m5m_5: covered by aˉb\bar{a} \cdot b and bcˉdb \cdot \bar{c} \cdot d.
  • m6m_6: covered only by aˉb\bar{a} \cdot b → essential (already covered).
  • m8m_8: covered by abˉcˉa \cdot \bar{b} \cdot \bar{c} and abˉdˉa \cdot \bar{b} \cdot \bar{d}.
  • m9m_9: covered only by abˉcˉa \cdot \bar{b} \cdot \bar{c} → essential.
  • m10m_{10}: covered only by abˉdˉa \cdot \bar{b} \cdot \bar{d} → essential.
  • m13m_{13}: covered by bcˉdb \cdot \bar{c} \cdot d and abda \cdot b \cdot d.

Essential PIs: aˉb\bar{a} \cdot b, abˉcˉa \cdot \bar{b} \cdot \bar{c}, abˉdˉa \cdot \bar{b} \cdot \bar{d}.

These cover: aˉb\bar{a} \cdot b covers m4,m5,m6m_4, m_5, m_6. abˉcˉa \cdot \bar{b} \cdot \bar{c} covers m8,m9m_8, m_9. abˉdˉa \cdot \bar{b} \cdot \bar{d} covers m8,m10m_8, m_{10}.

All 1s covered? m4m_4 ✓, m5m_5 ✓, m6m_6 ✓, m8m_8 ✓ (by both second and third), m9m_9 ✓, m10m_{10} ✓, m13m_{13} ✗ (NOT covered!).

m13m_{13} is not covered by any essential PI. We need to add a non-essential PI to cover it. Options: bcˉdb \cdot \bar{c} \cdot d or abda \cdot b \cdot d. The former requires 3 literals, the latter 3 literals. We can pick either (both same cost). Adding abda \cdot b \cdot d gives:

f=aˉb+abˉcˉ+abˉdˉ+abdf = \bar{a} \cdot b + a \cdot \bar{b} \cdot \bar{c} + a \cdot \bar{b} \cdot \bar{d} + a \cdot b \cdot d

Or adding bcˉdb \cdot \bar{c} \cdot d gives:

f=aˉb+abˉcˉ+abˉdˉ+bcˉdf = \bar{a} \cdot b + a \cdot \bar{b} \cdot \bar{c} + a \cdot \bar{b} \cdot \bar{d} + b \cdot \bar{c} \cdot d

Both are valid minimal covers. The first covers m13m_{13} and also the don’t-care m15m_{15}; the second covers m13m_{13} and also m5m_5 (which is already covered by aˉb\bar{a} \cdot b, so the overlap doesn’t matter).

The minimality does not depend on covering don’t-cares. What matters is covering all 1s with the fewest prime implicants (or fewest literals, depending on the cost metric).

Summary

  • Don’t-care conditions arise when certain input combinations can never occur in a specific application.
  • On a K-map, don’t-cares are marked with X.
  • In grouping, treat X as 1 if it helps form a larger group; ignore it otherwise.
  • Don’t-cares do NOT need to be covered by the final expression; only the actual 1s must be covered.
  • The definitions of prime implicants, essential prime implicants, and covering sets remain the same, but don’t-cares can participate in forming prime implicants.
  • Don’t-cares often enable dramatic simplifications, as seen in the BCD examples.