Karnaugh maps and logic minimisation — Unit 2 Notes (Digital Logic Design)

BCS303 · Unit 2

Karnaugh maps and logic minimisation notes — Unit 2

Free unit-wise study notes on karnaugh maps and logic minimisation for Digital Logic Design, Semester 3 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.

A graphical method for minimizing Boolean expressions. Covers SOP/POS forms, Minterms/Maxterms, 2/3/4/5-variable K-Maps, Don't Care conditions, and the Quine-McCluskey method.

Notebook — 14 pages

Page 1

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

1. Standard Forms of Boolean Expressions

Before minimizing logic, we must represent it in standard formats. There are two primary forms: Sum of Products (SOP) and Product of Sums (POS).

1.1 Minterms and Maxterms

Consider a function of nn binary variables. They can be combined to form 2n2^n unique combinations.

  • Minterm (Standard Product): An AND term containing all nn variables (either normal or complemented). Example for 3 variables (A, B, C): ABCA'BC'. Evaluates to 1 for exactly one row in the truth table. Denoted by lowercase mim_i.
  • Maxterm (Standard Sum): An OR term containing all nn variables. Example: A+B+CA + B' + C. Evaluates to 0 for exactly one row in the truth table. Denoted by uppercase MiM_i.

Key Relationship: A Maxterm is the exact complement of its corresponding Minterm. Mj=(mj)M_j = (m_j)'.

Next — SOP and POS Forms

1 of 14

Page 2

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

2. SOP and POS Forms

2.1 Sum of Products (SOP)

A Boolean expression consisting of the logical sum (OR) of product (AND) terms.
Example:
F=AB+CD+ACF = AB' + C'D + A'C.

Canonical SOP: An SOP where every product term is a Minterm (contains all variables).
Notation:
F(A,B,C)=Σm(1,4,5,6,7)F(A,B,C) = \Sigma m(1, 4, 5, 6, 7)

2.2 Product of Sums (POS)

A Boolean expression consisting of the logical product (AND) of sum (OR) terms.
Example:
F=(A+B)(C+D)F = (A + B') \cdot (C' + D).

Canonical POS: A POS where every sum term is a Maxterm.
Notation:
F(A,B,C)=ΠM(0,2,3)F(A,B,C) = \Pi M(0, 2, 3)

Note: The Minterms of a function are exactly the indices missing from its Maxterms. If a 3-variable function has minterms Σ(1,4,5,6,7)\Sigma(1,4,5,6,7), its maxterms are Π(0,2,3)\Pi(0,2,3).

Next — Introduction to Karnaugh Maps

2 of 14

Page 3

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

3. Introduction to Karnaugh Maps (K-Maps)

Minimizing expressions using Boolean algebra theorems is tedious and prone to human error. The Karnaugh Map (K-Map) is a graphical tool that systematically minimizes expressions up to 5 variables.

3.1 The Principle

A K-Map is an array of cells, where each cell represents a Minterm. The cells are arranged so that physically adjacent cells differ by exactly one variable (Gray code ordering).

Because adjacent cells differ by only one variable, if two adjacent cells contain a '1', they can be combined to eliminate the variable that changes state (e.g., ABC+ABC=BC(A+A)=BCA'BC + ABC = BC(A' + A) = BC).

Next — 2 and 3-Variable K-Maps

3 of 14

Page 4

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

4. 2 and 3-Variable K-Maps

4.1 2-Variable K-Map

For n=2n=2 variables (A, B), the map has 22=42^2 = 4 cells.
Rows are labeled A (0, 1), Columns are labeled B (0, 1).
Cells represent
m0,m1,m2,m3m_0, m_1, m_2, m_3.

4.2 3-Variable K-Map

For n=3n=3 variables (A, B, C), the map has 23=82^3 = 8 cells (usually drawn as 2 rows, 4 columns).

Row labels (A): `0`, `1`.
Column labels (BC): `00`, `01`, `11`, `10`
(Notice the Gray Code sequence!)

Cell indices (Top row): 0, 1, 3, 2
Cell indices (Bottom row): 4, 5, 7, 6

Why Gray Code? It ensures that column 01 and column 11 differ by only one bit (the B bit). If we used standard binary (01 then 10), two bits would change, destroying the logic of spatial adjacency.

Next — 4-Variable K-Map

4 of 14

Page 5

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

