Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office:

Slides:



Advertisements
Similar presentations
COE 202: Digital Logic Design Combinational Circuits Part 1
Advertisements

K-Map Simplification COE 202 Digital Logic Design Dr. Aiman El-Maleh
Based on slides by: Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 8 – Systematic Simplification.
Gate-level Minimization
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Circuit Optimization Goal: To obtain the simplest implementation for a given function Optimization is a more formal approach to simplification that is.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Give qualifications of instructors: DAP
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 Chapter #2: Two-Level Combinational Logic Section 2.3, Switches and Tools.

Computer Engineering (Logic Circuits) (Karnaugh Map)
بهينه سازي با نقشة کارنو Karnaugh Map. 2  Method of graphically representing the truth table that helps visualize adjacencies 2-variable K-map 3-variable.
EECC341 - Shaaban #1 Lec # 7 Winter Combinational Circuit Minimization Canonical sum and product logic expressions do not provide a circuit.
Simplifying Boolean Expressions Using K-Map Method
IKI a-Simplification of Boolean Functions Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
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
Chapter 3 Gate-Level Minimization
ECE 2110: Introduction to Digital Systems PoS minimization Don’t care conditions.
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.
ECE 3110: Introduction to Digital Systems Symplifying Products of sums using Karnaugh Maps.
Combinational Logic Part 2: Karnaugh maps (quick).
Circuit Minimization. It is often uneconomical to realize a logic directly from the first logic expression that pops into your head. Canonical sum and.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Chapter3: Gate-Level Minimization Part 1 Origionally By Reham S. Al-Majed Imam Muhammad Bin Saud University.
07 KM Page 1 ECEn/CS 224 Karnaugh Maps. 07 KM Page 2 ECEn/CS 224 What are Karnaugh Maps? A simpler way to handle most (but not all) jobs of manipulating.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
CS1Q Computer Systems Lecture 7
Karnaugh Maps (K-Maps)
CS231 Boolean Algebra1 Summary so far So far: – A bunch of Boolean algebra trickery for simplifying expressions and circuits – The algebra guarantees us.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
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
 Seattle Pacific University EE Logic System DesignKMaps-1 Two-Level Simplification All Boolean expressions can be represented in two- level forms.
EE2420 – Digital Logic Summer II 2013 Hassan Salamy Ingram School of Engineering Texas State University Set 5: Karnaugh Maps.
1 Gate Level Minimization EE 208 – Logic Design Chapter 3 Sohaib Majzoub.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Karnaugh Maps (K maps).
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
CE1110: Digital Logic Design Gate Level Minimization Karnaugh Maps (K-Maps)
CHAPTER 6 Quine-McCluskey Method
Lecture 6 Quine-McCluskey Method
CHAPTER 3 Simplification of Boolean Functions
Computer Organisation
CS 352 Introduction to Logic Design
CSCE 211: Digital Logic Design
Optimized Implementation of Logic Function
Lecture 5 Dr. Nermin Hamza.
Digital Logic and Design
Optimized Implementation of Logic Function
CSCE 211: Digital Logic Design
CSCE 211: Digital Logic Design
ECE 331 – Digital System Design
CHAPTER 5 KARNAUGH MAPS 5.1 Minimum Forms of Switching Functions
Chapter 3 Gate-level Minimization.
Optimized Implementation of Logic Function
COE 202: Digital Logic Design Combinational Logic Part 3
Overview Part 2 – Circuit Optimization
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
Karnaugh maps Last time we saw applications of Boolean logic to circuit design. The basic Boolean operations are AND, OR and NOT. These operations can.
CSCE 211: Digital Logic Design
ECE 331 – Digital System Design
Presentation transcript:

Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Objectives Karnaugh Maps (K-Maps) Learn to minimize a function using K-Maps 2-Variables 3-Variables 4-Variables Don’t care conditions Important Definitions 5-Variables K-Maps Ahmad Almulhem, KFUPM 2010

Simplification using Algebra F = X’YZ + X’YZ’ + XZ = X’Y(Z+Z’) + XZ (id 14) = X’Y.1 + XZ (id 7) = X’Y + XZ (id 2) Simplification may mean different things here it means less number of literals

Simplification Revisited Algebraic methods for minimization is limited: No formal steps (id 10 first, then id 4, etc?), need experience. No guarantee that a minimum is reached Easy to make mistakes Karnaugh maps (k-maps) is an alternative convenient way for minimization: A graphical technique Introduced by Maurice Karnaugh in 1953 K-maps for up to 4 variables are straightforward to build Building higher order K-maps (5 or 6 variable) are a bit more cumbersome Simplified expression produced by K-maps are in SOP or POS forms Ahmad Almulhem, KFUPM 2010

Gray Codes (review) Only one bit changes with each number increment Build using recursive reflection To translate a binary value into the corresponding Gray code, each bit is inverted if the next higher bit of the input value is set to one. Ahmad Almulhem, KFUPM 2010 src: wikipedia.org

