Module 1: Foundations of Digital Logic · 1.4 Karnaugh Maps & Logic Minimization

Don't-Care Conditions

In previous articles, every cell on a Karnaugh map contained a definite 0 or 1. In physical digital systems, some input combinations never occur, or their output states are not read. These combinations are don’t-care conditions. Don’t-care conditions allow designers and synthesis tools to produce smaller logic circuits. However, improper use of don’t-care conditions creates functional risks in hardware.

Definition of Don’t-Care Conditions

A don’t-care condition, designated by $X$ or $d$ on a Karnaugh map, represents an input combination whose output value does not affect system operation. Two categories of don’t-care conditions exist:

  1. Impossible Input Combinations: These input conditions cannot occur during normal operation. For example, Binary Coded Decimal (BCD) uses 4 bits to encode decimal digits from 0 through 9. The binary values 1010 through 1111 (decimal 10 through 15) never appear on a valid BCD data bus. A BCD decoder can assign any output value to these unused codes.
  2. Unread Output States: The input pattern is valid, but downstream logic ignores the output value. For example, when a priority encoder has no active inputs, a separate valid signal drops to low. The system ignores the encoded output value.

Rules for Grouping Don’t-Care Cells

When you simplify a Karnaugh map, you can treat each $X$ cell as either a 1 or a 0:

  • Treat an $X$ cell as a 1 if it increases the size of a group of 1s.
  • Treat an $X$ cell as a 0 if it does not help simplify a group.
  • Do not make a group that contains only $X$ cells.
  • Any unused $X$ cell defaults to 0 in the final sum-of-products circuit.

BCD to Seven-Segment Decoder

A standard BCD to seven-segment display decoder demonstrates don’t-care minimization. The circuit accepts a 4-bit BCD input and drives seven LED segments labeled $a$ through $g$ (Figure 1). The input bits are $D$, $C$, $B$, and $A$, where $D$ is the most significant bit.

Seven-segment layout
Figure 1: Segment designations of a seven-segment display

Table 1 lists the truth table for the BCD to seven-segment decoder:

Digit D C B A a b c d e f g
0 0 0 0 0 1 1 1 1 1 1 0
1 0 0 0 1 0 1 1 0 0 0 0
2 0 0 1 0 1 1 0 1 1 0 1
3 0 0 1 1 1 1 1 1 0 0 1
4 0 1 0 0 0 1 1 0 0 1 1
5 0 1 0 1 1 0 1 1 0 1 1
6 0 1 1 0 1 0 1 1 1 1 1
7 0 1 1 1 1 1 1 0 0 0 0
8 1 0 0 0 1 1 1 1 1 1 1
9 1 0 0 1 1 1 1 1 0 1 1
10–15 - - - - X X X X X X X

Minimizing Segment a

Segment $a$ is active (1) for digits 0, 2, 3, 5, 6, 7, 8, and 9. It is inactive (0) for digits 1 and 4. The minterm and don’t-care expression is:

$$a = \sum m(0, 2, 3, 5, 6, 7, 8, 9) + d(10, 11, 12, 13, 14, 15)$$

Figure 2 shows the Karnaugh map with the six don’t-care cells and selected groups.

Segment a with don’t-cares
Figure 2: Segment a Karnaugh map using don't-cares to maximize group sizes

We group the cells as follows:

  1. Columns $BA = 11$ and $BA = 10$ contain only 1s and $X$s. They form a group of eight cells where $B = 1$. The term is $B$.
  2. Rows $DC = 11$ and $DC = 10$ contain only 1s and $X$s. They form a group of eight cells where $D = 1$. The term is $D$.
  3. Cell 5 combines with cell 7 and don’t-care cells 13 and 15 to form a group of four. The term is $CA$.
  4. Cell 0 combines with cell 2 and don’t-care cells 8 and 10 to form a 4-cell corner group. The term is $\overline{C},\overline{A}$.

The simplified Boolean equation is:

