Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 15 — CS 2603 Applied Logic for Hardware and Software

Similar presentations


Presentation on theme: "Lecture 15 — CS 2603 Applied Logic for Hardware and Software"— Presentation transcript:

1 Lecture 15 — CS 2603 Applied Logic for Hardware and Software
CS Applied Logic, University of Oklahoma 1/17/2019 Lecture 15 — CS 2603 Applied Logic for Hardware and Software Circuit Minimization using Karnaugh maps CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

2 Boolean Functions new name for same old animal
Boolean function — a special kind of predicate Domain of discourse: tuples of {True, False} values Boolean functions  truth tables F(a, b) — two-variable Boolean function Domain of discourse: pairs of Boolean values Specifies a Boolean output for each pair of Boolean inputs Representations we’ve already seen for 2-var Boolean functions Truth table with four rows (unique: one per Boolean function) Propositional WFF with two variables (not a unique rep'n) Combinational circuit with two input lines, one output line F(a, b, c) — three-variable Boolean function Domain of discourse: triples of Boolean values 8-row truth table, 3-variable WFF, 3-input/1-output circuit F(x1, x2, … xn) — n-variable Boolean function Domain of discourse: n-tuples of Boolean values 2n-line truth table, n-variable WFF, n-input/1-output circuit CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

3 Example truth-table for 3-variable Boolean function
y z F(x,y,z) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

4 Sum-of-Products Representation constructing a WFF for Boolean function F(x1, x2, … xn)
Focus on places in truth-table where F is True Boolean tuple (b1, b2, … bn), with F(b1, b2, … bn) =True That is, (k. (xk = bk))  (F(x1, x2, … xn) = True) Find a propositional WFF whose value is (k. (xk = bk)) WFF w, variables x1, x2, … xn , value of w = (k. (xk = bk)) That is, w =True if (k. (xk = bk)) =True w = False if (k. (xk = bk)) = False w = (y1  y2  …  yn) = (k. (xk = bk)) yk = xk if bk = True yk = xk if bk = False known as a “minterm” Minterms are usually written in EE notation For example: x1 x2 x3, when b1=1, b2=0, b3=1 A WFF for F(x1, x2, … xn) F(x1, x2, … xn) = w1 + w2 +  wm — each wk is a minterm m = number of 1’s in last column of truth table sum of products CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

5 Example sum-of-products representation for 3-variable function
Truth table representation of a Boolean function F 1 minterm F(x,y,z) z y x Example copied from Shaaban: CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

6 Example sum-of-products representation for 3-variable function
Truth table representation of a Boolean function F 1 x y z minterm F(x,y,z) z y x Example copied from Shaaban: CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

7 Example sum-of-products representation for 3-variable function
Truth table representation of a Boolean function F 1 x y z minterm F(x,y,z) z y x Example copied from Shaaban: CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

8 Example sum-of-products representation for 3-variable function
Truth table representation of a Boolean function F 1 x y z minterm F(x,y,z) z y x Example copied from Shaaban: CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

9 Example sum-of-products representation for 3-variable function
Truth table representation of a Boolean function F sum-of-products representation of F x y z 1 minterm F(x,y,z) z y x Example copied from Shaaban: CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

10 Example sum-of-products representation for 3-variable function
Truth table representation of a Boolean function F sum-of-products representation of F x y z 1 minterm F(x,y,z) z y x F(x,y,z) = x y z + x y z + x y z + x y z Example copied from Shaaban: CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

11 3-Variable Karnaugh Map another representation for 3-variable function
Truth table representation of a Boolean function F sum-of-products representation of F x y z 1 minterm F(x,y,z) z y x F(x,y,z) = x y z + x y z + x y z + x y z Karnaugh-map representation of F Example copied from Shaaban: table-based form of truth table CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

12 3-Variable Karnaugh Map another representation for 3-variable function
Truth table representation of a Boolean function F sum-of-products representation of F x y z 1 minterm F(x,y,z) z y x F(x,y,z) = x y z + x y z + x y z + x y z Karnaugh-map representation of F Example copied from Shaaban: z = 1 x = 1 1 y = 1 z xy Gray-code arrangement CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

13 Karnaugh-Map Minimization Method 3-variable example
CS Applied Logic, University of Oklahoma 1/17/2019 Karnaugh-Map Minimization Method 3-variable example sum-of-products representation of F Karnaugh-map representation of F z = 1 x = 1 1 y = 1 z xy F(x,y,z) = x y z + x y z + x y z + x y z x y z = x y z + x z + y z minimized x y z + x y z = y z (x + x) = y z wrap-around x y z + x y z = x z Example copied from Shaaban: Karnaugh-map minimization method Group together the maximal, contiguous, rectangular regions with 2k adjacent cells containing True (1) values There is one minterm per cell, so 2k minterms in all for the group Gray-code ordering arranges it so that (n – k) variables have identical form throughout the group (xj in all terms of group or xj in all of them) Use the distributive law to factor the 2k minterms into this form: w = (v1 + v1)(v2 + v2) … (vk + vk) vk+1 vk+2 … vn = vk+1 vk+2 … vn Possible because Gray-code ordering puts the other k variables through all possible combinations CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

14 4-Variable Karnaugh-Map Example
00 01 11 10 c = 1 b a d c a = 1 1 d = 1 F(a,b,c,d) = a b c d + a b c d = a d + a b c + b c d + a b c Example copied from Shaaban: Use the distributive law to factor the 2k minterms into this form: w = (v1 + v1)(v2 + v2) … (vk + vk) vk+1 vk+2 … vn Group together the maximal, contiguous, rectangular regions with 2k adjacent cells containing True (1) values There is one minterm per cell, so 2k minterms in all for group Possible because Gray-code ordering puts the other k variables through all possible combinations Gray-code ordering arranges it so that (n – k) variables have identical form throughout the group (xj in all terms of group or xj in all of them) wrap-around CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

15 Another 4-Variable Example
00 01 11 10 c = 1 b a d c a = 1 1 d = 1 F(a,b,c,d) = a b c d + a b c d = a d + a b + b c d + a c Use the distributive law to factor the 2k minterms into this form: w = (v1 + v1)(v2 + v2) … (vk + vk) vk+1 vk+2 … vn Group together the maximal, contiguous, rectangular regions with 2k adjacent cells containing True (1) values There is one minterm per cell, so 2k minterms in all for group Possible because Gray-code ordering puts the other k variables through all possible combinations Gray-code ordering arranges it so that (n – k) variables have identical form throughout the group (xj in all terms of group or xj in all of them) wrap-around CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

16 Don’t Cares F(a,b,c,d) = a b c d + a b c d = b d + a b
00 01 11 10 c = 1 b a d c a = 1 1 d = 1 F(a,b,c,d) = a b c d + a b c d = b d + a b either 1 or 0 ok + a d Use the distributive law to factor the 2k minterms into this form: w = (v1 + v1)(v2 + v2) … (vk + vk) vk+1 vk+2 … vn Group together the maximal, contiguous, rectangular regions with 2k adjacent cells containing True (1) values There is one minterm per cell, so 2k minterms in all for group Possible because Gray-code ordering puts the other k variables through all possible combinations Gray-code ordering arranges it so that (n – k) variables have identical form throughout the group (xj in all terms of group or xj in all of them) Use don’t-cares to make groups bigger reduces number of minterms and/or literals Leave isolated don’t-cares alone no point in adding minterms unnecessarily CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

17 2-Variable Karnaugh-Map Example
 operation b a 1 a = 1 b = 1 F(a,b) = a b + a b + a b = a + b Example copied from Shaaban: Karnaugh-map minimization method Group together the maximal, contiguous, rectangular regions with 2k adjacent cells containing True (1) values There is one minterm per cell, so 2k minterms in all for the group Gray-code ordering arranges it so that (n – k) variables have identical form throughout the group (xj in all terms of group or xj in all of them) Use the distributive law to factor the 2k minterms into this form: w = (v1 + v1)(v2 + v2) … (vk + vk) vk+1 vk+2 … vn Possible because Gray-code ordering puts the other k variables through all possible combinations CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

18 Karnaugh-Map Minimization some observations
Each disjoint group containing 2k cells Reduces number of minterms by 2k - 1 Reduces number of literals in those minterms to n – k Overlapping group Reduces number of literals in some minterms But not necessarily the the number of minterms Method produces "minimal" circuit if Minimum number of maximal groups covers 1s in diagram Then: minimum number of minterms And: minimum number of literals in minterms Not unique … could be several ways to choose groups Karnaugh maps mostly used for learning Designing small digital circuits Circuit design tools do minimization for large circuits Quine-McClusky algorithm implements Karnaugh method Invented by Maurice Karnaugh at Bell Labs in early 1950s CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma

19 CS2603 - Applied Logic, University of Oklahoma
1/17/2019 The End CS2603 Applied Logic for Hardware and Software Rex Page – University of Oklahoma


Download ppt "Lecture 15 — CS 2603 Applied Logic for Hardware and Software"

Similar presentations


Ads by Google