Don't-Care Conditions

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, so their output genuinely does not matter.

These are don't-care conditions, written X on the map. 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.

SituationInputs that never occur
Binary-coded decimal: 4 bits holding one decimal digit1010 through 1111, since digits stop at 9
A 7-segment display driven from BCDThe same six patterns
A one-hot signal where exactly one line is highEvery combination with two or more high
A state machine with unreachable statesAny encoding no transition can produce

In each case the hardware will never see those inputs. 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. 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:

Impossible inputs forced to 05 ones · 3 groups
00
01
11
10
00
01
11
10
1output is 10output is 0Xdon't care
Minimal sum of products

F = A'BD + A'BC + AB'C'

3
terms
9
literals
-55%
vs minterms
Groups in the minimal cover
A'BD2A'BC2AB'C'2

5 ones, covered by 3 groups. This grouping is the only minimal one.

That gives A'BD + A'BC + AB'C': 3 terms and 9 literals. Every group is boxed in by the zeros around it.

Now mark those six as don't-cares instead, and watch what the groups do:

Impossible inputs marked X5 ones · 3 groups
00
01
11
10
00
01
11
10
1output is 10output is 0Xdon't care
Minimal sum of products

F = BD + BC + A

3
terms
5
literals
-75%
vs minterms
Groups in the minimal cover
BD4BC4A8

5 ones and 6 don't-cares, covered by 3 groups. This grouping is the only minimal one.

Now it is BD + BC + A: 3 terms and 5 literals. Same circuit behaviour 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. A group is only illegal if it covers a 0.

The rules

CellMust be covered?May be covered?
1Yes, by at least one groupYes
0NoNever
XNoYes, whenever it helps

That middle row is the one to internalise. A don't-care is worth including when it enlarges a group, and worth ignoring when it does not. A group made entirely of don't-cares is legal but pointless: it covers nothing that needed covering, and adds a term to your expression for no reason.

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. 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.

Group it yourself0 / 3 groups
00
01
11
10
00
01
11
10
1output is 10output is 0Xdon't care
Your expression

No groups yet.

Groups you have found
none

5 cells to cover. Bigger groups mean fewer literals, so always take the largest legal group you can.

Check yourself

Quizquestion 1 of 3
What does an X in a Karnaugh map mean?