Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.

Slides:



Advertisements
Similar presentations
KU College of Engineering Elec 204: Digital Systems Design
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.
Boolean Algebra and Combinational Logic
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapter 2 – Part 4.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
Circuit Optimization Goal: To obtain the simplest implementation for a given function Optimization is a more formal approach to simplification that is.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 2 – Combinational.
Karnaugh Maps for Simplification
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.
SYEN 3330 Digital Systems Jung H. Kim Chapter SYEN 3330 Digital Systems Chapter 2 – Part 5.
Chapter 2: Combinatorial Logic Circuits Illustration Pg. 32 Logic Circuit Diagrams - Circuit Optimization -2,3,4 level maps 48 elements Optimized to 25.
EECC341 - Shaaban #1 Lec # 7 Winter Combinational Circuit Minimization Canonical sum and product logic expressions do not provide a circuit.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Boolean Algebra and Logic Simplification
1 Why study Boolean Algebra? 4 It is highly desirable to find the simplest circuit implementation (logic) with the smallest number of gates or wires. We.
KU College of Engineering Elec 204: Digital Systems Design
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
Digital Logic Chapter 4 Presented by Prof Tim Johnson
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 2 – Combinational.
Department of Computer Engineering
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
Optimization Algorithm
Chapter 3 Gate-Level Minimization
ECE 2110: Introduction to Digital Systems PoS minimization Don’t care conditions.
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.
Gate-Level Minimization
Gate-level Minimization
Computer Engineering (Logic Circuits) (Karnaugh Map)
Chapter3: Gate-Level Minimization Part 1 Origionally By Reham S. Al-Majed Imam Muhammad Bin Saud University.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
CS1Q Computer Systems Lecture 7
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 6 – Canonical Forms.
February 2, 2004CS 2311 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are AND, OR and.
Lecture 11 Combinational Design Procedure
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.
Karnaugh Mapping Digital Electronics. Karnaugh Mapping or K-Mapping This presentation will demonstrate how to Create and label two, three, & four variable.
Module –I Switching Function
ECE 3110: Introduction to Digital Systems Chapter #4 Review.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CS151 Introduction to Digital Design Chapter Map Simplification.
Karnaugh Maps (K-Maps)
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
Logic Simplification-Using K-Maps
ECE/CS 352 Digital System Fundamentals1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapter 2 – Part 5 Tom Kaminski & Charles R. Kime.
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.
Chapter 4 OPTIMIZED IMPLEMENTATION OF LOGIC FUNCTIONS.
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 7 – Karnaugh Maps.
Digital Systems Design 1 Signal Expressions Multiply out: F = ((X + Y)  Z) + (X  Y  Z) = (X  Z) + (Y  Z) + (X  Y  Z)
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
CHAPTER 3 Simplification of Boolean Functions
Lecture 3: Incompletely Specified Functions and K Maps
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
ECE/CS 352 Digital Systems Fundamentals
Lecture 3: Incompletely Specified Functions and K Maps
SYEN 3330 Digital Systems Chapter 2 – Part 4 SYEN 3330 Digital Systems.
Optimization Algorithm
Chapter 3 Gate-level Minimization.
Overview Part 2 – Circuit Optimization
Presentation transcript:

Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals

Circuit Optimization 2 Circuit Optimization  Goal: To obtain the simplest implementation for a given function  Optimization is a more formal approach to simplification that is performed using a specific procedure or algorithm  Optimization requires a cost criterion to measure the simplicity of a circuit  Distinct cost criteria we will use: Literal cost (L) Gate input cost (G) Gate input cost including inverters (GN)

Circuit Optimization 3  Literal – a variable or it complement  Literal cost – the number of literal appearances in a Boolean expression corresponding to the logic circuit diagram  Example: Boolean expressions for F F = B D + A B C + A C D F = B D + A B C + A B D + A B C F = (A+B)(A+D)(B+C+D)(B+C+D) Which solution is best? Literal Cost L = 8 L = 11 L = 10 First solution is best

Circuit Optimization 4 Gate Input Cost  Gate Input Cost: Count of total number of inputs to the gates in the logic circuit implementation  Two gate input costs are defined: G = Count of gate inputs without counting Inverters GN = Count of gate inputs + count of Inverters  For SOP and POS equations, the gate input cost can be found from the Boolean expression by finding the sum of: All literal appearances Number of terms excluding single literal terms (added to G) Number of distinct complemented single literals (added to GN)  Example: F = B D + A B C + A C D L = 8G = L+3 = 11 GN = G+3 = 14

