Gate-level Minimization

Slides:



Advertisements
Similar presentations
Digital Logic Design Gate-Level Minimization
Advertisements

CS 121 Digital Logic Design
CS 121 Digital Logic Design
CS 121 Digital Logic Design
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
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.
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.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Introduction Gate-level minimization refers to the design task of finding an optimal gate-level implementation of Boolean functions describing a digital.
بهينه سازي با نقشة کارنو Karnaugh Map. 2  Method of graphically representing the truth table that helps visualize adjacencies 2-variable K-map 3-variable.
CSCE 211: Digital Logic Design
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Overview of Chapter 3 °K-maps: an alternate approach to representing Boolean functions °K-map representation can be used to minimize Boolean functions.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 2 – Combinational.
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
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.
Gate-Level Minimization Chapter 3. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
D IGITAL L OGIC D ESIGN I G ATE -L EVEL M INIMIZATION.
D IGITAL L OGIC D ESIGN I G ATE -L EVEL M INIMIZATION.
Optimization Algorithm
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
October 29, 2015 EASTERN MEDITERRANEAN UNIVERSITY1 Digital Logic Design I Gate-Level Minimization Mustafa Kemal Uyguroğlu.
Chapter 3 Gate-Level Minimization
Logic Design CS221 1 st Term Logic-Circuit Implementation Cairo University Faculty of Computers and Information.
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.
EE345 – Micro-Controllers Gate-Level Minimization Prof. Ahmad Abu-El-Haija.
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
D IGITAL L OGIC D ESIGN I G ATE -L EVEL M INIMIZATION.
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
Chapter 3 Gate-level Minimization. 3-7 NAND and NOR Implementation Digital circuits are frequently constructed with NAND or NOR gates rather than with.
LOGIC GATES & BOOLEAN ALGEBRA
TUTORIAL CHAPTER 3 GATE_LEVEL MINIMIZATION PART 2 TA. Arwa Al Saad. 9 November 2013.
CS 1110 Digital Logic Design
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
CS 121 Digital Logic Design Gate-Level Minimization Chapter 3.
Gate-Level Minimization Gate-Level Minimization. Outline 3.1 Introduction 3.2 The map method 3.3 Four-variable map 3.4 Five-variable map 3.5 Product of.
Chap 2. Combinational Logic Circuits
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CS151 Introduction to Digital Design Chapter Map Simplification.
Karnaugh Map and Circuit Design.
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.
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 7 – Karnaugh Maps.
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi.
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
FIGURE 3.1 Two-variable K-map
CHAPTER 3 Simplification of Boolean Functions
Optimization Algorithm
Digital Logic Design I Gate-Level Minimization
Chapter 3 Gate-level Minimization.
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’
Circuit Simplification and
Presentation transcript:

Gate-level Minimization Chapter 3 Gate-level Minimization

Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map 3-4 Five-variable Map 3-5 Product of Sums Simplification 3-6 Don’t-care Conditions 3-7 NAND and NOR Implementation 3-8 Other Two-LeveI Implementations 3-9 Exclusive-OR Function

3-2 The Map Method • Simplification of Boolean Expression • Methods: – Minimum # of terms, minimum # of literals – To reduce complexity of digital logic gates – The simplest expression is not unique • Methods: – Algebraic minimization  lack of specific rules • Section 2.4 – Karnaugh map or K-map • Combination of 2, 4, … adjacent squares Logic circuit  Boolean function  Truth table  K-map  Canonical form (sum of minterms, product of maxterms)  (Simplifier) standard form (sum of products, product of sums)

3-2 The Map Method A Karnaugh map is a graphical tool for assisting in the general simplification procedure.

Two-Variable Maps 2 variables  4 minterms  4 squares. Y’ Y X’ X

Rules for K-Maps We can reduce functions by circling 1’s in the K-map Each circle represents minterm reduction Following circling, we can deduce minimized and-or form. Rules to consider Every cell containing a 1 must be included at least once. The largest possible “power of 2 rectangle” must be enclosed. The 1’s must be enclosed in the smallest possible number of rectangles.

