Chapter 4 Simplification of Boolean Functions Karnaugh Maps

Slides:



Advertisements
Similar presentations
Logic Gates.
Advertisements

Digital Logic Design Gate-Level Minimization
IKI b-Simplification of Boolean Functions Bobby Nazief Semester-I The materials on these slides are adopted from Prof. Daniel Gajski’s.
Gate-Level Minimization
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
Boolean Algebra and Combinational Logic
Gate-Level Minimization
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
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.
Computer Architecture I: Digital Design Dr. Robert D. Kent Lecture 3 Simplification of Boolean Expressions.
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
Boolean Algebra and Digital Circuits
Department of Computer Engineering
F = ∑m(1,4,5,6,7) F = A’B’C+ (AB’C’+AB’C) + (ABC’+ABC) Use X’ + X = 1.
Gate-Level Minimization Chapter 3. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Chapter 3 Gate-Level Minimization
ECE 2110: Introduction to Digital Systems PoS minimization Don’t care conditions.
ECE 3110: Introduction to Digital Systems Symplifying Products of sums using Karnaugh Maps.
Boolean Algebra Introduction Logical arguments are valid (or not) by virtue of their form, not content Example All men are mortal(premise 1) Harry is a.
Gate-Level Minimization
Gate-level Minimization
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Karnaugh Maps ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Chapter3: Gate-Level Minimization Part 1 Origionally By Reham S. Al-Majed Imam Muhammad Bin Saud University.
Chapter 3 The Karnaugh Map
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
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
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Conversion from one number base to another Binary arithmetic Equation simplification DeMorgan’s Laws Conversion to/from SOP/POS Reading equations from.
Karnaugh Map and Circuit Design.
Karnaugh Map (K-Map) By Dr. M. Khamis Mrs. Dua’a Al Sinari.
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.
Lecture 5 More Boolean Algebra A B. Overview °Expressing Boolean functions °Relationships between algebraic equations, symbols, and truth tables °Simplification.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
Chapter 3 The Karnough Map Minimum Forms of Switching Functions 1.Combine terms by using ( Adjacency) Do this repeatedly to eliminates as.
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
Assembly Lab1 - Review.
CHAPTER 7 MULTI-LEVEL GATE CIRCUITS / NAND AND NOR GATES
CHAPTER 3 Simplification of Boolean Functions
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Chapter 4. Combinational Logic Design Principles
Chapter 2: Boolean Algebra and Logic Functions
Computer Organisation
3-7 Other Two-level Implementations
CS 105 Digital Logic Design
CS 352 Introduction to Logic Design
Boolean Algebra and Combinational Logic
ECE 331 – Digital System Design
Lecture 4 Sums of Product Circuits Simplification
Chapter 2 Boolean Algebra and Logic Gate
Example Question: Consider the expressions: (a) F = XY + XY'
Optimization Algorithm
Digital Logic Design I Gate-Level Minimization
Chapter 3 Gate-level Minimization.
MINTERMS and MAXTERMS Week 3
Minimization of Switching Functions
Overview Part 2 – Circuit Optimization
Circuit Simplification and
Presentation transcript:

Chapter 4 Simplification of Boolean Functions Karnaugh Maps Don’t Care Conditions Technology Mapping Optimization, Conversions, Decomposing, Retiming Chapter 4 Karnaugh Maps Don’t Care Conditions Technology Mapping Optimization, Conversions, Decomposing, Retiming

Boolean Cubes for n = 1, 2, 3, and 4 0010 0011 0000 0001 0110 0111 1000 1001 1010 1011 1100 1101 0100 0101 1110 1111 010 011 110 111 100 101 000 001 10 11 00 01 0 1 n = 1 n = 2 n = 3 Boolean Cubes for n = 1, 2, 3, and 4 n = 4