Truth Table Adjacencies ABF Ahmad Almulhem, KFUPM 2010 These minterms are adjacent in a gray code sense – they differ by only one bit. We can apply XY+XY’=X F = A’B’ + A’B = A’(B’+B) = A’ (1) = A’ ABF Same idea: F = A’B + AB = B Keep common literal only!

K-Map ABF Ahmad Almulhem, KFUPM 2010 A different way to draw a truth table ! Take advantage of adjacency B A A’ B’ 1 A’ B 1 0 A B’ 1 A B B A F = A’B + AB = B Keep common literal only!

Minimization with K-maps 1.Draw a K-map 2.Combine maximum number of 1’s following rules: 1.Only adjacent squares can be combined 2.All 1’s must be covered 3.Covering rectangles must be of size 1,2,4,8, … 2 n 3.Check if all covering are really needed 4.Read off the SOP expression Ahmad Almulhem, KFUPM 2010

2-variable K-map Given a function with 2 variables: F(X,Y), the total number of minterms are equal to 4: m 0, m 1, m 2, m 3 The size of the k-map is always equal to the total number of minterms. X Y m 0 m 1 m 2 m 3 Each entry of the k-map corresponds to one minterm for the function: Row 0 represents: X’Y’, X’Y Row 1 represents: XY’, XY’ Ahmad Almulhem, KFUPM 2010 X Y

Example 1 For a given function F(X,Y) with the following truth table, minimize it using k-maps XYF X Combining all the 1’s in only the adjacent squares The final reduced expression is given by the common literals from the combination: Therefore, since for the combination, Y has different values (0, 1), and X has a fixed value of 1, The reduced function is: F(X,Y) = X Y Ahmad Almulhem, KFUPM 2010

Example 2 Q. Simplify the function F(X,Y) = ∑m(1,2,3) Sol. This function has 2 variables, and three 1-squares (three minterms where function is 1) F = m 1 + m 2 + m 3 X Y X is the common literal Y is the common literal in the adjacent 1- squares Minimized expression: F = X + Y Note: The 1-squares can be combined more than once Ahmad Almulhem, KFUPM 2010

2 variable K-Maps (Adjacency) In an n-variable k-map, each square is adjacent to exactly n other squares Ahmad Almulhem, KFUPM 2010 Q: What if you have 1 in all squares?

3-variable K-maps For 3-variable functions, the k-maps are larger and look different. Total number of minterms that need to be accommodated in the k-map = 8 A BC To maintain adjacency neighbors don’t have more than 1 different bit m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 Ahmad Almulhem, KFUPM 2010 B C A

3-variable K-maps A BC m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 A BC m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 Minterms m o, m 2, m 4, m 6 can be combined as m 0 and m 2 are adjacent to each other, m 4 and m 6 are adjacent to each other m o and m 4 are also adjacent to each other, m 2 and m 6 are also adjacent to each other Note: You can only combine a power of 2 adjacent 1-squares. For e.g. 2, 4, 8, 16 squares. You cannot combine 3, 7 or 5 squares Ahmad Almulhem, KFUPM 2010

Example 1 Simplify F = ∑m(1, 3, 4, 6) using K-map Ahmad Almulhem, KFUPM 2010 B C A BC A

Example 1 Simplify F = ∑m(1, 3, 4, 6) using K-map Ahmad Almulhem, KFUPM 2010 B C A BC A F = A’C + AC’

Example 2 Simplify F = ∑m(0,1, 2, 4, 6) using K-map Ahmad Almulhem, KFUPM 2010 B C A BC A

Example 2 Simplify F = ∑m(0,1, 2, 4, 6) using K-map Ahmad Almulhem, KFUPM 2010 B C A BC A F = A’ B’ + C’

3 variable K-Maps (Adjacency) Ahmad Almulhem, KFUPM A 3-variable map has 12 possible groups of 2 minterms They become product terms with 2 literals

3 variable K-Maps (Adjacency) Ahmad Almulhem, KFUPM A 3-variable map has 6 possible groups of 4 minterms They become product terms with 1 literals

4-variable K-maps A 4-variable function will consist of 16 minterms and therefore a size 16 k- map is needed Each square is adjacent to 4 other squares A square by itself will represent a minterm with 4 literals Combining 2 squares will generate a 3-literal output Combining 4 squares will generate a 2-literal output Combining 8 squares will generate a 1-literal output AB CD m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 m 12 m 13 m 15 m 14 m 8 m 9 m 11 m 10 Ahmad Almulhem, KFUPM 2010 C D A B

4-variable K-maps (Adjacency) AB CD m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 m 12 m 13 m 15 m 14 m 8 m 9 m 11 m 10 Ahmad Almulhem, KFUPM 2010 Right column and left column are adjacent; can be combined Top row and bottom column are adjacent; can be combined Many possible 2, 4, 8 groupings Note: You can only combine a power of 2 adjacent 1-squares. For e.g. 2, 4, 8, 16 squares. You cannot combine 3, 7 or 5 squares

