CS/EE 181a 2008/09 Lecture 4

Similar documents
CS/EE 181a 2010/11 Lecture 4

Digital Circuit And Logic Design I. Lecture 4

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

Contents. Chapter 3 Combinational Circuits Page 1 of 36

14:332:231 DIGITAL LOGIC DESIGN

ENG2410 Digital Design Combinational Logic Circuits

Week-I. Combinational Logic & Circuits

Unit 2 Session - 6 Combinational Logic Circuits

Combinational Logic Fundamentals

DIGITAL ELECTRONICS & it0203 Semester 3

ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2

UNIT 5 KARNAUGH MAPS Spring 2011

Chapter 2 Combinational Logic Circuits

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Combinational Logic Circuits Part II -Theoretical Foundations

ELC224C. Karnaugh Maps

Exact and heuristic minimization of Boolean functions

Chapter 2 Combinational Logic Circuits

Introduction to Digital Logic Missouri S&T University CPE 2210 Karnaugh Maps

211: Computer Architecture Summer 2016

Number System conversions

Digital Logic Design. Combinational Logic

Quine-McCluskey (Tabular) Minimization

Simplifying Logic Circuits with Karnaugh Maps

The Karnaugh Map COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Minimierung. Wintersemester 2018/19. Folien basierend auf Material von F. Vahid und S. Werner Vorlesender: Dr. Ing.

Possible logic functions of two variables

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

Optimizations and Tradeoffs. Combinational Logic Optimization

Logic Minimization. Two-Level. University of California. Prof. Srinivas Devadas. Prof. Richard Newton Prof. Sanjit Seshia. Prof.

LOGIC GATES. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Lecture 7: Karnaugh Map, Don t Cares

Combinatorial Logic Design Principles

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

Spiral 1 / Unit 5. Karnaugh Maps

Gate-Level Minimization

University of Technology

Systems I: Computer Organization and Architecture

for Digital Systems Simplification of logic functions Tajana Simunic Rosing Sources: TSR, Katz, Boriello & Vahid

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Logic Design I (17.341) Fall Lecture Outline

ELCT201: DIGITAL LOGIC DESIGN

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Logical Design of Digital Systems

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

CHAPTER III BOOLEAN ALGEBRA

WEEK 3.1 MORE ON KARNAUGH MAPS

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

Chapter 2 Boolean Algebra and Logic Gates

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

DIGITAL TECHNICS I. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: LOGIC SYNTHESIS

Chapter 2 Combinational Logic Circuits

Chap 2. Combinational Logic Circuits

CHAPTER 5 KARNAUGH MAPS

Chapter 2 Combinational logic

Binary logic consists of binary variables and logical operations. The variables are

CMSC 313 Lecture 19 Homework 4 Questions Combinational Logic Components Programmable Logic Arrays Introduction to Circuit Simplification

Learning Objectives 10/7/2010. CE 411 Digital System Design. Fundamental of Logic Design. Review the basic concepts of logic circuits. Dr.

Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 2 Circuit Optimization

Karnaugh Maps Objectives

CHAPTER III BOOLEAN ALGEBRA

Combinational Logic. Review of Combinational Logic 1

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Chapter 2 Boolean Algebra and Logic Gates

Digital Circuit And Logic Design I. Lecture 3

Combinational Logic Design Principles

Chapter 2 Combinational Logic Circuits

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA (CONT.)

Chapter 4 Optimized Implementation of Logic Functions

Boolean Algebra CHAPTER 15

Combinational Logic (mostly review!)

Signals and Systems Digital Logic System

Textbook: Digital Design, 3 rd. Edition M. Morris Mano

Midterm1 Review. Jan 24 Armita

Lecture 2 Review on Digital Logic (Part 1)

CMSC 313 Lecture 19 Combinational Logic Components Programmable Logic Arrays Karnaugh Maps

Lecture 4: More Boolean Algebra

MODULAR CIRCUITS CHAPTER 7

CHAPTER 12 Boolean Algebra

DIGITAL LOGIC CIRCUITS

This form sometimes used in logic circuit, example:

Introduction to Karnaugh Maps

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Karnaugh Maps (K-Maps)

CSE 140: Components and Design Techniques for Digital Systems

Logic and Boolean algebra

S C F F F T T F T T S C B F F F F F T F T F F T T T F F T F T T T F T T T

L4: Karnaugh diagrams, two-, and multi-level minimization. Elena Dubrova KTH / ICT / ES

CHAPTER 3 BOOLEAN ALGEBRA

COMBINATIONAL LOGIC FUNCTIONS

Digital Logic (2) Boolean Algebra

UNIT 1. BOOLEAN ALGEBRA AND COMBINATIONAL CIRCUITS

14:332:231 DIGITAL LOGIC DESIGN. Combinational Circuit Synthesis