Two-Variable Maps (Cont.) 1 1 b b 1 1 1 1 1 1 g = b' f = a F=AB+A’B A 1 B

Y X

2-Variable Map Simplification Example (1) Example: F(X,Y) = XY’ + XY From the map, we see that F (X,Y) = X. Note: There are implied 0s in other boxes. This can be justified using algebraic manipulations: F(X,Y) = XY’ + XY = X(Y’ +Y) = X.1 = X 1 1 X

2-Variable Map Simplification Example (2) G(x,y) = m1 + m2 + m3 Y G(x,y) = m1 + m2 + m3 = X’Y + XY’ + XY From the map, we can see that G = X + Y 1 X

2-Variable Map Simplification Example (3) F = Σ(m0,m1) Using algebraic manipulations F = Σ(m0,m1) = x’y + x’y’ = x’ (y+y’) = x’ x y F 0 0 1 0 1 1 1 0 0 1 1 0 1 y x x’y’ xy’ xy x’y 1 y x X’

Three-Variable Maps 3 variables 8 minterms (m0 – m7). How can we locate a minterm square on the map?  Use figure (a) OR  use column # and row # from figure (b) E.g. m5 is in row 1 column 01 (5 10 = 101 2) Q. Show the area representing X’? Y’? Z’?

• 8 minterms for 3 binary variables • Any two adjacent squares differ by only one variable yz yz

Three-Variable Maps (Cont.) By combining squares in powers of 2, we reduce number of literals in a product term, reducing the literal cost, thereby reducing the other two cost criteria. On a 3-variable K-Map: One square represents a minterm with three variables Two adjacent squares represent a product term with two variables Four “adjacent” terms represent a product term with one variables Eight “adjacent” terms is the function of all ones (logic 1).

3-Variable Map Simplification Example (1) Adjacent Squares m0+m2 = X’Y’Z’ + X’YZ’ = X’Z’(Y’+Y) = X’Z’ m4+m6 = XY’Z’ + XYZ’ = XZ’(Y’+Y) = XZ’

3-Variable Map Simplification Example (2) F = X’Y’Z’ + X’YZ’ + XY’Z’ + XYZ’ = Z’ (X’Y’ + X’Y + XY’ + XY) = Z’ (X’ (Y’+Y) + X (Y’+Y)) = Z’ (X’+ X) = Z’

3-Variable Map Simplification Example (3) F=AB’C’ +ABC +ABC +ABC + A’B’C + A’BC’ A 1 00 01 BC 11 10 F=A+BC +BC