Example Minimize the function F(A,B,C,D)=∑m(1,3,5,6,7,8,9,11,14,15) AB CD F = CD + A’D + BC + AB’C’ Ahmad Almulhem, KFUPM 2010 C D A B

Example F(A,B,C,D) =  m(0,1,2,5,8,9,10) CD AB A=1 C=1 D=1 B=1 Ahmad Almulhem, KFUPM 2010

Example F(A,B,C,D) =  m(0,1,2,5,8,9,10) Solution: F = B’ D’ + B’ C’ + A’ C’ D CD AB A=1 C=1 D=1 B=1 Ahmad Almulhem, KFUPM 2010

Example (POS) F(A,B,C,D) =  m(0,1,2,5,8,9,10) Write F in the simplified product of sums (POS) Two methods? You already know one! CD AB A=1 C=1 D=1 B=1 Ahmad Almulhem, KFUPM 2010

Example (POS) F(A,B,C,D) =  m(0,1,2,5,8,9,10) Write F in the simplified product of sums (POS) Method 2: Follow same rule as before but for the ZEROs F’ = AB + CD + BD’ Therefore, F’’ = F = (A’+B’)(C’+D’)(B’+D) CD AB A=1 C=1 D=1 B=1 Ahmad Almulhem, KFUPM 2010

Don’t Cares In some cases, the output of the function (1 or 0) is not specified for certain input combinations either because The input combination never occurs (Example BCD codes), or We don’t care about the output of this particular combination Such functions are called incompletely specified functions Unspecified minterms for these functions are called don’t cares While minimizing a k-map with don’t care minterms, their values can be selected to be either 1 or 0 depending on what is needed for achieving a minimized output. Ahmad Almulhem, KFUPM 2010

Example F = ∑m(1, 3, 7) + ∑d(0, 5) Ahmad Almulhem, KFUPM 2010 B C A BC A X X Circle the x’s that help get bigger groups of 1’s (or 0’s if POS). Don’t circle the x’s that don’t help.

Example F = ∑m(1, 3, 7) + ∑d(0, 5) Ahmad Almulhem, KFUPM 2010 B C A BC A X X Circle the x’s that help get bigger groups of 1’s (or 0’s if POS). Don’t circle the x’s that don’t help. F = C

Example 2 F(A, B, C, D) = ∑ m(1, 3, 7, 11, 15) + ∑ d(0, 2, 5) Ahmad Almulhem, KFUPM 2010 Src: Mano’s Textbook -Two possible solutions! -Both acceptable. -All 1’s covered

Definitions An implicant is a product term of a function Any group of 1’s in a K-Map A prime implicant is a product term obtained by combining the maximum possible number of adjacent 1’s in a k-map Biggest groups of 1’s Not all prime implicants are needed! If a minterm is covered by exactly one prime implicant then this prime implicant is called an essential prime implicant Ahmad Almulhem, KFUPM 2010

Example Consider F(X,Y,Z) =  m(1,3,4,5,6) List all implicants, prime implicants and essential prime implicants Solution: Implicants: XY’Z’, XZ’, XY’, XY’Z, X’Y’Z, Y’Z, … P.Is: XY’, XZ’, Y’Z, X’Z EPIs: X’Z, XZ’ YZ X Y=1 Z=1 X=1 YZ X Y=1 Z=1 X=1 The simplest expression is NOT unique! Ahmad Almulhem, KFUPM 2010

Finding minimum SOP 1.Find each essential prime implicant and include it in the solution 2.If any minterms are not yet covered, find minimum number of prime implicants to cover them (minimize overlap). Ahmad Almulhem, KFUPM 2010

Example 2 Simplify F(A, B, C, D) = ∑ m(0, 1, 2, 4, 5, 10,11,13, 15) Note: -Only A’C’ is E.P.I -For the remaining minterms: -Choose 1 and 2 (minimize overlap) -For m 2, choose either A’B’D’ or B’CD’ F = A’C’ + ABD + AB’C + A’B’D’ Ahmad Almulhem, KFUPM 2010 Src: Mano’s Textbook

5-variable K-maps BC DE m 0 m 1 m 3 m 2 m 4 m 5 m 7 m 6 m 12 m 13 m 15 m 14 m 8 m 9 m 11 m 10 m 16 m 17 m 19 m 18 m 20 m 21 m 23 m 22 m 28 m 29 m 31 m 30 m 24 m 25 m 27 m 26 A=0A= minterms require 32 squares in the k-map Minterms 0-15 belong to the squares with variable A=0, and minterms belong to the squares with variable A=1 Each square in A’ is also adjacent to a square in A (one is above the other) Minterm 4 is adjacent to 20, and minterm 15 is to 31 Ahmad Almulhem, KFUPM 2010

Conclusion A K-Map is simply a folded truth table, where physical adjacency implies logical adjacency K-Maps are most commonly used hand method for logic minimization. Ahmad Almulhem, KFUPM 2010