EECS 465: Digital Systems Lecture Notes # 2

Slides:



Advertisements
Similar presentations
K-Map Simplification COE 202 Digital Logic Design Dr. Aiman El-Maleh
Advertisements

Based on slides by: Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 8 – Systematic Simplification.
CS 140 Lecture 4 Professor CK Cheng Tuesday 5/08/02.
Give qualifications of instructors: DAP
CS 140 Lecture 4 Combinational Logic: K-Map Professor CK Cheng CSE Dept. UC San Diego 1.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
EECS 465: Digital Systems Lecture Notes # 2
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
1 Chapter 5 Karnaugh Maps Mei Yang ECG Logic Design 1.
Department of Computer Engineering
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. K-Map (1)  Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.
Optimization Algorithm
Examples. Examples (1/11)  Example #1: f(A,B,C,D) =  m(2,3,4,5,7,8,10,13,15) Fill in the 1’s. 1 1 C A B CD AB D 1 1.
Computer Engineering (Logic Circuits) (Karnaugh Map)
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
1 Example: Groupings on 3-Variable K-Maps BC F(A,B,C) = A ’ B ’ A BC F(A,B,C) = B ’ A
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 4: Cost of Logic Circuits and Karnaugh Maps José Nelson Amaral.
Karnaugh Maps (K maps).
CEC 220 Digital Circuit Design More Karnaugh Maps Monday, February 02 CEC 220 Digital Circuit Design Slide 1 of 11.
Lecture 4: Four Input K-Maps CSE 140: Components and Design Techniques for Digital Systems CK Cheng Dept. of Computer Science and Engineering University.
CEC 220 Digital Circuit Design Implicants Wed, Sept. 23 CEC 220 Digital Circuit Design Slide 1 of 10.
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
1 EENG 2710 Chapter 3 Simplification of Switching Functions.
EECS 465: Digital Systems Design Lecture Notes
CHAPTER 3 Simplification of Boolean Functions
Lecture 3: Incompletely Specified Functions and K Maps
ELEC Digital Logic Circuits Fall 2014 Logic Minimization (Chapter 3)
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Computer Organisation
Lecture #6 EGR 277 – Digital Logic
EECS 465: Digital Systems Design Lecture Notes #3
CS 352 Introduction to Logic Design
CSCE 211: Digital Logic Design
Optimized Implementation of Logic Function
CSE 140 : Components and Design Techniques for Digital Systems
ECE 331 – Digital System Design
Digital Logic and Design
Lecture 3: Incompletely Specified Functions and K Maps
CSCE 211: Digital Logic Design
EECS 465: Digital Systems Lecture Notes # 2
Optimized Implementation of Logic Function
CSCE 211: Digital Logic Design
CSCE 211: Digital Logic Design
BASIC & COMBINATIONAL LOGIC CIRCUIT
CSCE 211: Digital Logic Design
Instructor: Alexander Stoytchev
ECE 331 – Digital System Design
Digital Logic & Design Dr. Waseem Ikram Lecture 12.
Digital Logic & Design Dr. Waseem Ikram Lecture 13.
CHAPTER 5 KARNAUGH MAPS 5.1 Minimum Forms of Switching Functions
CH7 Multilevel Gate Network
Optimization Algorithm
Karnaugh Maps Introduction Venn Diagrams 2-variable K-maps
Chapter 3 Gate-level Minimization.
EECS 465: Digital Systems Design Lecture Notes #3
Optimized Implementation of Logic Function
CSCE 211: Digital Logic Design
COE 202: Digital Logic Design Combinational Logic Part 3
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Overview Part 2 – Circuit Optimization
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
Instructor: Alexander Stoytchev
CSE 140 Lecture 4 Combinational Logic: K-Map
CSCE 211: Digital Logic Design
Laws & Rules of Boolean Algebra
ECE 331 – Digital System Design
Presentation transcript:

EECS 465: Digital Systems Lecture Notes # 2 Two-Level Minimization Using Karnaugh Maps SHANTANU DUTT Department of Electrical & Computer Engineering University of Illinois, Chicago Phone: (312) 355-1314: e-mail: dutt@ece.uic.edu URL: http://www.ece.uic.edu/~dutt