Lecture 5. Karnaugh-Map

Digital Design. Digital Design

Transcription:

CS/EE 181a 28/9 Lecture 4 General topic of today s lecture: Logic Optimization Karnaugh maps. Quine-McCluskey tabulation method (not in detail). Non series-parallel networks (some care is required). Reference for today s lecture: Kohavi s Switching and Finite Automata Theory CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 1

Logic Minimization Today, our starting point is some known boolean function epressed as a boolean epression f. We need a way to minimize the cost of implementing the function by stating it in a different, equivalent form f. In other words, f( 1,..., n ) = f ( 1,..., n ) for all 1,..., n, but the way we write (and implement) f and f may be different. We want some minimum combination of area, power, and latency. There is no general rule for this, so we will develop tools that can be useful as a guide. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 2

Logic Minimization To begin: Sum-of-products minimization. Minimizing the number of terms in a sum-of-products epression f. If f 1 and f 2 have the same number of terms, choose the one with fewer literals or variables. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 3

Are We Minimizing the Right Metrics? Sum-of-products minimization methods minimize number of terms in pulldown network. Not very helpful. Generating the p network as the dual of the n network leads to a minimum number of transistors in series. More important! This is actually a reasonable way to do things... minimize minimize Plus, later on we will see circuits that can handle large boolean epressions. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 4

Logic Minimization Vocabulary Consider the boolean function f(, y, z) = ( y z). In terms of sum-of-product epressions: minterm. A product term that includes, y, and z all eactly once (complemented or uncomplemented). Eample. y z, y z (There are eight.) implicant. An epression that implies the truth of f. Eample. y z is an implicant of f. It is also a minterm. y is another implicant of f. prime implicant. An implicant with a minimal number of literals. (What does this mean?) Eample., y, z. essential prime implicant. A prime implicant that covers some minterm of f that is not covered by any other prime implicant. if f h then h covers f Eample. implicants. In this case,, y, z are all essential prime CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 5

Minimization vocabulary, continued The disjunctive normal form (or canonical sum-ofproducts form) of a boolean epression is the disjunction ( or sum ) of the minterms for which it is true. Eample. (in compact notation) f = yz +y z +y z + yz + yz + y z + y z Theorem 1. The disjunctive normal form is unique. Theorem 2. Any boolean function can be epressed as the sum of its prime implicants. Theorem 3. A minimal sum-of-products epression of a switching function contains all its essential prime implicants. All the remaining terms are prime implicants, none of which are covered by the sum of its essential prime implicants. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 6

The Map Method For small n, we can use a graphical method Karnaugh maps or K-maps. For n = 2: 1 y y y 1 y y For n = 3, using decimal encodings for each minterm: z y 1 11 1 2 6 4 1 1 3 7 5 CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 7

Easy to generalize up to four variables yz w 1 11 1 4 12 8 1 1 5 13 9 11 3 7 15 11 1 2 6 14 1 And then on to five... vw 1111 yz 4 12 8 1 1 5 13 9 11 3 7 15 11 1 2 6 14 1 11111111 24 28 2 16 25 29 21 17 27 31 23 19 26 3 22 18 and si (two variables per dimension). Any more requires four-dimensional intuition! CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 8

K-maps in Practice Basic idea: Write out the function in the K-map. Find prime implicants. Include essential prime implicants in function. Cover the remainder minimally basically try all alternatives. (It s usually easy to figure out which ones are bad, at least if the map is reasonably small.) The last point seems bad, and it is! CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 9

How does it work? Eample. (Kohavi) f(w,, y, z) = Σ(, 4, 5, 7, 8, 9, 13, 15) First we build the K-map by placing 1 or in the appropriate min-term bo: yz w 1 11 1 1 1 1 1 1 1 1 11 1 1 1 Then we graphically find the minimal sum-of-products epression. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 1

This (irredundant): w 1 11 1 yz 1 1 1 1 11 1 1 1 1 1 1 or this (minimal): w 1 11 1 yz 1 1 1 1 11 1 1 1 1 1 1 There are choices! CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 11

Product-of-Sums Sometimes the minimal product-of-sums epression requires fewer literals. Eample. (Kohavi again.) yz w 1 11 1 w 1 11 1 yz 1 1 1 1 11 11 1 1 1 1 f = Σ(5, 6, 9, 1) f = Π(, 1, 2, 3, 4, 7, 8, 11, 12, 13, 14, 15) As sum-of-products: w y z + w y z + w yz + w yz As product-of-sums: (y + z)(y + z )(w + )(w + ) CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 12

Don t cares Frequently, we know that some combination of inputs cannot occur. (E.g., in designing an FSM.) We can easily take advantage of that by adding φ symbols (don t cares) to the K-map. Eample. BCD equal-to-9 circuit w 1 11 1 yz 1 11 1 φ Naïve f = w y z (the minterm). Less naïve f = wz. φ φ φ 1 φ φ CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 13

