Digital Logic
K-Maps & Minimization
Group power-of-two adjacencies and mark essentials first — K-map questions are pure method marks.
GATE CSE Karnaugh maps — 2/3/4-variable layouts with diagrams, Gray adjacency, grouping, don’t-cares, essential PIs, and exam tricks.
Learning outcomes
- Draw 2–4 variable K-maps with correct Gray labels and minterm numbers
- Form legal pairs/quads/octets (including wraps) and read product terms
- Identify essential prime implicants and a minimal SOP (or POS from 0s)
- Use don’t-cares legally and apply GATE speed tricks under time pressure
Map structure & Gray labeling
- Each cell is one minterm. Axes use Gray code so geometrically adjacent cells (including wrap-around) differ by exactly one bit.
- 2-var: 4 cells; 3-var: 8; 4-var: 16; 5-var: two 4-var maps (often A=0 and A=1).
- SOP: plot 1s. POS: plot/group 0s (maxterms). Don’t-cares marked X.
- Always confirm variable order in the stem (AB\CD vs CD\AB changes which index sits where).
Formulas to remember
-
Cells = 2^n for n variables -
Gray sequence (2 bits): 00 → 01 → 11 → 10
| Vars | Cells | Typical GATE ask |
|---|---|---|
| 2 | 4 | Minimal SOP / constant |
| 3 | 8 | Group count / expression |
| 4 | 16 | Essentials + don’t-cares |
| 5 | 32 | Two stacked 4-var maps |
3-variable K-map layout
- Rows: A = 0,1. Columns BC in Gray order 00,01,11,10.
- Minterm index = binary ABC with A as MSB. Note m2 sits under BC=10, not under “binary counting” column 2.
- Left↔right wrap: columns 00 and 10 are adjacent (differ only in B).
- GATE trap: writing m0–m7 left-to-right in decimal order breaks adjacency — always use Gray columns.
Formulas to remember
-
Row A=0: m0, m1, m3, m2 -
Row A=1: m4, m5, m7, m6
Worked example
Problem. Where is minterm m6 on a 3-var map (A,BC)?
Solution. ABC=110 → A=1, BC=10 → bottom-right cell (not next to m5 in binary count order).
4-variable K-map layout
- Rows AB and columns CD both Gray: 00,01,11,10.
- Toroidal adjacency: left↔right and top↔bottom wraps; also 2×2 corners can form a quad of four corner cells.
- Learn the number grid (0–15) until you can plot Σm(…) without rebuilding Gray each time.
- 5-variable tip: fix the MSB on two 4-var maps; a valid group may span corresponding cells on both maps.
Formulas to remember
-
Quad (4 cells) → 2 literals dropped -
Octet (8 cells) → 3 literals dropped → one literal left on a 4-var map
Grouping rules (pairs, quads, octets)
- Valid group sizes: 1, 2, 4, 8, … only — never 3, 5, 6, 7 cells as one circle.
- Shape must be a rectangle in the Gray topology (including wrap and corner quads).
- Larger group ⇒ fewer literals. Prefer largest groups that still cover all 1s.
- Cells may belong to multiple groups. Each 1 must be covered at least once; Xs need not be covered.
- Reading a group: keep literals that are constant inside the group; drop bits that change.
Formulas to remember
-
Group size 2^k ⇒ eliminates k variables -
Single cell ⇒ n-literal minterm (n = #vars)
Worked example
Problem. F=Σm(0,2,4,5,6). Minimal SOP?
Solution. Quad {0,2,4,6} (wrap) → B′. Pair {4,5} → A C′. Cover complete: F = B′ + A C′.
Essential PIs & don’t-cares
- Prime implicant (PI): largest legal group that is not contained in a bigger group of 1s/Xs.
- Essential PI: covers at least one 1 that no other PI covers — must appear in every minimal SOP.
- Method: mark essentials first, strike covered 1s, then choose a cheapest cover of leftovers (may have alternate minimal SOPs).
- Don’t-cares (X): may be treated as 1 to grow a group, or left unused. Never invent an X that forces F=1 when the stem leaves it unspecified.
- POS path: group 0s the same way; each group is a sum term (maxterm product).
Worked example
Problem. Why can two “minimal” SOPs both be correct?
Solution. After essentials, remaining 1s may be covered by different equal-cost non-essential PIs. GATE usually accepts any minimal literal/gate count match.
GATE exam tricks — K-maps
- Plot carefully once; most wrong options come from a single misnumbered cell (especially m2/m3 and m6/m7 swap).
- If options are expressions, expand each to minterms and compare sets — faster than redrawing when stuck.
- Count literals: pair→drop 1 var, quad→drop 2, octet→drop 3. Mismatch with an option ⇒ wrong grouping.
- Wrap check: leftmost column adjacent to rightmost; top row to bottom on 4-var maps.
- Four corners of a 4-var map form a valid quad (AB and CD both change in Gray-adjacent way).
- Don’t-care present? First minimize without X, then retry with X — if a larger group appears, update; else ignore X.
- “Minimum number of gates/literals” ⇒ after SOP, also check if POS of 0-groups is cheaper.
- 5-var rare: only group across maps if the same CD/AB pattern cells are 1/X on both maps.
Formulas to remember
-
Verify cover: union of group minterms = all 1-indices (Xs optional) -
Essential test: a 1 with only one maximal group through it
Worked example
Problem. Quick check that B′ + A C′ covers Σm(0,2,4,5,6)?
Solution. B′ covers even BC with B=0 → m0,m2,m4,m6. A C′ adds m5 (101). All listed 1s covered; m1,m3,m7 stay 0.
Quine–McCluskey (idea)
- Tabular twin of K-maps: combine minterms that differ by one bit; dashes mark eliminated variables.
- Prime implicant chart then picks essentials — same logic as circling essentials on a map.
- GATE rarely asks a full QM table; use it mentally when a 5–6 variable stem appears or to justify PI lists.
Exam tips
- Memorise 3-var and 4-var number grids — plotting speed wins marks.
- Circle essential PIs before optional covering groups.
- Count literals after grouping to verify minimality against options.
- Don’t-cares: include only when they enlarge a legal power-of-two group.
- Watch Gray order: m2 beside m0, m3 beside m1 — not decimal left-to-right.
- Check wrap-around and 4-corner quads before declaring “no larger group”.
- If two options look minimal, compare total literals (and whether both cover every 1).
- For POS answers, regroup the 0-cells — do not negate an SOP blindly under time pressure unless you verify.
10 GATE-style MCQs for K-Maps & Minimization with full explanations. Attempt each question before revealing the answer.
Largest power-of-two group on a 4-var map that yields one literal covers:
Show answer & explanation
Answer: B
8 cells drop 3 variables → one literal. 16 cells ⇒ constant 1.
K-map adjacency uses:
Show answer & explanation
Answer: B
Gray labeling makes single-bit neighbors adjacent.
An essential prime implicant:
Show answer & explanation
Answer: B
Definition of essential PI.
Don’t-cares in K-maps:
Show answer & explanation
Answer: B
Optional 1s for grouping only.
3-variable K-map has how many cells?
Show answer & explanation
Answer: C
2^3=8.
Minimal SOP of Σm(0,1,2,3) for A,B is:
Show answer & explanation
Answer: C
All four minterms → constant 1.
Wrapping edges on a K-map are adjacent because of:
Show answer & explanation
Answer: B
Gray codes wrap so leftmost/rightmost (and top/bottom) differ by one bit.
A quad (4-cell group) eliminates how many variables?
Show answer & explanation
Answer: B
4=2^2 ⇒ two bits vary ⇒ two literals drop.
POS minimization on a K-map groups:
Show answer & explanation
Answer: B
Group 0s for product-of-sums.
Two different minimal SOP covers can exist when:
Show answer & explanation
Answer: B
After essentials, remaining 1s may have multiple equal-cost covers.
Extra page-specific practice beyond the GATE samples. Attempt all 10, then reveal answers to check your reasoning.
Cells in a 4-variable K-map:
Show answer & explanation
Answer: C) 16
2^4=16.
Pair (2 cells) eliminates:
Show answer & explanation
Answer: B) 1 var
One bit changes inside the pair.
F=Σm(0,2) for A,B minimal SOP:
Show answer & explanation
Answer: D) ¬B
m0=00, m2=10 → B=0.
Including an X that is not needed:
Show answer & explanation
Answer: B) OK if it helps a larger group of required 1s
Don’t-care outputs may be 0 or 1.
Prime implicant is:
Show answer & explanation
Answer: B) Implicant not covered by a larger implicant
Standard PI definition.
Minimal expression prefers:
Show answer & explanation
Answer: B) Fewer terms / fewer literals (cost model)
GATE usually wants simplest SOP/POS.
5-variable map often drawn as:
Show answer & explanation
Answer: B) Two 4-variable maps
Common textbook presentation.
Corner cells of a 4-var map can form a quad if all are 1 because:
Show answer & explanation
Answer: B) They are mutually adjacent via wraps
Four corners are a classic wrap group.
Σm(1,3,5,7) for A,B,C often simplifies to:
Show answer & explanation
Answer: A) C
Odd minterms → C=1.
After essentials, leftover 1s require:
Show answer & explanation
Answer: B) Additional PIs to complete cover
Finish a complete cover of all 1s.
Topic FAQs
Must every 1 be covered?
Yes for a correct SOP cover. Don’t-cares need not be covered.
Why is Gray code used on K-maps?
So that cells that differ by one variable are adjacent (including wraps). Binary counting order would place single-bit neighbors apart.
Can a group wrap around the edges?
Yes. Left–right and top–bottom wraps are legal. On 4-var maps, the four corners also form a valid quad.
How do I know a prime implicant is essential?
If some 1-cell lies in only one largest group, that group is essential and must be in every minimal SOP.
When should I ignore a don’t-care?
When treating it as 1 does not create a larger legal group or does not help cover remaining 1s. Unused Xs simply stay unspecified.
SOP vs POS on the map — which is better?
Try both when the question asks minimum literals/gates. Dense 1s favour SOP; dense 0s often favour POS.
Hover a card to reveal the answer with a 3D flip. On touch devices, tap the card or use Show answer.