Karnaugh-Map Based 2-Level Minimization Defn. An SOP or POS expression is also called a 2-level expression. Defn. A 2-level AND-OR (OR-AND) gate realization of an SOP (POS) expression is one in which all product terms (OR terms in POS) in the SOP (POS) expression are implemented by multiple input AND (OR) gates & the ORing (ANDing) of the product (OR) terms is realized by a multiple input OR (AND) gate.

3 E.g. f1 = AB + BC + ACD --- 2-level. (SOP) f2 = ( B+C )( A+D )( C+D ) --- 2-level (POS) f3 =AB + AC( B+D ) --- not SOP or POS level 1 I/Ps --- not 2-level --- 3 level ( can be realized directly by 3 levels of gates) A B A f3 C B level 2 I/Ps D level 2 gates level 3 gate level 0 I/Ps level 1 gates

4 A AB + BC + ACD B f1 B C A C Level 2 D Level 1 B (B + C)(A + D)(C + D) C f2 A D C D

5 Defn. A gate in a logic circuit is a level-1 gate if all its inputs are primary inputs (i.e., literals, A, A, B, B, etc.) A gate is a level-i gate i >1 if the highest-level gate whose output feeds the (level-i) gate is a level-(i-1) gate. NOTE: If a given expr. is not 2-level, we can convert it to a 2-level one using the distributive law. The goal of 2-level minimization is to minimize the number of literals in a 2-level logic expr.. This reduces the total # of inputs (over all gates in the circuit) in a 2-level gate realization.

6 E.g. f = ABC + ABC + ABC (non-minimized 9 literals) A B (12 gate I/Ps) = Circuit complexity C A f B C A B C f = AB + AC (minimized 4 literals) A f B (6 gate I/Ps) = Circuit complexity A C

7 Multilevel Minimization (Example): f = x1x2x3 + x2x3x4 + x1x5 + x4x5 (2-level minimized) Apply distributive law (factoring) f = x2x3(x1 + x4) + x5(x1 + x4) = (x2x3 + x5)(x1 + x4) -- Multilevel expr. Gate Impl.: x2 x3 f x5 Multilevel circuit x1 x4

8 Defn. Two implicants (or product terms) of a function f are said to be adjacent (logically) if they are exactly the same in all except one variable xi which occurs in uncomplemented form (xi) in one implicant and in complemented form (xi) in the other. The 2 implicants are said to differ in xi. E.g. ABC, ABC (adjacent implicants, differ in B) ABD, ABC (not adjacent) NOTE: Adjacent implicants can be combined into one implicant by the combining theorem (ABC + ABC = AC)

Another ordering of inputs ( Gray-code ordering) A B Z1 0 0 0 0 1 1 9 Karnaugh Maps 2-variable TT outputs A B Z1 Z2 Binary place-value ordering (Binary ordering) 0 0 0 0 Physically adjacent but not logically adjacent. 0 1 1 1 1 0 0 1 1 1 1 0 logically adjacent but not physically adjacent AB + AB B Another ordering of inputs ( Gray-code ordering) A B Z1 0 0 0 0 1 1 1 1 1 1 0 0 Z1 = B Physically as well as logically adjacent.

n-variable Gray-code ordering 10 n-variable Gray-code ordering Defn. Gi = i-bit Gray-code ordering rev(Gi) = reverse order of Gi Gn = 0 Gn-1 1 rev(Gn-1) G1 = 0 Base. 1 G2 = 0 G1 1 rev(G1) 0 0 0 1 1 1 1 0 A B C 0 0 0 0 0 1 0 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 0 = G3 = 0 G2 1 rev(G2) = Convert to a 2-dimensional Gray-code ordered TT AB x 110 C 00 01 11 10 y 1 Throw away variable (A) changing across the 2 squares. We thus obtain BC. 1 1 001

Four Prime Implicants AB, BC, AC, AB formed. Not all these PIs 11 Example ( 3-var. K-Map) Consensus = BC AB Function f: C 00 01 11 10 1 1 1 1 1 1 f = AB + AB + AC + BC Four Prime Implicants AB, BC, AC, AB formed. Not all these PIs are needed in the expression. Only a minimum set that covers all minterms is needed. Defn. A Prime Implicant (PI) of a function f is an implicant of f that is not covered by any other implicant of f. Defn. An Essential PI is a PI that covers/includes at least one minterm that is not covered by any other PI.

