Computer Engineering (Logic Circuits) (Karnaugh Map)

Slides:



Advertisements
Similar presentations
Gate-Level Minimization
Advertisements

Overview Part 1 – Gate Circuits and Boolean Equations
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
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 6 Dr. Shi Dept. of Electrical and Computer Engineering.
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Chapter 3 Simplification of Switching Functions
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.
Karnaugh Maps for Simplification
Give qualifications of instructors: DAP
Computer Engineering (Logic Circuits) (Karnaugh Map)
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.
CT455: Computer Organization K-Map
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 2 – Combinational.
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
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
CS2100 Computer Organisation
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.
Combinational Logic Part 2: Karnaugh maps (quick).
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
PRASAD A. PAWASKAR SPN. NO DETE 2 SEMESTER lec1-11.
Converting to Minterms Form
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
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
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
June 17, 2002Basic circuit analysis and design1 Example K-map simplification Let’s consider simplifying f(x,y,z) = xy + y’z + xz. First, you should convert.
Lecture 11 Combinational Design Procedure
Karnaugh Mapping Digital Electronics. Karnaugh Mapping or K-Mapping This presentation will demonstrate how to Create and label two, three, & four variable.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
THE K-MAP.
1 Example: Groupings on 3-Variable K-Maps BC F(A,B,C) = A ’ B ’ A BC F(A,B,C) = B ’ A
Karnaugh Map (K-Map) By Dr. M. Khamis Mrs. Dua’a Al Sinari.
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.
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).
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.
CHAPTER 3 Simplification of Boolean Functions
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Computer Organisation
CS 352 Introduction to Logic Design
Optimized Implementation of Logic Function
Digital Logic and Design
CHAPTER 5 KARNAUGH MAPS 5.1 Minimum Forms of Switching Functions
Optimization Algorithm
Karnaugh Maps Introduction Venn Diagrams 2-variable K-maps
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.
Basic circuit analysis and design
Presentation transcript:

Computer Engineering (Logic Circuits) (Karnaugh Map) Lec. # 6 (Karnaugh Map) Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty of Engineering Zagazig University

Course Web Page http://www.tsgaafar.faculty.zu.edu.eg Email: tsgaafar@yahoo.com

Lec. # 6 Karnaugh Map (Contd.)

Truth Table to K-Map Mapping Karnaugh Mapping Truth Table to K-Map Mapping Digital Electronics 2.2 Intro to NAND & NOR Logic Four Variable K-Map W X Y Z FWXYZ Minterm – 0 Minterm – 1 1 Minterm – 2 Minterm – 3 Minterm – 4 Minterm – 5 Minterm – 6 Minterm – 7 Minterm – 8 Minterm – 9 Minterm – 10 Minterm – 11 Minterm – 12 Minterm – 13 Minterm – 14 Minterm – 15 1 V 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 1 1 1 Demonstrate how the minterms of a four variable truth table are mapped to a K-Map. Project Lead The Way, Inc. Copyright 2009

Four Variable K-Map Groupings Karnaugh Mapping Digital Electronics 2.2 Intro to NAND & NOR Logic Four Variable K-Map Groupings Groups of One – 16 (not shown) Groups of Two – 32 (not shown) Groups of Four – 24 (seven shown) 1 1 1 V 1 1 1 1 Four Variable K-Map: There are 16 groups of one that are not shown because they are obvious. There are 32 groups of two that are not shown because they are obvious. There are 24 groups of four. Seven are show, the other 17 are obvious. Project Lead The Way, Inc. Copyright 2009

Four Variable K-Map Groupings Karnaugh Mapping Digital Electronics 2.2 Intro to NAND & NOR Logic Four Variable K-Map Groupings Groups of Eight – 8 (two shown) 1 V 1 Four variable K-Map: There are 8 groups of eight. Two are shown, the other 6 are obvious. Project Lead The Way, Inc. Copyright 2009

Four Variable K-Map Groupings Karnaugh Mapping Digital Electronics 2.2 Intro to NAND & NOR Logic Four Variable K-Map Groupings Group of Sixteen – 1 V 1 Four variable K-Map, group of 16. Project Lead The Way, Inc. Copyright 2009

Example : 4 Variable K-Map Karnaugh Mapping Example : 4 Variable K-Map Digital Electronics 2.2 Intro to NAND & NOR Logic Example: After labeling and transferring the truth table data into the K-Map, write the simplified sum-of-products (SOP) logic expression for the logic function F3. R S T U F3 1 V Pause the presentation and allow students to complete the example. The solution is on the next slide. Project Lead The Way, Inc. Copyright 2009