Circuit Optimization 5  Example 1:  F = A + B C + Cost Criteria (continued) A B C F B C L = 5  L (literal count) counts the AND inputs and the single literal OR input. G = L + 2 = 7  G (gate input count) adds the remaining OR gate inputs GN = G + 2 = 9  GN(gate input count with NOTs) adds the inverter inputs

Circuit Optimization 6  Example 2:  F = A B C +  L = 6 G = 8 GN = 11  F = (A + )( + C)( + B)  L = 6 G = 9 GN = 12  Same function and same literal cost  But first circuit has better gate input count and better gate input count with NOTs  Select first circuit! Cost Criteria (continued) B C A A B C F C B F A B C A

Circuit Optimization 7 Cost Criteria Summary  Literal Count: Simple to evaluate by counting all literals However, does not represent circuit complexity accurately in all cases  Gate Input Cost (or Count): Good measure of logic implementation Proportional to the number of transistors and wires used in the implementation Important when measuring cost of circuits with more than two levels

Circuit Optimization 8 Boolean Function Optimization  Minimizing the gate input (or literal) cost of a Boolean equation reduces the circuit cost  We choose gate input cost  Boolean Algebra and graphical techniques are tools to minimize cost criteria values  Some important questions: When do we stop trying to reduce the cost? Do we know when we have a minimum cost?  Treat optimum or near-optimum cost functions for two-level (SOP and POS) circuits first  Introduce a graphical technique using Karnaugh maps (K-maps for short)

Circuit Optimization 9 Karnaugh Map (K-map)  A K-map is a collection of squares Each square represents a minterm The collection of squares is a graphical representation of a Boolean function Adjacent squares differ in the value of one variable Alternative algebraic expressions for the same function are derived by recognizing patterns of squares  The K-map can be viewed as A reorganized version of the truth table

Circuit Optimization 10 Some Uses of K-Maps  Provide a means for: Finding optimum or near optimum  SOP and POS standard forms  Two-level AND/OR and OR/AND circuits for functions with small numbers of variables Visualizing concepts related to manipulating Boolean expressions, and Demonstrating concepts used by computer- aided design programs to simplify large circuits

Circuit Optimization 11 Two-Variable K-Map  A 2-variable Karnaugh Map: Minterm m 0 and minterm m 1 are “adjacent” they differ in the value of variable y Similarly, minterm m 0 and minterm m 2 are adjacent and differ in x Also, m 1 and m 3 differ in the x variable Finally, m 2 and m 3 differ in the y variable m 3 = x ym 2 = x yx = 1 m 1 = x ym 0 = x yx = 0 y = 1y = 0 x y

Circuit Optimization 12 K-Map and Truth Tables  The K-Map is a different form of the truth table Truth Table Input Values (x,y) Function Value F(x,y) K-Map 11x = 1 01x = 0 y = 1y = 0 x y

Circuit Optimization 13 K-Map Function Minimization  F(x,y) = m 0 + m 2 + m 3 F = x y + x y + x y  Two adjacent cells containing 1’s can be combined using the Minimization Theorem K-Map 11x = 1 01x = 0 y = 1y = 0 x y  m0 + m2 = x y + x y = (x + x) y = y  Therefore, F can be simplified as F = x + y  m2 + m3 = x y + x y = x (y + y) = x

Circuit Optimization 14 Three Variable K-Map  Where each minterm corresponds to the product terms:  Note that if the binary value for an index differs in one bit position, the minterms are adjacent on the K-Map yz=00 yz=01 yz=11 yz=10 x=0 m0m0 m1m1 m3m3 m2m2 x=1 m4m4 m5m5 m7m7 m6m6 yz=00 yz=01 yz=11 yz=10 x=0 x=1 zyx zyx zyxzyx zyx zyx zyx zyx x yz x

Circuit Optimization 15 Alternative K-Map Labeling  K-Map largely involves: Entering values into the map, and Reading off product terms from the map  Alternate labelings are useful: y z x x y z z y y z z x x

Circuit Optimization 16 Example Functions  By convention, we represent the minterms of F by a ‘1’ in the map and leave the entries that contain ‘0’ blank  Example 1:  Example 2:  Learn the locations of the 8 indices based on the variable order shown y x z x y z F(x, y, z) = ∑ (2, 3, 4, 5) G(x, y, z) = ∑ (3, 4, 6, 7)

Circuit Optimization 17 Combining Squares  By combining squares, we reduce number of literals in a product term, thereby reducing the gate input cost  On a 3-variable K-Map: One square represents a minterm with 3 variables Two adjacent squares represent a term with 2 variables Four adjacent squares represent a term with 1 variable Eight adjacent square is the function 1 (no variables)