Boolean Functions and Boolean Cubes Each Boolean n-cube represents a Boolean function of n variables Each vertex represents a minterm Each m-subcube represents 2m minterms, m < n, with the same n – m literals Each m-subcube of 1-minterm represent a product of n – m literals = l1l2…ln – m (x′n – m + 1 x′n – m + 2 … x′n + x′n – m + 1 x′n – m + 2 … xn + … + xn – m + 1 xn – m + 2 … xn) = l1l2…ln – m For any Boolean function a prime implicant is a subcube not contained in any other prime implicant As essential prime implicant is a subcube that contains a 1-minterm that is not included in any other prime implicant Boolean Functions and Boolean Cubes

Representation of Carry and Sum Functions with Boolean Cubes ci xi yi ci + 1 si 1 010 011 010 011 110 111 100 101 000 001 000 001 110 111 100 101 Carry Function ci + 1 Sum Function si Representation of Carry and Sum Functions with Boolean Cubes Truth Table

Map Representation (Karnaugh) maps define Boolean functions Map representation is equivalent to truth tables, Boolean expressions and Boolean cube representation Map aid in visually identifying prime implicants and essential prime implicants in each Boolean function Maps are used for manual optimization of Boolean functions Map Representation

Boolean Subcubes and Corresponding Karnaugh Maps for n = 1, 2, 3, and 4 y m0 m1 m2 m3 x 1 x 1 1 n = 1 n = 2 zw m0 m1 m3 m2 m4 m5 m7 m6 m12 m13 m15 m14 m8 m9 m11 m10 00 01 11 10 xy 00 yz m0 m1 m3 m2 m4 m5 m7 m6 x 00 01 11 10 01 Boolean Subcubes and Corresponding Karnaugh Maps for n = 1, 2, 3, and 4 11 1 10 n = 3 n = 4

2–variable Map Example: x y AND OR XOR 2–variable Map y y x x x′y′ x′y 1 2 3 1 2 3 x 1 x 1 Subcube x′ x′y′ x′y Subcube y 1 Subcube x xy′ xy 1 Map Organization Example of 1-subcubes Example: x y AND OR XOR 1 2–variable Map Truth Table y y y 1 2 3 1 2 3 1 2 3 x 1 x 1 x 1 1 1 1 1 1 1 1 1 1 AND OR XOR

Three–variable Map yz x x′y′z′ x′y′z x′yz x′yz′ xy′z′ xy′z xyz xyz′ yz 1 3 2 4 5 7 6 x 00 01 11 10 x′y′z′ x′y′z x′yz x′yz′ 1 xy′z′ xy′z xyz xyz′ Map Organization yz 1 3 2 4 5 7 6 x 00 01 11 10 Subcube z Subcube z′ 1 Subcube x Example of 2-subcubes yz 1 3 2 4 5 7 6 Three–variable Map x 00 01 11 10 Subcube x′y′ Subcube yz 1 Subcube xz′ Example of 1-subcubes

Map Representation of Carry and Sum Functions ci xi yi ci + 1 si 1 xiyi xiyi 1 3 2 4 5 7 6 1 3 2 4 5 7 6 ci 00 01 11 10 ci 00 01 11 10 1 1 1 1 1 1 1 1 1 1 Carry Function ci + 1 Sum Function si Map Representation of Carry and Sum Functions Truth Table

Four–variable Map zw xy zw zw xy xy Four–variable Map 00 01 11 10 00 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 xy 00 01 11 10 00 x′y′z′w′ x′y′z′w x′y′zw x′y′zw′ 01 x′yz′w′ x′yz′w x′yzw x′yzw′ 11 xyz′w′ xyz′w xyzw xyzw′ 10 xy′z′w′ xy′z′w xy′zw xy′zw′ Map Organization zw zw 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 xy 00 01 11 10 xy 00 01 11 10 Subcube y′w 00 00 Subcube x′ Four–variable Map 01 Subcube x′y 01 Subcube w′ 11 11 Subcube xz 10 10 Example of 2-subcubes Example of 3-subcubes

