Don't-Care Conditions
Some input combinations can never happen. Marking them X instead of 0 lets your groups grow through them, and often removes a whole term from the answer.
Up to now every cell in the map has been a 0 or a 1. Real circuits have a third case: input combinations that cannot occur at all, so their output genuinely does not matter.
These are don't-care conditions, written X on the map, and they are not a shortcut or an approximation. They are a statement that the specification never says what should happen for that input, which leaves you free to pick whichever answer makes the circuit smaller.
Where they come from
The most common source is a code that does not use its full range, like a four-bit field that only ever carries the digits 0 through 9.
| Situation | Inputs that never occur |
|---|---|
| Binary-coded decimal: 4 bits holding one decimal digit | 1010 through 1111, since digits stop at 9 |
| A 7-segment display driven from BCD | The same six patterns |
| A one-hot signal where exactly one line is high | Every combination with two or more high |
| A state machine with unreachable states | Any encoding no transition can produce |
In each case the hardware will never see those inputs, so forcing the output to 0 there is a choice, and usually a needlessly expensive one.
Worked example: is the digit 5 or more?
Four bits ABCD carry one BCD digit, so only 0000 through 1001 ever appear, and the output should be 1 when the digit is 5 or more, which means minterms 5, 6, 7, 8 and 9.
First, the cautious version. Treat the six impossible inputs as 0, because that feels safe, and see what the map gives you.
F = A'BD + A'BC + AB'C'
5 ones, covered by 3 groups. This grouping is the only minimal one.
That gives A'BD + A'BC + AB'C', three terms and nine literals, because every group is boxed in by the zeros sitting around it.
Now mark those six as don't-cares instead, and watch what the groups do.
F = BD + BC + A
5 ones and 6 don't-cares, covered by 3 groups. This grouping is the only minimal one.
Now it is BD + BC + A, three terms and five literals. Same circuit behavior for every input that can actually happen, built from noticeably less logic.
The groups were able to expand into the X cells because nothing stops them there, and a group is only illegal if it covers a 0.
The rules
| Cell | Must be covered? | May be covered? |
|---|---|---|
| 1 | Yes, by at least one group | Yes |
| 0 | No | Never |
| X | No | Yes, whenever it helps |
That middle row is the one to internalize: a don't-care is worth including when it enlarges a group, and worth ignoring when it does not, which is a judgment call the solver makes for you every time it draws a boundary. A group made entirely of don't-cares is legal but pointless. It covers nothing that needed covering.
The catch
Don't-care means the input cannot occur, not that you have not thought about it. Those are very different claims, and confusing them produces a circuit that behaves arbitrarily on inputs that turn out to be reachable after all.
If a malformed input is merely unlikely rather than impossible, it is not a don't-care. Decide what should happen and write that down as a 0 or a 1, because the extra gate is cheaper than the bug.
Try it
This map has don't-cares in it. Group it yourself, then check whether you used them to your advantage.
No groups yet.
5 cells to cover. Bigger groups mean fewer literals, so always take the largest legal group you can.
Check yourself
What does an X in a Karnaugh map mean?
1/3