Example : 4 Variable K-Map Karnaugh Mapping Digital Electronics 2.2 Intro to NAND & NOR Logic Example: After labeling and transferring the truth-table data into the K-Map, write the simplified sum-of-products (SOP) logic expression for the logic function F3. R S T U F3 1 V 1 Solution: Here is the solution. If you print handouts, do not print this page. Project Lead The Way, Inc. Copyright 2009

Steps of graphical method (continued): Combine adjacent 1’s into group of 2n each such that Each group contains only 1’s. The group is not completely a part of a larger group. Choose the minimum number of the largest sized groups needed to cover all the 1’s. Each group is represented by an expression which is an intersection of the minterm in the group. The simplified solution is a logical OR of the expressions of all the groups chosen in steps 3 above.

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

Terminology An implicant is a product term in an SOP expression (or a sum term in POS expression) Implicants are always rectangular in shape and the # of 1's covered is a power of 2 A prime implicant is an implicant that is not fully contained in some other larger implicant B C A 00 01 11 10 1 red  implicant (but not prime) many more are not shown blue  prime implicants (only two)

Essential Prime Implicants An essential prime implicant is a prime implicant that contains a 1 not included in any other prime implicant The minimum Boolean expression must use this term A cover is a collection of implicants that accounts for all valuations in which the function is “on” (e.g. 1)

Example Y=1 Consider F(X,Y,Z) = Sm(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 00 01 11 10 1 X=1 Z=1 Y=1 YZ X 00 01 11 10 1 X=1 The simplest expression is NOT unique! Z=1

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

Example 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 m2, choose either A’B’D’ or B’CD’ F = A’C’ + ABD + AB’C + A’B’D’

Examples to illustrate terms 0 0 1 1 1 0 D A 0 1 B C 5 prime implicants: BD, ABC', ACD, A'BC, A'C'D essential minimum cover: 4 essential implicants

4 Variable Maps f(A,B,C,D) = m(0,1,2,3,6,8,9,11,13,14) f = A C' D + B C D' + B' C ' + B' D + A'B' C D A B 00 01 11 10 1

These are not essential! Another 4 Variable Map f(A,B,C,D) = m(0,1,2,5,6,7,8,9,10,13,15) f = B D + A' B C + B' D' + B' C' or f = B D + A' B C + B' D' + C' D (there are 2 more) C D A B 00 01 11 10 1 These are not essential!

essential prime implicants Find the Essential Prime Implicants C D A B 00 01 11 10 1 C D A B 00 01 11 10 1 essential prime implicants f = C'D' + A'B + B'D' + ACD

1 square = a term with 4 literals 2 square = a term with 3 literal 16 square = a function equal to 1 Z WX Y 01 00 0 0 0 1 1 1 10 YZ 11 10 X W

Simplification of k-Map Generate all PIs Find EPIs If EPIs can cover all minterms, then it is answer. Otherwise choose some non-essential PIs (which has less cost) such that all minterms are cover.

Step 1 Generate PIs Blue circle are PIs They are the largest circle you can drawn on kmap

Step 2 Find EPIs Red circle are EPIs Minterm 5, 14, 11 can only be cover by these 3 red circle

Step 3 EPIs cannot cover minterm 7 Choose between green/blue circle to cover minterm 7 Green is chosen as it is larger Less cost

Final Final result is obtained x3x4’ + x2’x3 + x1’x3 + x2x3’x4

Filling The Map Given F= WX’ + YZ Required: 1) K-Map 2) Simplify F as POS Solution: 4 Variables K-Map

Filling The Map F= WX’ + YZ 0 0 0 1 1 1 10 1 1 1 1 1 Y YZ WX 00 01 X 0 0 0 1 1 1 10 YZ 11 10 X W 1 1 1 1 1

Filling The Map POS Z WX Y 01 00 0 0 0 1 1 1 10 YZ 11 10 X W 1 1 1 1 1

Filling The Map Z WX Y 01 00 0 0 0 1 1 1 10 YZ 11 10 X W 0 0 1 1 1 1 1

Karnaugh Mapping Don’t Care Conditions Digital Electronics 2.2 Intro to NAND & NOR Logic A don’t care condition, marked by (X) in the truth table, indicates a condition where the design doesn’t care if the output is a (0) or a (1). A don’t care condition can be treated as a (0) or a (1) in a K-Map. Treating a don’t care as a (0) means that you do not need to group it. Treating a don’t care as a (1) allows you to make a grouping larger, resulting in a simpler term in the SOP equation. Project Lead The Way, Inc. Copyright 2009

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.

f(w,x,y,z) = m(0,2,4,5,8,14,15), d(w,x,y,z) = m(7,10,13) Practice K-map Find a MSOP (Minimal SOP) for f(w,x,y,z) = m(0,2,4,5,8,14,15), d(w,x,y,z) = m(7,10,13)

