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 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 through ) 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 on the K-map. The grouping strategy is:
- Treat an as 1 if it helps form a larger group (leading to fewer literals).
- Treat an 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 with don’t-care conditions: , , .
First, identify all the terms and don’t-cares as minterm indices.
minterms:
- : → covers () and (). = 0001, = 0011.
- : → covers () and ().
- : → covers () and ().
So minterms (1s): .
Don’t-cares:
- : (0000)
- : (0011) — note this is already a minterm of , so it does not add a new don’t-care
- : (0101)
K-map (4 variables, ):
Grouping without using don’t-cares: the 1s at would require multiple small groups.
Grouping using don’t-cares: Column contains 1s at all four rows (), forming a group of 4. Constant: ; and vary. Term: . This covers four of the five 1s.
The remaining 1 at (0001) can pair with the don’t-care at (0000) to form a group of 2: constant ; varies. Term: . Alternatively, could pair with the don’t-care at (0101) for a vertical group: constant ; varies. Term: .
Both options yield valid simplified expressions with the same gate cost (1 AND-2 + 1 AND-3 + 1 OR-2):
Alternative: Use more don’t-cares for even larger group
What if we treat both and as 1s? Then (0000) and (0001) give . And and give , 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 ; the second group covers ). Done.
Another Worked Example: BCD Counter Decoder
Consider a BCD to decimal decoder with 4 inputs () and 10 outputs ( through ). Input combinations 1010 to 1111 are don’t-cares. Let us design the output , which is TRUE only when the BCD input is 9 (binary 1001).
Truth table for :
| a | b | c | d | |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | X |
| 1 | 0 | 1 | 1 | X |
| 1 | 1 | 0 | 0 | X |
| 1 | 1 | 0 | 1 | X |
| 1 | 1 | 1 | 0 | X |
| 1 | 1 | 1 | 1 | X |
Without don’t-cares: (a single minterm, 4 literals).
With don’t-cares: Plot on K-map.
The 1 is at (1001): , . The Xs are at through : rows (cols 10,11) and (all four cols).
Without don’t-cares, (4 literals).
With don’t-cares, (1001) pairs with (1011, X) horizontally: constant ; varies. Term: (3 literals). But we can do better: , , (1101, X), and (1111, X) form a 2×2 rectangle (rows 10 and 11, columns 01 and 11). Constant: ; and vary. Term: (2 literals).
Check: is 1 when and . This covers (1001), (1011), (1101), and (1111). The latter three are all don’t-cares, so this is valid.
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: . Don’t-cares: .
Prime implicants:
-
PI1: Row (all four cells: ). is X, the rest are 1s. Group of 4: .
-
PI2: Column , rows 01 and 11 (). Rows 01 and 11 are adjacent in Gray code. Constant: ; varies. Term: .
-
PI3: Row has 1s at but a gap at (empty), so no group of 4. Two groups of 2: and (horizontal, columns 00 and 01) → ; and (horizontal wrap, columns 00 and 10) → .
-
PI4: (1101) and (1111) in row , columns 01 and 11 (adjacent in Gray code). is 1, is X. Horizontal group of 2: constant ; varies. Term: .
Prime implicants found:
- (covers )
- (covers — rows 01 and 11 are adjacent in Gray code, so the vertical group in column is valid)
- (covers )
- (covers )
- (covers )
Essential prime implicants: Look at each 1-minterm and see how many PIs cover it:
- : covered only by → essential.
- : covered by and .
- : covered only by → essential (already covered).
- : covered by and .
- : covered only by → essential.
- : covered only by → essential.
- : covered by and .
Essential PIs: , , .
These cover: covers . covers . covers .
All 1s covered? ✓, ✓, ✓, ✓ (by both second and third), ✓, ✓, ✗ (NOT covered!).
is not covered by any essential PI. We need to add a non-essential PI to cover it. Options: or . The former requires 3 literals, the latter 3 literals. We can pick either (both same cost). Adding gives:
Or adding gives:
Both are valid minimal covers. The first covers and also the don’t-care ; the second covers and also (which is already covered by , 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.