Sub topic 15
Prime implicant chart and choosing a minimal cover
This chapter assumes you can find prime implicants with a K-map or with the Quine-McCluskey (QM) combining step, and that you know minterm notation such as Σm(0,1,2). It covers the second half of QM: picking the fewest prime implicants that cover the function.
Why a chart is needed
The combining step of QM gives you every prime implicant (PI). A minimal expression rarely uses all of them. Some PIs are redundant, and some are required. The prime implicant chart is a table that shows which PI covers which minterm, so you can decide which PIs to keep.
The chart has these parts:
- Rows are prime implicants.
- Columns are the minterms the function must output 1 for.
- An X in a cell means that row's PI covers that column's minterm.
Don't-care minterms never get a column. They helped form larger PIs, but nothing requires you to cover them.
Reading the chart
Work through these steps in order:
- Find every column with exactly one X. The PI in that row is an essential prime implicant (EPI), and it must be in every cover.
- Add the EPIs to the answer, then delete their rows and every column they cover.
- Look at what remains. If no columns remain, you are done.
- If columns remain, reduce the chart using dominance (below). If the chart still has no single-X columns, it is cyclic.
- For a cyclic chart, choose a cover by trial or by Petrick's method (a later chapter).
Worked example with essential PIs
Take F(A,B,C,D) = Σm(4, 8, 10, 11, 12, 15) + d(9, 14). The combining step produces four PIs:
| Prime implicant | Cube | Covers (including don't-cares) |
|---|---|---|
| BC'D' | -100 | 4, 12 |
| AB' | 10-- | 8, 9, 10, 11 |
| AD' | 1--0 | 8, 10, 12, 14 |
| AC | 1-1- | 10, 11, 14, 15 |
Now build the chart using only the required minterms. Columns 9 and 14 are left out.
| Prime implicant | 4 | 8 | 10 | 11 | 12 | 15 |
|---|---|---|---|---|---|---|
| -100 | X | X | ||||
| 10-- | X | X | X | |||
| 1--0 | X | X | X | |||
| 1-1- | X | X | X |
Column 4 has one X, in row -100. Column 15 has one X, in row 1-1-. Both rows are essential. Together they cover 4, 12, 10, 11, 15. Only minterm 8 remains. Either 10-- or 1--0 covers it at the same cost, so both of these are minimal:
- F = BC'D' + AC + AB'
- F = BC'D' + AC + AD'
A tie like this is normal. The exam usually asks for the number of terms or literals, which is the same for both answers.
Dominance
Dominance can shrink a chart that has no essential PIs.
- Row dominance: Row X dominates row Y if X covers every column that Y covers, and X costs no more than Y. Delete row Y.
- Column dominance: Column P dominates column Q if every row with an X in Q also has an X in P. Delete column P, because covering Q will always cover P too.
The two rules delete different things. Row dominance deletes the dominated row, the weaker PI. Column dominance deletes the dominating column, the one that is easier to satisfy. Students often reverse the second rule.
After each deletion, look again for single-X columns. A reduction can create new essential PIs.
A cyclic chart
Consider F(A,B,C) = Σm(0,1,2,5,6,7). The PIs are the six cubes 00-, 0-0, -01, -10, 1-1 and 11-.
| Prime implicant | 0 | 1 | 2 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|
| 00- (A'B') | X | X | ||||
| 0-0 (A'C') | X | X | ||||
| -01 (B'C) | X | X | ||||
| -10 (BC') | X | X | ||||
| 1-1 (AC) | X | X | ||||
| 11- (AB) | X | X |
Every column has exactly two X marks, so there are no essential PIs. No row dominates another, and no column dominates another. The chart cannot be reduced.
To solve it, pick any PI and see what is left. Choosing A'B' covers 0 and 1. The remaining minterms are 2, 5, 6, 7. BC' covers 2 and 6, and AC covers 5 and 7. That gives three terms. You can start from A'C' instead and get a second three-term cover. Neither can be done in two terms, because each PI covers only two minterms and there are six minterms to cover.
- F = A'B' + BC' + AC
- F = A'C' + B'C + AB
Both have 3 terms and 6 literals.
Automating the selection
This program finds the essential PIs and every smallest cover by brute force. It is fine for exam-sized inputs.
from itertools import combinations
def covers(term, m, n):
bits = format(m, f'0{n}b')
return all(t in ('-', b) for t, b in zip(term, bits))
def analyse(primes, minterms, n):
chart = {m: [p for p in primes if covers(p, m, n)] for m in minterms}
essential = sorted({ps[0] for ps in chart.values() if len(ps) == 1})
for k in range(1, len(primes) + 1):
found = [c for c in combinations(primes, k)
if all(any(covers(p, m, n) for p in c) for m in minterms)]
if found:
return essential, found
return essential, []
primes = ['-100', '10--', '1--0', '1-1-']
required = [4, 8, 10, 11, 12, 15] # don't-cares 9 and 14 are not listed
ess, covers_found = analyse(primes, required, 4)
print(ess)
for c in covers_found:
print(c)It prints ['-100', '1-1-'], then the two minimal covers ('-100', '10--', '1-1-') and ('-100', '1--0', '1-1-'). If you pass 9 or 14 in required, the program wrongly demands that they be covered. That is the same mistake as adding a column for a don't-care.
Common errors
- Adding columns for don't-cares. This forces extra terms into the answer.
- Treating a PI as essential because it is large. A PI is essential only if it is the sole cover of some required minterm.
- Stopping after the essentials without checking for uncovered minterms.
- Choosing the cover with the most PIs covering each column instead of the lowest cost. Minimal means fewest terms first, then fewest literals, unless the question says otherwise.
- Assuming the minimal cover is unique. Ties are common, and a cyclic chart usually has several.
Exercise
A function has required minterms 1, 3, 4, 6 and PIs P1 = {1, 3}, P2 = {3, 6}, P3 = {4, 6}, P4 = {1, 4}. Which PIs are essential, and what is the minimum number of PIs in a cover?
Show answer
Each minterm appears in exactly two PIs (1 in P1 and P4, 3 in P1 and P2, 4 in P3 and P4, 6 in P2 and P3), so no column has a single X and there are no essential PIs. The chart is cyclic. Each PI covers two minterms and there are four minterms, so at least two PIs are needed. P1 and P3 cover 1, 3, 4, 6, so the minimum cover has 2 PIs. P2 and P4 also work.
Exercise
In the chart for F = Σm(4, 8, 10, 11, 12, 15) + d(9, 14), why is there no column for minterm 14, and why does that not make AD' unnecessary as a candidate?
Show answer
Minterm 14 is a don't-care, so the function does not require it to be covered. AD' is still a valid PI because it was formed using 14 and covers the required minterms 8, 10 and 12. It is a candidate for covering minterm 8 and ties with AB' on cost.