Solutions for Practice K-map Find a MSOP for: f(w,x,y,z) = m(0,2,4,5,8,14,15), d(w,x,y,z) = m(7,10,13) Z WX Y 01 00 0 0 0 1 1 1 10 YZ 11 10 X W 1 1 1 1 X X 1 1 1 X

Solutions for Practice K-map Find a MSOP for: f(w,x,y,z) = m(0,2,4,5,8,14,15), d(w,x,y,z) = m(7,10,13) Y 1 x X W Z f(w,x,y,z)= x’z’ + w’xy’ + wxy

Example: Don’t Care Conditions Karnaugh Mapping Example: Don’t Care Conditions Digital Electronics 2.2 Intro to NAND & NOR Logic Example: After labeling and transferring the truth table data into the K-Map, write the simplified sum-of-products (SOP) logic expression for the logic function F4. Be sure to take advantage of the don’t care conditions. R S T U F4 X 1 V Pause the presentation and allow students to complete the example. The solution is on the next slide. Project Lead The Way, Inc. Copyright 2009

Example: Don’t Care Conditions Karnaugh Mapping Example: Don’t Care Conditions Digital Electronics 2.2 Intro to NAND & NOR Logic Example: After labeling and transferring the truth table data into the K-Map, write the simplified sum-of-products (SOP) logic expression for the logic function F4. Be sure to take advantage of the don’t care conditions. R S T U F4 X 1 V X 1 Solution: Here is the solution. If you print handouts, do not print this page. Project Lead The Way, Inc. Copyright 2009

Example F = ∑m(1, 3, 7) + ∑d(0, 5) B B A 00 01 11 10 X 1 3 2 4 5 7 6 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. A C

Example F = C F = ∑m(1, 3, 7) + ∑d(0, 5) 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. B B A 00 01 11 10 X 1 3 2 4 5 7 6 A F = C C

Example F(A, B, C, D) = ∑ m(1, 3, 7, 11, 15) + ∑ d(0, 2, 5) Two possible solutions! Both acceptable. All 1’s covered

Chapter – 4 – Combinational Logic Circuit

Combinational Circuits Output is function of input only i.e. no feedback When input changes, output may change (after a delay) Combinational Circuits n inputs m outputs • • 

Combinational Circuits Analysis Given a circuit, find out its function Function may be expressed as: Boolean function Truth table Design Given a desired function, determine its circuit ? ?

(A’+B’)(A’+C’)(B’+C’) Analysis Procedure Boolean Expression Approach ABC A+B+C AB'C'+A'BC'+A'B'C (A’+B’)(A’+C’)(B’+C’) AB+AC+BC F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC

Analysis Procedure Truth Table Approach A B C F1 F2 0 0 0 0 0 = 0 1

Analysis Procedure Truth Table Approach 1 0 A B C F1 F2 0 0 0 0 0 1 0 0 0 0 0 1 = 0 = 1 1 1 1 0 1 1

Analysis Procedure Truth Table Approach 1 0 A B C F1 F2 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 = 0 = 1 1 1 1 0 1 1

Analysis Procedure Truth Table Approach 0 1 A B C F1 F2 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 1 = 0 = 1 1 0 1 1

Analysis Procedure Truth Table Approach 1 0 A B C F1 F2 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 = 1 = 0 1 1 1 1 0 1

Analysis Procedure Truth Table Approach 0 1 A B C F1 F2 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 = 1 = 0 1 0 1 1

Analysis Procedure Truth Table Approach 0 1 A B C F1 F2 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 = 1 = 0 1 0 1 1

Analysis Procedure Truth Table Approach F1=AB'C'+A'BC'+A'B'C+ABC 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 = 1 1 1 1 1 1 B 1 A C B 1 A C F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC

Design Procedure Given a problem statement: Example: ? Determine the number of inputs and outputs Derive the truth table Simplify the Boolean expression for each output Produce the required circuit Example: Design a circuit to convert a “BCD” code to “Excess 3” code ? 4-bits 0-9 values 4-bits Value+3

Design Procedure BCD-to-Excess 3 Converter C B A D C B A D w = A+BC+BD 1 B A x D C 1 B A x D A B C D w x y z 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 x x x x 1 1 0 1 1 1 1 0 1 1 1 1 w = A+BC+BD x = B’C+B’D+BC’D’ C 1 B A x D C 1 B A x D y = C’D’+CD z = D’

Design Procedure BCD-to-Excess 3 Converter w = A + B(C+D) w x y z 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 x x x x 1 1 0 1 1 1 1 0 1 1 1 1 w = A + B(C+D) y = (C+D)’ + CD x = B’(C+D) + B(C+D)’ z = D’

Example Design a combinational circuit that obtains the square for the numbers from 0 ---- > 7 Solution: # i/ps = 3 # o/ps = 6 ( 49 )

Continue K-Maps (A, B, C, D, E, F) Then Implement the Circuit