3-Variable Map Simplification Example (4) 00 10 11 01 1 X Z Y YZ Example: F (x, y, z)= Σm (2, 3, 6, 7) Applying the Minimization Theorem three times: Thus the four terms that form a 2 × 2 square correspond to the term "y". 1 Y y = z yz + x ) , ( F

3-Variable Map Simplification Example (5) Example: Simplify F (x, y, z)= Σm (2, 3, 4, 5) 00 10 11 01 1 X Z Y YZ X’Y 1 XY’ F(X,Y,Z) = X’Y + XY’

3-Variable Map Simplification Example (6) Example: Simplify G (a, b, c)= Σm (3, 4, 6, 7) 00 10 11 01 1 a c b X bc bc a 1 ac’ G (a,b,c) = bc + ac’

3-Variable Map Simplification Example (7) Example: Simplify F(X, Y, Z) = X’Z + X’Y + XY’Z + YZ F(X, Y, Z) = Σm (1, 2, 3, 5, 7) z y x + 00 10 11 01 1 X Z Y YZ In general, as more squares are combined, we obtain a product term with fewer literals. Overlap is allowed. 1 F(x, y, z) =

Examples 3-1 and 3-2

Examples 3-3 and 3-4 One square represents one minterm, giving a term of three literals • Two adjacent squares represent a term of two literals • Four adjacent squares represent a term of one literal

3-3 Four-Variable Map • Two adjacent squares represent a term of three literals • Four adjacent squares represent a term of two literals • Eight adjacent squares represent a term of one literal The larger the number of squares combined, the smaller the number of literals in the term

Flat Map Vs Torus

Examples 3-5 and 3-6 x x

4-Variable Map Simplification Example F = m(0,1,2,4,5,6,8,9,12,13,14) F = Y’ + XZ’ + W’Z’

4-Variable Map Simplification Example F = m(0,2,4,5,6,7,10,13,15) Do it and show it to me next time!

Simplification Using Prime Implicants A Prime Implicant is a product term obtained by combining the maximum possible number of adjacent squares in the map into a rectangle with the number of squares a power of 2. A prime implicant is called an Essential Prime Implicant if it is the only prime implicant that covers (includes) one or more minterms. Prime Implicants and Essential Prime Implicants can be determined by inspection of a K-Map. 29

1 30

Example of Prime Implicants Find ALL Prime Implicants CD ESSENTIAL Prime Implicants C 1 B D A 1 B C D A D B D B C B Minterms covered by single prime implicant BD BD AD B A

Prime Implicant Practice Find all prime implicants for: F (W,X,Y,Z) = (0,2,3,8,9,10,11,12,13,14,15) X Y Z W 1 1 1 Prime implicants are: W, X‘Y, and X‘Z‘ Note that all of these prime implicants are essential. 1 1 1 1 1 1 1 1 Prime implicants are: W, X‘Y, and X‘Z‘ Note that all of these prime implicants are essential. 32

Another Example Find all prime implicants for: G(W,X,Y,Z) = (0,2,3,4,7,12,13,14,15) Hint: There are seven prime implicants! X Y Z W 1 1 1 Prime Implicants are WX, XY’Z', W’Y’Z', W’X’Z', W’X’Y, W’YZ, XYZ. There is only one essential prime implicant: WX. 1 1 1 1 1 1 Prime Implicants are WX, XY’Z', W’Y’Z', W’X’Z', W’X’Y, W’YZ, XYZ. There is only one essential prime implicant: WX. 33

3-4 Five-Variable Map 34

35

Example 3-7 36

3-5 Product-of-Sums Simplification E.g. Simplify the following Boolean function in product-of-sums form F(A,B,C,D)= m(0,1,2,5,8,9,10) Mark with 1’s the minterms of F. Mark the remaining squares with 0’s. These represent F’. Find the simplified F’. F’ = AB + CD + BD’ Complement 3 to obtain a simplified F in product-of-sums form F = (A’ + B’)(C’ + D’) (B’ + D)

Product-of-Sums Simplification Simplify : F= (0,1,2,5,8,9,10) in Product-of-Sums Form Mark with 0’s the Maxterms of F Combine 0’s to obtain a simplified F’ in SOP. Complement 2 to obtain a simplified F in POS. A D C B F’ = AB + CD + BD’ F = (A’+B’)(C’+D’)(B’+D) F’ = AB + CD + BD’ F = (A’+B’)(C’+D’)(B’+D) 38

Example 3-8 Simply Boolean function F(A, B, C, D) =(0, 1, 2,5, 8, 9, 10) in (a) sum of products and (b) product of sums (b) (a) F = B’D’ 1. Obtain simplified complemented function: + B’C‘ F’ = AB + CD+BD’ + A’C’D 2. Applying DeMorgan’s theorem to obtain F F = (A’ + B’) (C’+D’) (B’ + D) 39

Gate Implementation for Example 3-8 40

F(x, y, z) = (1, 3, 4, 6) = (0, 2, 5, 7) F(x, y, z) = (1, 3, 4, 6) = (0, 2, 5,7) F = x’z + xz‘ F’ = xz + x’z’  F = (x’ + z’)(x + z) 41

3.6 Don't Cares Condition Sometimes a function table or 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 1: 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” to represent “don’t cares.”

Example 3-9 product of sums? 43

3-7 NAND and NOR Implementation Digital circuits are frequently constructed with NAND or NOR gates rather than with AND and OR gates 44

NAND Circuits NAND gate: a universal gate – Any digital system can be implemented with it • including AND, OR and complement = 45

Two-Level Implementation with NAND sum of product expression and its equivalent NAND implementation F = AB + CD = [(AB + CD)’]’ = [(AB)’*(CD)’]’ 46

Example 3-10 Implement the following Boolean function with NAND gates 47

Procedures of Implementation with two levels of NAND gates 1. Express simplified function in sum of products 2. Draw a NAND gate for each product term that has at least two literals to constitute a group of first-level gates 3. Draw a single gate using AND-invert or invert- OR in the second level 4. A term with a single literal requires an inverter in the first level 48

Multilevel NAND Circuits 1. Convert all AND gates to NAND gates with AND-invert graphic symbols 2. Convert all OR gates to NAND gates with invert-OR graphic symbols 3. Check all the bubbles in the diagrams. For a single bubble, invert an inverter (one-input NAND gate) or complement the input literal ‘ 49

Figure 3-23 Implementing F=(AB’ + A’B)(C+D’) 50

NOR Circuite •The NOR operation is the dualof the NAND operation •The NOR gate is anothar universal gate to implement any Boolean function = 51

NOR Implementation Transformation from OR-AND diagram to NOR diagram •OR gates => OR-invert •AND gate => invert-AND 52

3-8 Other Two-level Implementations wired logic: some NAND or NOR gates allow a cirect wire connection between the outputs of two gates to provide a specific logic function – The wired-AND gate or wired-OR gate is not a physical second-level gate, but only a symbol 53

Nondegeneratd Forms • 16 possible combinations of two-level forms with 4 types of gates: AND, OR, NAND, and NOR – 8 degenerate forms: degenerate to a single operation – 8 generate forms • NAND-AND = AND-NOR = AND-OR-INVERT OR-NAND = NOR-OR = OR-AND-INVERT 1 \ 2 st nd AND OR NAND NOR AND AND 3-4 NAND = OR 3-4 OR x NOR NAND = NAND 3-6 AND NOR NOR x OR 3-6 54

AND-OR-INVERT Implementation AND-NOR = NAND-AND = AND-OR-INVERT F = (AB + CD + E)’ Similar to AND-OR, AND-OR-INVERT requires an expression in sum of products Given F, we can implement F’ with AND-OR-INVERT 55

OR-AND-INVERT Implementation OR-NAND = NOR-OR = OR-AND-INVERT F = [ (A+B) (C+D) E ] ’ Similar to OR-AND, OR-AND-INVERT requires an expression in products of sum Given F, we can implement F’ with OR-AND-INVERT 56

Exxmple 3-11 Other Two-level Implementations F = x’y’z’ + xyz’ F’ = x’y + xy’ + z F = (x’)’ = (x’y + xy’ + z)’ 57

3-8 Exclusive-OR (XOR) Function XOR: x  y = xy’ + x’y Exclusive-NOR = equivalenxe (x  y)’ = (xy’ + x’y)’ = (x’ + y)(x + y’) = x’y’ + xy Communtative: A  B = B  A Associative: (A  B)  C = A  (B  C) = A  B  C Only a limited number of Boolean functions can be expressed in terms of XOR operations, but it is particularly useful in arithmetic operations and error-detection and correction circuits 58

Odd Function • The 3-variable XOR function is equal to 1 if only one variable is equal to 1 or if all three variables are equal to 1 • Multiple-variable exclusive OR operation = odd function : odd number of variables be equal to 1 59

map for a 4-variable XOR Function 60

Parity Generation and Checking parity bit: an extra bit included with a binary message to make the number of 1’s either odd or even 3-bit even-parity-generator P=xyz 61

4-bit Even-Parity-Checker C = xy  zP P = 0 4-bit even parity checker = 3-bit even parity generator 62