Representation of Greater-than and Less-than Functions in Maps y1y0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 x1x0 00 01 11 10 00 x1 x0 y1 y0 Greater Than Equal Less Than 1 01 1 G = x1y1′ + x0y1′y0′ + x1x0y0′ 11 1 1 1 10 1 1 Greater-than Function y1y0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 x1x0 00 01 11 10 00 1 1 1 Representation of Greater-than and Less-than Functions in Maps 01 1 1 L = x1′ y1 + x1′x0′y0 + x0′y1y0 11 10 1 Truth Table Less-than Function

Example of 3-subsubes and 4-subcubes Five–variable Map v = 0 v = 1 zw 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 xy 00 01 11 10 00 01 11 10 00 x′y′z′w′v′ x′y′z′wv′ x′y′zwv′ x′y′zw′v′ 16 17 19 18 20 21 23 22 28 29 31 30 24 25 27 26 x′y′z′w′v x′y′z′wv x′y′zwv x′y′zw′v 01 x′yz′w′v′ x′yz′wv′ x′yzwv′ x′yzw′v′ x′yz′w′v x′yz′wv x′yzwv x′yzw′v 11 xyz′w′v′ xyz′wv′ xyzwv′ xyzw′v′ xyz′w′v xyz′wv xyzwv xyzw′v 10 xy′z′w′v′ xy′z′wv′ xy′zwv′ xy′zw′v′ xy′z′w′v xy′z′wv xy′zwv xy′zw′v Map Organization v = 0 v = 1 zw 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 xy 00 01 11 10 00 01 11 10 00 16 17 19 18 20 21 23 22 28 29 31 30 24 25 27 26 x′ Five–variable Map 01 vw 11 10 zw′ xz′ Example of 3-subsubes and 4-subcubes

Six–variable Map Six–variable Map v = 0 v = 1 v = 0 v = 1 zw zw xy xy 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 xy 00 01 11 10 00 01 11 10 xy 00 01 11 10 00 01 11 10 16 17 19 18 20 21 23 22 28 29 31 30 24 25 27 26 16 17 19 18 20 21 23 22 28 29 31 30 24 25 27 26 00 m0 m1 m3 m2 m16 m17 m19 m18 00 01 m4 m5 m7 m6 m20 m21 m23 m22 01 u = 1 u = 1 11 m12 m13 m15 m14 m28 m29 m31 m30 11 x′v 10 m8 m9 m11 m10 m24 m25 m27 m26 10 32 33 35 34 36 37 39 38 44 45 47 46 40 41 43 42 m32 m33 m35 m34 48 49 51 50 52 53 55 54 60 61 63 62 56 57 59 58 00 m48 m49 m51 m50 32 33 35 34 36 37 39 38 44 45 47 46 40 41 43 42 48 49 51 50 52 53 55 54 60 61 63 62 56 57 59 58 00 01 m36 m37 m39 m38 m42 m53 m55 m54 01 xz u = 0 u = 0 11 m44 Six–variable Map m45 m47 m46 m60 m61 m63 m62 11 10 m40 m41 m43 m42 m56 m57 m59 m58 10 Map Organization z′w′ Example of 4-subcubes

Boolean Simplification with Map Method Truth table, canonical form or standard form Determine prime implicants Generate map Select essential prime implicants Find minimal cover Standard form Boolean Simplification with Map Method

Boolean Simplification with Map Method Example: Maps method Problem: Using the map method, simplify the Boolean function F = w′y′z′ + wz + xyz + w′y yz yz 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 wx 00 01 11 10 wx 00 01 11 10 00 1 1 1 00 1 1 1 01 1 1 1 01 1 1 1 11 1 1 11 1 1 10 1 1 10 1 1 Boolean Simplification with Map Method Map Organization Prime Implicants in the Map PI List: w′z′, wz, yz, w′y EPI List: w′z′, wz Cover List: (1) w′z′, wz, yz (2) w′z′, wz, w′y