In the above example, AB & AB are essential PIs. These will need 12 In the above example, AB & AB are essential PIs. These will need to be present in any SOP expr. of the function. To form a minimal set, the PI BC can be used. Thus f = AB + AB + BC is a minimized expression. Larger than 2-minterm PIs can also exist: AB AB E.g., C 00 01 11 10 C 00 01 11 10 1 1 1 1 1 1 1 1 AB AB B C B 2-minterm implicants (AB, AB in the 1st example above) can be merged if they are logically adjacent to form a 4-minterm implicant and so on.

When an implicant can not be “grown” any further, then it is a PI. 13 When an implicant can not be “grown” any further, then it is a PI. Defn. In a K-map, 2 implicants can be logically adjacent if they are symmetric, i.e., if : (1) They are disjoint (no common minterms). (2) They cover the same # of minterms. (3) Each minterm in one implicant is adjacent to a unique minterm in the other implicant. AB More Examples: Both PIs (A, BC) are essential. C 00 01 11 10 AB Redrawn 1 C 00 01 11 10 1 1 1 1 1 1 1 1 1 1 1 Not symmetric Thus, f = A + BC is minimized. Symmetric ( logically adjacent) 2-minterm implicants : Can be “merged” to form a 4-minterm implicant, which will be a PI.

14 4-variable K-Map: AB CD 00 01 11 10 00 01 11 10

Instead of starting with 2-minterm implicants & growing them, you 15 Example: f = AC + D Instead of starting with 2-minterm implicants & growing them, you can form larger implicants directly by grouping power of 2 (2, 4, 8, etc.) # of minterms so as to form a rectangle or square ( a convex region). AB CD 00 01 11 10 00 1 1 1 1 1 1 01 AC 11 10 1 1 1 1 Convex D Concave AB CD 00 01 11 10 Invalid grouping (region formed is concave) f = AB + AC + BCD 00 01 11 10 1 1 1 1 Valid groupings 1 1 1 1

16 Another Example: AB CD BD ABD C f = C + BD + ABD TT: 00 01 11 10 00 01 11 10 A B C D Z 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1 00 01 1 1 ABD 1 C 11 10 1 1 1 1 Binary order 1 1 1 1 f = C + BD + ABD

Many times certain input combinations are invalid for a function 17 Don’t Cares in K-Maps Many times certain input combinations are invalid for a function (E.g. BCD to 7-segment display functions; see pp. 212-214 in Katz text ) For such combinations, we do not care what the output is, and we put an ‘x’ in the o/p column for the TT AB CD 00 01 11 10 A B C f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 x 1 0 0 0 1 0 1 1 1 1 0 x 1 1 1 x 1 x x 1 0 0 1 1 0 f = BC + AB by considering all x’s as 0s f = B The x’s can, however, be profitably used to make larger PIs & thus further simplify the function. by selectively considering the 010 cell’s x as 1

In a K-map, the ‘x’s can be profitably used to form larger implicants (which have fewer literals) 18 However, when we need to form a minimal PI cover, we need to worry only about covering the minterms ( the 1s), and not the Xs. • Thus as far as x’s are concerned, we can have the cake and eat it too! Example: f(A,B,C,D) = m(1,3,5,7,9) + d(2,6,12,13) MSBs AB A B C D 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 CD 00 01 11 10 0 4 12 x 8 1 1 5 1 13 x 9 1 3 1 7 1 15 11 2 x 6 x 14 10 00 01 LSBs CD 11 10 AD f = CD + AD or CD + AC If input comb. 2,6 occur o/p are 0. AC If inputs 2,6 occur o/p = 1.

STEPS IN K-MAP MINIMIZATION (sop EXPR.) 19 STEPS IN K-MAP MINIMIZATION (sop EXPR.) STEP1: Form all PIs by including the Xs with the 1s to form larger PIs. (Do not form PIs covering only Xs !) STEP2: Identify all essential PIs by visiting each minterm (1s) & checking if it is covered by only one PI. If so, then that PI is an essential PI. STEP3: Identify all 1s not covered by essential PIs. Select a minimal set of PIs S to cover them. This requires some trial-and error. STEP4: Minimal SOP Expr. for function f: f = essential PIs + Pi Pi S PI Pi is in set S

