Altifigence Academy

9 / 63 · Concept

Karnaugh maps and the conditions for don't-cares

Simplify expressions using Gray-code adjacency, and explicitly state assumptions about unused inputs.

Connect a truth table to implementation cost

A truth tableTruth table A table listing every possible input combination and its output. Changes over time are checked separately with waveforms. Learn more defines the function; logic minimization chooses an expression to implement it. For three inputs, define minterm numbers by the binary value ABC, with A as the most significant bit.

F(A,B,C)=Σm(1,3,4,5,7)F(A,B,C)=\Sigma m(1,3,4,5,7)

For example, minterm 4 is ABC=100. The unlisted rows 0, 2 and 6 have output 0. Instead of always implementing five product terms, group terms that differ in only one bit.

A Karnaugh map is a truth table in a different order

Arrange the columns as BC=00, 01, 11, 10. This Gray-code order changes only one bit between adjacent columns. The leftmost and rightmost columns are adjacent too.

A / BC00011110
00110
11110

Groups must be rectangular and contain 1,2,4,8,…1,2,4,8,\ldots cells. Including a 0 cell changes the function. A 1 cell may belong to multiple groups.

  1. Group the four cells in the two C=1 columns. The output is 1 regardless of A and B, leaving the term C.
  2. Group BC=00 and 01 in the A=1 row. Only C varies, leaving AB‾A\overline B.
  3. OR the two groups: every 1 is covered and every 0 is avoided.
F=C+AB‾F=C+A\overline B

Compare the original definition and simplified expression for all eight inputs. Check separately that the expression is shorter and that its function is unchanged.

The flow below converts the map's two groups into terms. A and B vary in the C group, and C varies in the two-cell group, so those variables are eliminated from the respective terms.

Variables eliminated by grouping
  1. m1,3,5,7: C=1 while A and B vary
  2. m4,5: Only C varies with A=1, B=0
  3. Sum of the two groups: F = C + A · NOT B

A don't-care grants optimization freedom and assumes an input constraint

Suppose the system contract guarantees ABC=000 never occurs. Marking that cell X allows it to be used as either 0 or 1. Group the four B=0 cells to obtain

Fdc=C+B‾F_{\mathrm{dc}}=C+\overline B

The new expression outputs 1 for ABC=000, unlike the original complete truth table. Calling the circuits equivalent therefore requires the condition that the input is never 000. If 000 can occur during initialization or error recovery, this optimization can violate system requirements.

Minimizing an expression is not the same as minimizing a chip

Fewer literals do not always give optimal area, delay and power in a particular standard-cell library. Load, fan-out, available complex gates, wiring and glitches affect the result. At this stage, establish functional equivalence and input assumptions; judge physical cost from synthesis and timing results.

Further reading: MIT OpenCourseWare — Combinational Logic

Lab · Check overlapping groups and don't-care conditions

From C and A·NOT B to a larger group

F = C + A · ¬B

Three-input truth table · X is an unspecified output
ABCF
0000
0011
0100
0111
1001
1011
1100
1111
  1. Select the C group. A and B both vary across its four cells, leaving only C.
  2. Select A·¬B. It covers m4 and m5, and m5 overlaps the C group. Overlap is allowed; including a 0 cell is not.
  3. Press m0 twice, changing 0 → 1 → X. Once it is X, the specification is incomplete and includes d(0). The B=0 group expands, giving C+B‾C+\overline B.
  4. Press m0 once more to restore 0. Restoring the original requirement should remove the larger group.

Selecting a group does not change values. The complete expression still covers every 1; the border highlights only the term currently being examined. Here “minimum” first refers to product-term count, then literal count. When several solutions exist, the display shows one of them.

Try it yourself

You changed m0 to X and implemented F=C+NOT B. A new requirement allows ABC=000 during reset and requires F=0 then. Can you retain this optimization?

Read the explanation

No. The new requirement specifies m0 as 0 again. The optimized expression outputs 1 for 000, violating the requirement. Return to an expression satisfying every specified row, such as the original C+A·NOT B.

Your choice applies to this browser. Change it any time using the footer.