Selection of Prime Implicants Example: Selection of prime implicants Problem: Simplify the Boolean function F = w′x′yz′ + w′xy + wxz + wx′y′ + w′x′y′z′ yz 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 wx 00 01 11 10 00 1 1 01 1 1 11 1 1 10 1 1 Selection of Prime Implicants PI List: w′x′z′, w′xy, wxz, wx′y′, x′y′z′, wy′z, xyz, w′yz′ EPI List: empty Cover List: (1) w′x′z′, w′xy, wxz, wx′y′ (2) x′y′z′, wy′z, xyz, w′yz′

Don’t–Care Conditions Completely specified functions have a value assigned for every minterm Incompletely specified functions do not have values assigned for some minterms which are called don’t–care minterms (d–minterms) or don’t–care conditions Don’t–care minterms can be assigned any value during simplifications in order to simplify Boolean expressions Don’t–Care Conditions

Don’t–Care Conditions Example: Don’t–care conditions Problem: Derive Boolean expressions for the 9’s complement of a BCD digit x1x0 x1x0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 x3x2 00 01 11 10 x3x2 00 01 11 10 Digits Nine’s Complements Decimal BCD x3 x2 x1 x0 y3 y2 y1 y0 9 1 8 2 7 3 6 4 5 00 1 1 00 1 1 01 01 1 1 11 X X X X 11 X X X X 10 X X 10 X X y3 = x3′ x2′ x1′ y2 = x2  x1 x1x0 x1x0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10 x3x2 00 01 11 10 x3x2 00 01 11 10 Don’t–Care Conditions 00 1 1 00 1 1 01 1 1 01 1 1 11 X X X X 11 X X X X Nine’s–Complement Table 10 X X 10 1 X X y1 = x1 y0 = x0′ Map Representation

Technology Mapping for Gate Arrays Gate arrays contain only one type of m-input gate (such as 3-input NOR, 3-input NAND) Technology mapping is a transformation of Boolean expressions into a logic schematic containing only this type of gate Technology mapping consist of three tasks Conversion replaces each operator with an operator representing the gate function given in the gate array Optimization eliminates unnecessary inverters Decomposition replaces a n-input gate with an m-input gate available in the gate array Technology Mapping for Gate Arrays

Conversion and Optimization Rule 1: Rule 2: Rule 3: Rule 4: Conversion Rules Rule 5: Conversion and Optimization Optimization Rules Conversion Procedure: Replace AND and OR gates with NAND or NOR gates by using Rules 1 – 4, and eliminate double inverters whenever possible

Translation of Standard Terms to NAND and NOR Schematics Form Type Standard Form Implementation NAND Implementation NOR Implementation Sum of products Product of sums Translation of Standard Terms to NAND and NOR Schematics

Conversion to NAND (NOR) Gates Example: Conversion to NAND (NOR) gates Problem: Derive the NAND and NOR implementations of the carry function 2.4 1.4 xi xi xiyi yi 2.4 2.8 ci + 1 yi 1.4 1.8 ci + 1 1 3 2 4 5 7 6 ci 00 01 11 10 ci ci 1 2.4 1.4 1 1 1 1 NAND Implementation Map Definition Carry Function ci + 1 ci + 1 = xiyi+ xici + yici ci + 1 = (xi + yi)(xi + ci)(yi + ci) Conversion to NAND (NOR) Gates 2.4 1.4 xi xi Standard Forms yi 2.4 2.8 ci + 1 yi 1.4 1.8 ci + 1 ci ci 2.4 1.4 NOR Implementation