Minimal POS Expr. from a K-Map : 20 METHOD 1: Obtain minimal SOP expression for the complement function f, and complement this SOP expression to get a minimal POS expr. for f (using De-Morgan’s Law) Big M notation Example: F (A,B,C,D) = M(0,2,4,8,10,11,14,15) D(6,12,13) Xs of F 0s of F AB F F AB CD CD 00 01 11 10 D 0 0 x 0 1 1 x 1 00 01 11 10 1 1 x 1 0 0 x 0 0 0 1 1 1 x 1 1 00 01 11 10 Complement 0 4 12 8 1 5 13 9 3 1 7 1 15 0 11 0 2 0 6 x 14 0 10 0 AC F =D + AC F = D + AC = D(A +C)

METHOD2 : Direct Method : 21 (1) Obtain all prime implicates(PTs) (largest groups of 0s & Xs of size 2 , i 0, forming a convex region, that can not be “grown” any further). (2) Identify all essential PTs (those that cover at least one 0 not covered by any other PT). (3) Choose a minimal set T of PTs to cover the 0s not covered by the set of essential PTs. (4) The expression for a PT is an OR term obtained by discarding all changing variables, & keeping variables complemented if they are constant at 1 or uncomplemented if they are constant at 0 & taking the OR (sum) of these literals. (5) Minimal POS Expr.: f = (essential PTs) qi qi T

Example: (Direct Method) 22 Example: (Direct Method) AB (OR terms) CD 00 01 11 10 0 0 x 0 1 1 x 1 1 1 0 0 0 x 0 0 00 01 11 10 Prime Implicate ( Groups of 0s that cannot be grown any further) Both D and A + C are Essential Prime Implicates. D (A + C) F = D( A + C ) ( Product of Prime Implicates )

5-variable K-map: f(A,B,C,D,E)---Juxtapose two 4-var. K-submaps 23 5-variable K-map: f(A,B,C,D,E)---Juxtapose two 4-var. K-submaps one for the MSB A=0 and the other for A=1: BC BC 00 01 11 10 DE DE 00 01 11 10 00 01 11 10 00 01 11 10 0 4 12 8 1 5 13 9 3 7 15 11 2 6 14 10 16 20 28 24 17 21 29 25 19 23 31 27 18 22 30 26 A=0 A=1 4-var. K-submap 4-var. K-submap Adjacencies of a square: Adjacent squares of the 4-var. K-submap plus the “corresponding” or “mirror” square in the other 4-var. K-submap. Example: BC BC DE 00 01 11 10 DE 00 01 11 10 00 01 11 10 00 01 11 10 16 20 28 x 24 17 21 29 1 25 19 x 23 1 31 x 27 18 22 1 30 1 26 0 1 4 12 1 8 1 5 13 1 9 3 1 7 1 15 x 11 2 6 14 x 10 A=0 A=1

6-variable K-map: f(A,B,C,D,E,F)--Juxtapose two 5-var. K-submaps 24 6-variable K-map: f(A,B,C,D,E,F)--Juxtapose two 5-var. K-submaps one for the MSB A=0 and other for A=1 CD CD EF 00 01 11 10 EF 00 01 11 10 00 01 11 10 00 01 11 10 0 4 12 8 1 5 13 9 3 7 15 11 2 6 14 10 16 20 28 24 17 21 29 25 19 23 31 27 18 22 30 26 5-var. K-submap A=0 B=0 B=1 CD CD EF 00 01 11 10 00 01 11 10 EF 00 01 11 10 00 01 11 10 32 36 44 40 33 37 45 41 35 39 47 43 34 38 46 42 48 52 60 56 49 53 61 57 51 55 63 59 50 54 62 58 5-var. K-submap A=1 B=1 B=0 Adjacencies of a square: Adjacent squares of the 5-var. K-submap plus the “corresponding” or “mirror” square in the other 5-var. K-submap.

6-variable K-map: f(A,B,C,D,E,F,)---Example: 25 6-variable K-map: f(A,B,C,D,E,F,)---Example: CD CD EF 00 01 11 10 EF 00 01 11 10 00 01 11 10 00 01 11 10 0 4 12 8 1 5 13 9 3 7 15 11 2 6 14 10 16 20 28 24 17 21 29 25 19 23 31 27 18 22 30 26 A=0 B=0 B=1 CD CD EF 00 01 11 10 00 01 11 10 EF 00 01 11 10 00 01 11 10 32 36 44 40 33 37 45 41 35 39 47 43 34 38 46 42 48 52 60 56 49 53 61 57 51 55 63 59 50 54 62 58 A=1 B=1 B=0