5. 4-Variable K-Map

For n=4n=4 variables (A, B, C, D), the map has 24=162^4 = 16 cells (4x4 grid).

Row labels (AB): `00`, `01`, `11`, `10`
Column labels (CD): `00`, `01`, `11`, `10`

5.1 Cell Mapping Index

Mapping truth table row numbers to the 16 cells (Row by Row):

Row 1 (00): `0` `1` `3` `2`
Row 2 (01): `4` `5` `7` `6`
Row 3 (11): `12` `13` `15` `14` <--
Notice row 3 and 4 are swapped due to Gray code
Row 4 (10): `8` `9` `11` `10`

To plot a function given in Canonical SOP, e.g., F=Σm(0,1,2,5,8,9,10)F = \Sigma m(0,1,2,5,8,9,10), simply place a '1' in the corresponding numbered cells. All other cells get '0'.

Next — K-Map Grouping Rules

5 of 14

Page 6

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

6. K-Map Grouping Rules

The goal is to group adjacent '1's to form the largest possible blocks. The larger the block, the more variables are eliminated.

6.1 Rules for Forming Groups

  • Groups must contain 1,2,4,81, 2, 4, 8, or 1616 cells (2k2^k). You cannot group 3 or 6 cells.
  • Groups must be rectangular or square (no diagonals, no L-shapes).
  • A group must be as large as mathematically possible.
  • Every '1' must be part of at least one group.
  • Groups can overlap (a '1' can be used in multiple groups if it helps make larger groups).
  • Map Rolling: The left and right edges are considered adjacent (like a cylinder). The top and bottom edges are also adjacent. Therefore, the 4 corners of a 4-variable map form a valid group of 4.

Next — Reading the Minimized Expression

6 of 14

Page 7

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

7. Reading the Minimized Expression

Once the groups are drawn, we extract the minimized SOP terms.

7.1 Extraction Rule