$$a = D + B + CA + \overline{C},\overline{A}$$

This equation requires four product terms and six literals.

Figure 3 shows the same function without using don’t-care conditions (treating all $X$ cells as 0).

Segment a without don’t-cares
Figure 3: Segment a minimized without don't-cares requires five terms and fourteen literals

Without don’t-cares, the largest group size is four cells. The implementation requires five product terms and fourteen literals. Don’t-cares reduced the literal count from 14 to 6.

Hardware Risks of Don’t-Care Minimization

When you include a don’t-care condition, you assume that the unused input combination never occurs. If that input combination occurs, the circuit produces an arbitrary output determined by the minimization tool.

Invalid input conditions can occur in physical hardware:

  1. Power-On Reset: Registers can initialize in undefined states before reset assertions stabilize.
  2. Upstream Logic Faults: Transient glitches or bugs in upstream blocks can generate invalid codes.
  3. Single-Event Upsets (SEU): Radiation or electrical noise can flip register bits in mission-critical applications.
  4. Stuck-At Faults: Manufacturing defects can hold internal signal lines at a constant logic level.

Design Guidelines for Unused States

Application Recommendation
Display Decoders Use don’t-cares freely. Invalid display patterns do not cause catastrophic system failure.
Priority Encoders Verify that downstream logic qualifies outputs with a valid signal before applying don’t-cares.
Finite State Machines (FSM) Direct unused states to a deterministic reset state, or use one-hot encoding with error traps.
Safety-Critical Systems Avoid don’t-cares. Add explicit detection logic to trap invalid inputs into a fail-safe state.

Don’t-care optimization can also introduce static logic hazards (transient output glitches during input transitions). If the output drives an asynchronous input or latch enable, verify the circuit for hazards.

Three-Variable Example

Consider the function:

$$F(A, B, C) = \sum m(1, 4, 5) + d(2, 3)$$

Figure 4 illustrates the Karnaugh map.

3-variable example
Figure 4: Karnaugh map for F = Σm(1,4,5) + d(2,3)

  • Without Don’t-Cares:

    • Minterms 4 and 5 form a group of two: $A\overline{B}$.
    • Minterm 1 cannot combine with other 1s: $\overline{A},\overline{B}C$.
    • Result: $F = A\overline{B} + \overline{A},\overline{B}C$ (five literals).
  • With Don’t-Cares:

    • Minterm 1 combines with minterm 5 in column $BC = 01$: $\overline{B}C$.
    • Minterms 4 and 5 form a group of two: $A\overline{B}$.
    • Result: $F = A\overline{B} + \overline{B}C$ (four literals).
    • Don’t-care cells 2 and 3 remain unused and evaluate to 0 in the circuit.

Practice Exercise

Minimize the function $F(A, B, C, D) = \sum m(0, 1, 2, 8, 9) + d(10, 11)$ with and without don’t-cares.

View Solution

Practice solution
Figure 5: Solution map for F = Σm(0,1,2,8,9) + d(10,11)

1. Without Don’t-Cares:

  • Cells 0, 1, 8, and 9 form a group of four: $\overline{B},\overline{C}$.
  • Cell 2 pairs with cell 0 in row 00: $\overline{A},\overline{B},\overline{D}$.
  • Minimized expression: $F = \overline{B},\overline{C} + \overline{A},\overline{B},\overline{D}$ (five literals).

2. With Don’t-Cares:

  • Cells 0, 1, 8, and 9 form the same group of four: $\overline{B},\overline{C}$.
  • Don’t-care cell 10 joins cells 0, 2, and 8 to form a 4-cell corner group: $\overline{B},\overline{D}$.
  • Minimized expression: $F = \overline{B},\overline{C} + \overline{B},\overline{D}$ (four literals).
  • Cell 11 is not included in any group and evaluates to 0.

In the next article, we examine algorithmic logic minimization methods used by automated synthesis tools for functions with more than four variables.

← The Four-Variable Karnaugh Map The Quine-McCluskey Method →