Decomposition of 10–input AND Gate into 3–input AND Gates 2.4 2.4 2.4 2.4 2.4 2.4 Level Number Number of Inputs Number of Gates 1 10 [10 / 3] = 3 2 3 + (10 – 3([10 / 3])) = 4 [4 / 3] = 1 3 1 + (4 – 3([4 / 3])) = 2 [2 / 3] = 1 2.4 2.4 Decomposition of 10–input AND Gate into 3–input AND Gates Input and Gate Computation on Each Level 2.4 2.4 One Possible Decomposition Alternative Decomposition

Technology Mapping for Gate Arrays Example: Technology mapping for gate arrays Problem: Implement the sum function using 3–input NAND gates ci xi yi ci xi yi si si xiyi 1 3 2 4 5 7 6 ci 00 01 11 10 1 1 AND–OR Implementation Conversion to NAND Network 1 1 1 ci xi yi ci xi yi Map Definition Sum Function si Technology Mapping for Gate Arrays si si OR Gate Decomposition Optimized NAND Network

Design Retiming Example: Design retiming Problem: Implement 4–bit carry-look-ahead function c4 = g3 + p3 g2 + p3 p2 g1 + p3 p2 p1 g0 + p3 p2 p1 p0 c0 using 3–input NAND gates g1 p3 p2 c4 p1 g0 p3 p2 p1 p0 c0 AND-OR Implementation g3 g3 p3 p3 g2 g2 p3 p3 p2 p2 g1 g1 p3 p3 p2 c4 p2 p1 p1 c4 g0 g0 p3 p3 p2 p2 p1 p1 p0 p0 c0 c0 Decomposition of AND-OR Implementation Performance Optimized Decomposition g3 Design Retiming g3 p3 p3 g2 1.8 1.8 1.8 g2 p3 p3 p2 p2 1.8 g1 1.8 g1 p3 p3 p2 1.8 1.8 c4 p2 1.8 p1 1.8 p1 1.8 1.8 c4 g0 g0 p3 p3 p2 p2 p1 1.8 p1 1.8 p0 1.8 p0 c0 c0 1.8 NAND Implementation of Above Delay = 8.2ns Performance Optimized NAND Implementation Delay = 6.4ns

Technology Mapping Procedure for Gate Arrays Start Convert Decompose Eliminate invertors Retime yes no I/O delay OK? Done Technology Mapping Procedure for Gate Arrays

Technology Mapping for Custom Libraries Libraries contain gates with different functions and different delays Technology mapping means covering schematic with library gates Minimize delay on critical paths Minimize cost on non-critical paths Technology Mapping for Custom Libraries

Technology Mapping for Custom Libraries Example: Technology mapping for custom libraries Problem: Convert the expression w′ z′ + z(w + y) into a logic schematic using any of the gates defined in the digital logic gates, multiple-input gates, and complex gates libraries y 2.4 y 2.4 1.4 2.4 F 2.0 F w w 2.4 z z AND–OR Implementation (Delay = 7.2ns, Cost = 28) Alternative A (Delay = 5.4ns, Cost = 20) y y 1.4 1.4 2.0 1.4 F 1.4 F w 1.4 w z 1.4 z Technology Mapping for Custom Libraries NAND Implementation (Delay =5.2ns, Cost = 22) Alternative B (Delay = 3.8ns, Cost = 20) B y A y 1.4 1.4 2.0 1.4 F 1.4 F w 1.4 w z 1.4 z Two Possible Conversions Cost Optimized Alternative B (Delay = 3.8ns, Cost = 18)

Conversion Procedure for Custom Libraries Start Convert to NAND schematic Select a path Select gate Select a library component Record replacement gain no no no All paths considered? All gates considered? All components considered? Recompute Delay Select maximum gain replacement yes yes Conversion Procedure for Custom Libraries yes Done

Chapter Summary Simplification of Boolean functions by Map method (visual) Technology mapping for gate arrays Decomposition Conversion Optimization Retiming Technology mapping for custom libraries by schematic covering with complex gates with Time optimization on circuit paths Cost optimization on non-critical paths Chapter Summary