For each group, look at the row and column labels that span the group.

  • If a variable remains constant across the entire group (e.g., A is '1' for the whole group), it is included in the term (as AA).
  • If a variable is '0' for the whole group, it is included as its complement (AA').
  • If a variable changes state within the group (e.g., A is '0' in half the group and '1' in the other half), the variable is eliminated.

The final minimized expression is the logical OR (sum) of the extracted product terms.

Example: A group of 4 cells eliminates 2 variables. A group of 8 cells eliminates 3 variables.

Next — Prime Implicants

7 of 14

Page 8

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

8. Implicants and Prime Implicants

Formal terminology used in minimization algorithms.

  • Implicant: Any valid rectangular group of '1's in a K-Map. Any single '1' or valid pairing is an implicant.
  • Prime Implicant (PI): A group of '1's that cannot be combined with any other '1's to form a larger valid group. (The largest possible groups you drew).
  • Essential Prime Implicant (EPI): A Prime Implicant that contains at least one '1' that is not covered by any other prime implicant. These MUST be included in the final minimized expression.
  • Redundant Prime Implicant: A Prime Implicant whose '1's are completely covered by other Essential Prime Implicants. These are discarded to achieve minimization.

Next — Don't Care Conditions

8 of 14

Page 9

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

9. Don't Care Conditions

In some digital systems, certain input combinations will never occur. For example, in a BCD system, inputs 1010 to 1111 (10 to 15) are invalid. We do not care what the output is for these inputs.

These are called Don't Care conditions, denoted by 'X' or 'd' in the truth table and K-Map. Notation: F=Σm(0,1,2)+d(3,4)F = \Sigma m(0, 1, 2) + d(3, 4)

9.1 Utilizing Don't Cares in K-Maps

  • An 'X' cell can be treated as a '1' if treating it as a '1' helps form a larger group (thus reducing the final expression).
  • An 'X' cell can be treated as a '0' and ignored if including it doesn't help form a larger group.
  • You are never required to group an 'X'. They are purely optional tools to make other groups larger.

Next — Product of Sums (POS) Minimization

9 of 14

Page 10

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

10. Product of Sums (POS) Minimization

K-Maps can also minimize functions into the POS format (AND of ORs).

10.1 Differences from SOP Minimization

  • Instead of grouping the 1s, we plot and group the 0s (which represent the Maxterms).
  • When extracting the expression for a group, the rule for variables is inverted:
    - If a variable is constant '0', write it uncomplemented (e.g.,
    AA).
    - If a variable is constant '1', write it complemented (e.g.,
    AA').
  • The extracted term is a sum (e.g., (A+B+C)(A + B' + C)).
  • The final expression is the product (AND) of these sum terms.

A hardware circuit built from a minimized SOP expression uses an AND-OR layout (or purely NAND-NAND). A POS expression uses an OR-AND layout (or purely NOR-NOR).

Next — 5-Variable K-Map

10 of 14

Page 11

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

11. 5-Variable K-Map

For n=5n=5 variables (A, B, C, D, E), a single 2D map becomes visually confusing. We require 25=322^5 = 32 cells.

11.1 The 3D Layer Approach

A 5-variable map is drawn as two separate 4-variable maps (each 16 cells).

  • Map 1: Corresponds to A=0A = 0. Represents minterms m0m_0 to m15m_{15}.
  • Map 2: Corresponds to A=1A = 1. Represents minterms m16m_{16} to m31m_{31}.

11.2 Grouping across Maps

Imagine Map 1 is a transparent sheet of glass lying exactly on top of Map 2. You can form 3D groups! A cell in Map 1 is considered adjacent to the exact corresponding cell in Map 2.

If a '1' at m0m_0 in Map 1 is grouped with a '1' at m16m_{16} in Map 2, the variable A changes state (from 0 to 1) and is eliminated from that term.

Next — Quine-McCluskey Method Introduction

11 of 14

Page 12

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

12. Quine-McCluskey (Tabular) Method

K-Maps become practically impossible for humans to use when n6n \ge 6. The Quine-McCluskey method is an algorithmic, tabular approach that can handle any number of variables and is easily programmed into computers.

12.1 Phase 1: Finding Prime Implicants

  • 1. List all given minterms and convert them to binary.
  • 2. Group the minterms by the number of 1s in their binary representation (Index groups).
  • 3. Compare each term in Group ii with every term in Group i+1i+1. If they differ by exactly one bit, combine them by replacing the differing bit with a dash '-'. (e.g., `0100` and `0101` become `010-`). Place a checkmark next to the terms that combined.
  • 4. Repeat this matching process on the new dashed terms until no further combinations are possible.
  • 5. Any term left without a checkmark is a Prime Implicant.

Next — Quine-McCluskey Phase 2

12 of 14

Page 13

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

13. Quine-McCluskey: The Prime Implicant Chart

13.1 Phase 2: Selecting Essential Prime Implicants

Phase 1 generates all Prime Implicants, but we usually don't need all of them to cover the function.

  • 1. Create a table. The rows are the Prime Implicants found in Phase 1. The columns are all the original given minterms.
  • 2. Place an 'X' in the cell if a Prime Implicant covers a specific minterm.
  • 3. Look for columns that have exactly one 'X'. The Prime Implicant corresponding to that row is an Essential Prime Implicant (EPI).
  • 4. Add the EPI to your final equation. Cross out that row, and cross out all columns (minterms) that this EPI covers.
  • 5. If there are remaining uncovered minterms, select the minimum number of remaining Prime Implicants needed to cover them (using Petrick's Method if necessary).

Next — Summary & Review Checklist

13 of 14

Page 14

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 2

14. Summary & Review Checklist

Mastery of K-Maps is non-negotiable for passing Digital Logic Design.

14.1 University Exam Checklist

  • Convert a given Boolean function into Canonical SOP and Canonical POS form.
  • Minimize a 4-variable function using a K-Map. e.g., F(A,B,C,D)=Σm(0,1,2,4,5,6,8,9,12,13,14)F(A,B,C,D) = \Sigma m(0,1,2,4,5,6,8,9,12,13,14).
  • Minimize a function containing Don't Care conditions.
  • Define Prime Implicant and Essential Prime Implicant. Identify them on a drawn K-Map.
  • Use the Quine-McCluskey Tabular method to minimize a 4 or 5 variable function.

14.2 Common Mistakes to Avoid

  • Forgetting to use Gray code `00, 01, 11, 10` on the K-Map axes.
  • Forgetting map rolling (the four corners form a valid group of 4, the top row and bottom row form adjacent groups).
  • Grouping 6 cells (only powers of 2 are allowed!).
  • Including redundant groups. Always stop grouping when all '1's are covered.

14 of 14

Continue in this subject