Quine-McCluskey Table Method K-maps break down after si variables unless you are very gifted. Alternative, more mechanical method: Quine-McCluskey tabulation. Basic idea (same as for K-map): (w ) (w ) = w ( ) = w. If two minterms A and B can be combined, they differ in eactly one literal. Thus, the number of uncomplemented literals in A and B must differ by eactly one. The Quine-McCluskey algorithm generates candidates for combination by looking at the number of uncomplemented literals. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 14

Quine-McCluskey Minimization 1 To apply the Quine-McCluskey algorithm to f: 1. List the minterms that are implicants of f. (I.e., the minterms for which f is true.) On each line of this list, write the binary representation of the minterm, and sort the list into bins by the number of ones in the binary representation. 2. Scan the list from top to bottom, comparing minterms from adjacent bins. 3. If any two minterms differ in only one position, they can be combined. Write their combined implicant (with a dash in the position of the varying bit) in a new table, likewise sorted by the number of ones. 4. Check off combined minterms any minterms remaining need to be remembered as they cannot be combined. 5. Repeat until no further combinations are possible. This yields a prime implicant chart. Now we need to cover f in a minimal way using the prime implicants. (Equivalent to the subset-sum problem N P-complete. Heuristics can help here (see Kohavi).) CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 15

Q-McC Eample for Step 1 f(w,, y, z) = Σ(, 1, 2, 5, 7, 8, 9, 1, 13, 15) 1 1 2 1 8 1 5 11 9 11 1 11 7 111 13 111 15 1111 CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 16

Q-McC Eample for Step 1, Cont d,1,2,8 1,5 1 1,9 1 2,1 1 8,9 1 8,1 1 5,7 1 1 5,13 11 9,13 1 1 7,15 111 13,15 11 1 Now we have the prime implicants: (Since no further absorptions are possible.),1,8,9 A = y,2,8,1 B = z 1,5,9,13 1 C = y z 5,7,13,15 1 1 D = z CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 17

Quine-McCluskey Minimization 2 Find all essential p.i. s and include them in minimal epression Remove all p.i. s that are covered by the essential p.i. s If the set of essential p.i. s covers all minterms of f, done! Otherwise, select additional p.i. s to cover the rest minimally. (Not always straightforward!) CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 18

Quine-McCluskey Minimization 2, eample continued Once we have the prime implicants, we need to check which of them are essential. minterm p. i. 1 2 5 7 8 9 1 13 15 A X X X X B X X X X C X X X X D X X X X Last step: Reduced p.i. chart (remove essential p.i. s and the minterms covered by them). p. i. 1 9 A X X C X X Minimal epressions: B + D + A, B + D + C. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 19

Q-McC and Don t Cares The Quine-McCluskey algorithm deals very well with don t care states. Use the don t cares (i.e., treat them as true states) to generate the prime implicants Do not include the don t cares as minterms in the prime implicant chart. This will ensure that you have all the possible prime implicants and that you do not choose more of them than you need. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 2

What we know so far Analyze pulldown and pullup networks separately, or... Product of sums pullup network by duality. Sometimes we can go between the two without redoing the analysis. Eample. 2-input multipleor. s b b s impossible path s a s a redundant path s s s s a b a b Can use redundant and impossible paths to simplify. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 21

Non Series-Parallel Networks No efficient analysis methods are known for general non series-parallel networks. Eample. Bridge network. y z y z i v j i v j w w Tie set. Cut set. In this case, we have the two epressions T ij = w + wvz + yv + yz T ij = (w + y)(w + v + z)( + v + y)( + z). CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 22

Non Series-Parallel Networks An important use of non series-parallel networks is gate sharing (more correctly, transistor sharing). Eample. Implement pulldown for f = w + wy + yz. _ f y y w w z CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 23

We can share the w operator between w and wy: _ f y z w y If we are not careful, sneak paths may form: _ f _ f w z y y z w y z was not in the original epression! CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 24

We can fi this by reintroducing a gate: _ f y w z But this is often not a very good tradeoff (sometimes it doesn t matter). A final obvious(?) thing to mention is sharing gates between unrelated functions (unrelated in the sense that they go to different outputs). We can share the transistor connected to a: s y a s a s a s y CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 25

Summary Important points to remember: Only a few kinds of circuits have known algorithms for finding the minimal network. These problems are mostly N P-complete. Designing in small modules simplifies things a lot. A few moments of thought can often save hours of Karnaugh map work... Let the computer do it? CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 26

Net time Net time we start covering state-holding elements. Introduce the notion of time. Clocks. Registers. Lab 2 due. CS/EE 181 Digital VLSI Design Laboratory L4 1/14/8 27