Circuit Optimization 18 Example: Combining Squares  Example:  Applying the Minimization Theorem 3 times:  Thus the four terms that form a 2 × 2 square correspond to the term ‘y’. y  zyyz  zyxzyxzyxzyx)z,y,x(F  x y z F = ∑ (2, 3, 6, 7)

Circuit Optimization 19 Combining Four Squares  Example Shapes of 4-square Rectangles: y z x x y z

Circuit Optimization 20 Combining Two Squares  Example Shapes of 2-square Rectangles: y x z x y x z y z

Circuit Optimization 21 Simplifying 3-Variable Functions  K-Maps can be used to simplify Boolean functions  Example: find an optimum SOP equation for F(x, y, z) = ∑ (0, 1, 2, 4, 6, 7) x yz y x z F = z + x y + x y

Circuit Optimization 22 Four-Variable K-Map m 0 = w x y zm 1 = w x y zm 3 = w x y zm 2 = w x y z 01m 4 = w x y zm 5 = w x y zm 7 = w x y zm 6 = w x y z 11m 12 = w x y zm 13 = w x y zm 15 = w x y zm 14 = w x y z 10m 8 = w x y zm 9 = w x y zm 11 = w x y zm 10 = w x y z yz wx Y Y Z W X W ZZ X X

Circuit Optimization 23 4-Variable K-map Terms  4-variable K-maps can have rectangles corresponding to: Single square = 4-variable minterm 2 combined squares = 3-variable term 4 combined squares = 2-variable term 8 combined squares = 1 variable term 16 (all) combined squares = constant ‘1’

Circuit Optimization 24 Combining Eight Squares  Examples of 8-square Rectangles: X Y Z W W Z

Circuit Optimization 25 Combining Four Squares  Examples of 4-square Rectangles: X Y Z W W Y X Z

Circuit Optimization 26 Combining Two Squares  Examples of 2-square Rectangles: X Y Z W W Y Z W X Z X Y Z W X Z

Circuit Optimization 27 Simplifying 4-Variable Functions  F(W, X, Y, Z) = ∑ (0, 2, 4, 5, 6, 7, 8, 12) X Y Z W Y Z W Z F = W X + Y Z + W Z W X

Circuit Optimization 28 Product-of-Sum (POS) Simplification  F (W, X, Y, Z) = ∑ (1, 2, 3, 9, 10, 11, 13, 14, 15)  F =  F (W, X, Y, Z) = ∑ (0, 4, 5, 6, 7, 8, 12) =  F = Y Z + W X = (Y + Z) (W + X) X Y Z W X Y Z W F W Z+ W Y+ X Z+ X Y + W XY Z (G = 8+4 = 12) (G = 4+2 = 6)

Circuit Optimization 29 Product-of-Sum Simplification  Step 1: Draw the K-map for F, replacing the 0’s of F with 1’s in F and vice versa  Step 2: Obtain a minimal Sum-of-Product (SOP) expression for F  Step 3: Use DeMorgan’s Theorem to obtain F = F The result is a minimal Product-of-Sum (POS) expression for F  Step 4: Compare the cost of the minimal SOP and POS expressions to find which one is better

Circuit Optimization 30 Five-Variable K-Maps  For five variable problems, we use two adjacent 4-variable K-maps that can be visualized to be on top of each other  Each square in the A=0 map is adjacent to the corresponding square in the A=1 map (e.g. m 4 and m 20 ) C D E B A = C E B A = 1 D

Circuit Optimization 31 Example of a Five-Variable K-map  F(A, B, C, D, E) = ∑(0, 1, 8, 9, 16, 17, 22, 23, 24, 25)  F = C D E B A = C E B A = 1 D C D + A B C D

Circuit Optimization 32  Sometimes a function table or K-map contains entries for which it is known : The input values for the minterm will never occur, or The output value for the minterm is not used  In these cases, the output value need not be defined  Instead, the output value is defined as a “don't care”  By placing “don't cares” ( an “x” entry) in the function table or map, the cost of the logic circuit may be lowered.  Example: A logic function having the binary codes for the BCD digits as its inputs. Only the codes for 0 through 9 are used. The six codes, 1010 through 1111 never occur, so the output values for these codes are “x = don’t cares.” Don't Cares in K-Maps

Circuit Optimization 33 Product-of-Sums Example  Find the optimum POS expression for : F(A, B, C, D) = ∑ (3,9,11,12,13,14,15) + ∑ d (1,4,6) Where ∑ d indicates the don’t care minterms  Solution: Find F =  F = B D + A B  Optimum POS expression: F = (B + D) (A + B) Gate input cost (G = 6) ∑ (0, 2, 5, 7, 8, 10) + ∑ d (1,4,6) D A X X 1 X B C F