Download presentation
Presentation is loading. Please wait.
1
CS 352 Introduction to Logic Design
Lecture 3 Ahmed Ezzat Karnaugh Maps and Quine-McCluskey Method Ch-5 + Ch-6
2
Outline Minimum Forms of Switching Functions
2- and 3- Variable Karnaugh Maps 4- Variable Karnaugh Maps Determination of Minimum Expression Using Essential Prime Implicants 5-Variable Karnaugh Maps Other Uses of Karnaugh Maps Other Forms of Karnaugh Maps Quine-McClusky Method: Determination of Prime Implicants Quine-McClusky Method: The Prime Implicant Chart Petrick’s Method Simplification of Incompletely Specified Functions CS-352 Ahmed Ezzat
3
Minimum Forms of Switching Functions (1)
The cost of realizing a switching function is directly related to the number of gates and gate inputs used. Karnaugh map is a technique to lead to minimum cost two-level circuits composed of AND and OR gates: Sum-of-products terms corresponds to group of AND gates feeding into a single OR gate. Product-of-sums terms corresponds to group of OR gates feeding into a single AND gate. To find minimum cost two-level AND-OR gate, we must find minimum expression in sum-of-products or minimum product-of-sums. Switching functions can be simplified by using algebraic techniques, but The procedures are difficult to apply systematically It is hard to tell if you have a minimum solution CS-352 Ahmed Ezzat
4
Minimum Forms of Switching Functions (2)
A MINIMUM SUM-OF-PRODUCTS expression for a function has: a minimum number of product terms (minimum # of gates) of all expressions with same number of terms, has a minimum number of literals (minimum number of gate inputs) Minimum sum-of-products in not unique A MINIMUM PRODUCT-OF-SUMS expression for a function has: a minimum number of factors of all expressions with same number of factors, has a minimum number of literals CS-352 Ahmed Ezzat
5
Minimum Forms of Switching Functions (3)
The above minimums correspond directly to a two-level gate network that has: a minimum number of gates a minimum number of gate inputs Given minterm expression, the minimum sum-of-products form can be obtained as follows: Combine term using: XY’ + XY = X (one given term can be used more than once (X + X = X)) Eliminate redundant terms using the consensus theorem (XY + X’Z YZ is consensus term) and others. Unfortunately, the result will depend on the order of combination and elimination final expression is not necessarily minimum. CS-352 Ahmed Ezzat
6
Minimum Forms of Switching Functions (4)
F = a’b’c’ + a’b’c + a’bc’ + ab’c + abc’ + abc = a’b’ b’c bc’ ab F = a’b’c’ + a’b’c + a’bc’ + ab’c + abc’ + abc = a’b’ bc’ ac CS-352 Ahmed Ezzat
7
2- and 3- Variable Karnaugh Maps (1)
F = sum m(0, 1) Karnaugh map is like truth table - each square of the map specifies the value of the function for every combination of values of the independent variables (A, B). CS-352 Ahmed Ezzat
8
2- and 3- Variable Karnaugh Maps (2)
Each 1 on the map corresponds to a minterm of F. F = sum m(0, 1) truth table Minterm in adjacent squares of the map can be combined since they differ in only one variable! This is indicated on the map by looping the corresponding 1’s. CS-352 Ahmed Ezzat
9
2- and 3- Variable Karnaugh Maps (3)
3-variables: CS-352 Ahmed Ezzat
10
2- and 3- Variable Karnaugh Maps (4)
3-variables (Contd.): CS-352 Ahmed Ezzat
11
2- and 3- Variable Karnaugh Maps (5)
3-variables (Contd.): Karnaugh Map of F(a, b, c)= = Σ m(1, 3, 5) = П M(0, 2, 4, 6, 7) CS-352 Ahmed Ezzat
12
2- and 3- Variable Karnaugh Maps (6)
Plotting product terms using Karnaugh maps: CS-352 Ahmed Ezzat
13
2- and 3- Variable Karnaugh Maps (7)
Minterms and Simplified Form of F: CS-352 Ahmed Ezzat
14
2- and 3- Variable Karnaugh Maps (8)
Simplified Form of F Using Consensus Theorem: Consensus Theorem: XY + X’Z + YZ = XY + X’Z CS-352 Ahmed Ezzat
15
2- and 3- Variable Karnaugh Maps (9)
Multiple minimum sum-of-products forms: CS-352 Ahmed Ezzat
16
4- Variable Karnaugh Maps (1)
Location of Minterms on 4-variable Karnaugh Map Plot of F = acd + a’b + d’ CS-352 Ahmed Ezzat
17
4- Variable Karnaugh Maps (2)
Simplification of 4-variable Functions: CS-352 Ahmed Ezzat
18
4- Variable Karnaugh Maps (3)
Simplification of 4-variable Incompletely Specified Function: CS-352 Ahmed Ezzat
19
4- Variable Karnaugh Maps (4)
Using Karnaugh Maps to find product-of-sums for F = x’z’ + wyz + w’y’z’ + x’y Find F’ from the 0’s F’ = y’z + wxz’ + w’xy Convert sum-of-products into product-of-sums: F = (F’)’ = (y + z’)(w’ + x’ + z)(w + x’ + y’) Wxz’ Y’z W’xy CS-352 Ahmed Ezzat
20
Determination of Minimum Expression Using Essential Prime Implicants (1)
Implicant of F: is a product term or terms equal to 1. Prime Implicant of F: is an implicant or implicants that cannot be combined with another term(s) to eliminate a variable. A single 1 on a map represents a prime implicant if it is not adjacent to any other 1’s. CS-352 Ahmed Ezzat
21
Determination of Minimum Expression Using Essential Prime Implicants (2)
All prime implicants of a function can be obtained from the Karnaugh map. The minimum sum-of-products expression for a function consists of some (but not necessarily all) of the prime implicants of a function – this implies sum-of-products containing a term which is not a prime implicant cannot be minimum. To find minimum sum-of-products from a map, we must find a minimum number of prime implicants which cover all of the 1’s on the map. CS-352 Ahmed Ezzat
22
Determination of Minimum Expression Using Essential Prime Implicants (3)
The map shown has 6 prime implicants. Three cover all of the 1’s on the map minimum sum-of-products is the sum of these 3 prime implicants. CS-352 Ahmed Ezzat
23
Determination of Minimum Expression Using Essential Prime Implicants (4)
For more complicated maps (many variables), we need a systematic approach for finding the essential prime implicants for minimum sum-of-products. CS-352 Ahmed Ezzat
24
5-Variable Karnaugh Maps
A 5-variable map can be constructed by placing one four-variable map on top of a 2nd one. Bottom layer is numbered 0 15 Top layer is numbered 16 31 2 terms in the same square separated by a diagonal differs only in one variable and can be combined Terms 0, 20 can’t be combined Each term is adjacent to 5 terms; 4 in same layer and 1 in the other layer CS-352 Ahmed Ezzat
25
Other Uses of Karnaugh Maps
Many operations that can be performed using a truth table or algebraically can be done using a Karnaugh map. Determination of minterm and maxterm expansions Proof that two functions are equal (same maps) ANDing and ORing two functions by performing the function on the corresponding positions on their maps etc. CS-352 Ahmed Ezzat
26
Other Forms of Karnaugh Maps
Instead of labeling sides with 0’s and 1’s, some prefer to use labels as shown below (A means A =1). CS-352 Ahmed Ezzat
27
Quine-McCluskey Method
The Quine-McCluskey method provides a systematic simplification procedure for large number of variables that can be programmed for a digital computer. The method reduces the minterm expansion (sum-of-products form) of a function to obtain a minimum sum-of-products. There are two steps: Eliminate as many literals as possible by applying XY+XY' = X. Resulting terms are prime implicants. Use a prime implicant chart to select a minimum set of prime implicants. CS-352 Ahmed Ezzat
28
Quine-McCluskey Method: Determination of Prime Implicants (1)
Function must be given in sum of minterms form. Minterms are combined using: XY+XY' = X A B 'C D' + A B 'C D = A B'C = (dash indicates a missing variable) |_____| |____| |____| X Y X Y ' X CS-352 Ahmed Ezzat
29
Quine-McCluskey Method: Determination of Prime Implicants (2)
To find prime implicants, all possible pairs of minterms should be compared and combined if possible. To reduce the number of comparisons, binary minterms are sorted in groups according to number of 1's in each term. Terms can be combined if they differ in one variable. Comparing terms in non-adjacent groups or in the same group is unnecessary CS-352 Ahmed Ezzat
30
Quine-McCluskey Method: Determination of Prime Implicants (3)
EXAMPLE: f(a,b,c,d) = sum m(0,1,2,6,8,9,7,14): Terms that have not been checked off because they cannot be combined with other terms are called prime implicants Below is a function that each term has minimum # of literals but # of terms is not minimum F = a’c’d + a’bd + a’bc b’c’ b’d’ cd’ (1,5) (5,7) (6,7) (0,1,8,9) (0,2,8,10) (2,6,10,14) Using Consensus theorem: F = a’bd + b’c’ + cd’ CS-352 Ahmed Ezzat
31
Quine-McCluskey Method: The Prime Implicant Chart (1)
Use prime implicant chart to select a minimum set of prime implicants. Chart is constructed as follows: _ Minterms are placed across top _ Prime implicants listed down the side _ X placed at intersections if prime implicant covers minterm _ If Minterm is covered by only one implicant essential prime implicant, and must be included in the minimum sum-of-products. _ From the chart, column that has one X, then corresponding row is essential prime implicant (e.g., b’c’ and cd’) CS-352 Ahmed Ezzat
32
Quine-McCluskey Method: The Prime Implicant Chart (2)
Each time a prime implicant is selected for inclusion in the minimum sum, the corresponding row is crossed out. The columns which correspond to all minterms covered by that prime implicant should also be crossed out. A minimum set of prime implicants must be selected to cover the remaining columns, i.e., a’bd (covers the remaining two columns). F = b’c’ + cd’ + a’bd P.S. a’bd is not an essential prime implicant. CS-352 Ahmed Ezzat
33
Quine-McCluskey Method: The Prime Implicant Chart (3)
When there are many non-essential primes to choose from, it may be necessary to try several approaches for covering the X's before a minimum expression can be found. See Cyclic Prime Implicant (a chart that has 2 or more X’s in every column) Chart example on page 160 of text. CS-352 Ahmed Ezzat
34
Petrick’s Method (1) Find all minimum sum-of-products solutions from a prime implicant chart. With large number of variables, the number of prime implicants and the complexity of the chart increase significantly. We will illustrate Petrick’s method using the shown table CS-352 Ahmed Ezzat
35
Petrick’s Method (2) Label rows of the table as P1, P2, P3, etc.
Form a logic function, P, which is true when all of the minterms in the chart have been covered. Let P1 be a logic variable which is true when the prime implicants in row P1 is included in the solution. Column 0 has X’s in rows P1 and P2, we must choose row P1 or P2 to cover the minterm 0 expression (P1 + P2) must be true. Therefore the expression (P1 + P2) must be true. Using same logic with minterm 1 (P1 + P3) must be true. To cover all minterms: P = (P1+P2)(P1+P3)(P2+P4)(P3+P5)(P4+P6)(P5+P6) = 1 CS-352 Ahmed Ezzat
36
Petrick’s Method (3) The P expression means that we must choose row P1 or P2, and row P1 or P3, and row P2 or P4, etc. Next we need to reduce P to a minimum (i.e., reduction using (X+Y)(X+Z) = X + YZ P = (P1+P2P3)(P4+P2P6)(P5+P3P6) … P = P1P4P5 + P1P2P5P6 + P2P3P4P5 + P1P3P4P6 + P2P3P6 This can be read as: in order to cover all minterms, we must choose rows P1 and P4 and P5, or rows P1 and P2 and P5 and P6, etc. Only two solution have minimum number of rows. F1 = a’b’ + bc’ + ac F2 = a’c’ + b’c + ab CS-352 Ahmed Ezzat
37
Simplification of Incompletely Specified Functions (1)
Given an incompletely specified function, the proper assignment of values to the don’t care terms is necessary to obtain a minimum form for the function. Quine-McCluskey method can be modified to find the minimum solution when don’t care terms are present. When finding prime implicants, treat don’t care as required minterms. Extra prime implicants generated will be eliminated later. When forming the prime implicant chart, the don’t care will not be listed at the top, i.e., will not be included in the solution unless they were part of forming a selected prime implicant. CS-352 Ahmed Ezzat
38
Simplification of Incompletely Specified Functions (2)
CS-352 Ahmed Ezzat
39
Simplification of Incompletely Specified Functions (3)
Even though the original function was incompletely specified, the final simplified expression for F defined all combinations of values for A, B, C, D, and is therefore completely specified. F = (m2+m3+m10+m11) + (m3+m7+m11+m15) + (m9+m11+m13+m15) Because m10, m15 appear in F, and m1 does not, this implies that for ABCD=0001 (m1) F=0, for 1010 (m10) F=1, and for 1111 (m15) F=1 CS-352 Ahmed Ezzat
40
END CS-352 Ahmed Ezzat
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.