WEEK 3.1 MORE ON KARNAUGH MAPS

Similar documents
Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

WEEK 2.1 BOOLEAN ALGEBRA

211: Computer Architecture Summer 2016

Unit 2 Session - 6 Combinational Logic Circuits

Combinational Logic Circuits Part II -Theoretical Foundations

This form sometimes used in logic circuit, example:

14:332:231 DIGITAL LOGIC DESIGN

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

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Week-I. Combinational Logic & Circuits

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

Gate-Level Minimization

Chapter 2 (Lect 2) Canonical and Standard Forms. Standard Form. Other Logic Operators Logic Gates. Sum of Minterms Product of Maxterms

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

Chapter 4 Optimized Implementation of Logic Functions

UNIVERSITI TENAGA NASIONAL. College of Information Technology

MC9211 Computer Organization

Fundamentals of Computer Systems

Logic Design. Chapter 2: Introduction to Logic Circuits

CHAPTER1: Digital Logic Circuits Combination Circuits

Combinational Logic. Review of Combinational Logic 1

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

Midterm1 Review. Jan 24 Armita

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

CHAPTER III BOOLEAN ALGEBRA

Simplifying Logic Circuits with Karnaugh Maps

Digital Circuit And Logic Design I. Lecture 4

Chapter 2 Combinational Logic Circuits

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

Combinational Logic Fundamentals

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

Additional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

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

ELCT201: DIGITAL LOGIC DESIGN

CHAPTER III BOOLEAN ALGEBRA

Chapter 7 Logic Circuits

9/29/2016. Task: Checking for a Lower-Case Letter. ECE 120: Introduction to Computing. Change C 5 to C 5 to Obtain L(C) from U(C)

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

Boolean Algebra and Digital Logic

Fundamentals of Computer Systems

CSE 140: Components and Design Techniques for Digital Systems

Optimizations and Tradeoffs. Combinational Logic Optimization

Working with Combinational Logic. Design example: 2x2-bit multiplier

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

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

ELC224C. Karnaugh Maps

Digital Logic Design. Combinational Logic

Chapter 2. Digital Logic Basics

Logic. Combinational. inputs. outputs. the result. system can

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

CPE100: Digital Logic Design I

Karnaugh Maps (K-Maps)

Chapter 2. Boolean Algebra and Logic Gates

DIGITAL LOGIC CIRCUITS

UNIT 5 KARNAUGH MAPS Spring 2011

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

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

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

CSE 140 Midterm I - Solution

Karnaugh Maps Objectives

ENG2410 Digital Design Combinational Logic Circuits

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

Prove that if not fat and not triangle necessarily means not green then green must be fat or triangle (or both).

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

Combinatorial Logic Design Principles

Digital Logic (2) Boolean Algebra

Building a Computer Adder

Lecture 4: Four Input K-Maps

Combinational Logic Design/Circuits

In Module 3, we have learned about Exclusive OR (XOR) gate. Boolean Expression AB + A B = Y also A B = Y. Logic Gate. Truth table

Logic Gate Level. Part 2

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

Chapter 2 Boolean Algebra and Logic Gates

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

Number System conversions

Combinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan

Minimization techniques

DIGITAL LOGIC CIRCUITS

Boolean cubes EECS150. Mapping truth tables onto cubes. Simplification. The Uniting Theorem. Three variable example

Lecture 2 Review on Digital Logic (Part 1)

COMBINATIONAL LOGIC FUNCTIONS

Lecture 4: More Boolean Algebra

Introduction to Karnaugh Maps

CHAPTER 12 Boolean Algebra

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

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

Cs302 Quiz for MID TERM Exam Solved

Systems I: Computer Organization and Architecture

CSE370 HW3 Solutions (Winter 2010)

EEE130 Digital Electronics I Lecture #4

Fundamentals of Computer Systems

EC-121 Digital Logic Design

Lecture 2. Notes. Notes. Notes. Boolean algebra and optimizing logic functions. BTF Electronics Fundamentals August 2014

ECE 2300 Digital Logic & Computer Organization

Chapter 2 : Boolean Algebra and Logic Gates

ELCT201: DIGITAL LOGIC DESIGN

Review for Test 1 : Ch1 5

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

Transcription:

WEEK 3. MORE ON KARNAUGH MAPS

Don t Cares Sometimes, we might have inputs and it doesn t matter what the output is; i.e., we don t care what the output is. These situations are called don t cares. Rather than using a or a, we can use an X to mark a don t care. Why are don t cares important and useful??? Well, if we are looking for a minimum representation using as few literals and gates as possible, we can force the don t care locations to either or, however it helps us. ECE24 Digital Circuits and Systems Page 2

Example of Don t Cares Consider the following four input function where there are three input patterns for which the output can be either or, and we don t care which. For the smallest SOP implementation, it appears good to let one of the don t cares be a, while the other 2 are. Question: Is there another equally as good implementation that uses the don t cares differently? ECE24 Digital Circuits and Systems Page 3

Logical vs. Algebraic Equivalence When we have don t cares, we can get equally good expressions that are logically correct (i.e., we get output of when it must be, and when it must be ). However, depending on how we use the don t cares, multiple expressions will not equal each other algebraically. Note that both f and f 2 are valid implementations of f, but are not algebraically equal to each other since the don t cares are used differently when finding both f and f 2. ECE24 Digital Circuits and Systems Page 4

Multiple Output/Function Minimization Sometimes, we might have multiple functions that require minimization. We can minimize each function individually, but sometimes the overall circuit implementation will be better if we consider both functions simultaneously. Basically, we will try to find common product terms useful for both functions and then share them. ECE24 Digital Circuits and Systems Page 5

Example of Multiple Output/Function Minimization Consider the following 2, four input functions and the minimal implementation of each function separately. The functions have no product terms in common. The cost of f_ is OR + 3 AND + gate inputs = 4. The cost of f_2 is OR + 3 AND + gate inputs = 5. Therefore, to implement the entire circuit the cost is 29. ECE24 Digital Circuits and Systems Page 6

Example of Multiple Output/Function Minimization Consider trying to include some product terms that appear in both K-Maps. The individual expressions for f and f 2 are not the best, but If we consider that 2 product terms are shared, the entire circuit requires 2 OR + 4 AND + 7 gate inputs. The total cost of the entire circuit is 23. ECE24 Digital Circuits and Systems Page 7

Multiple Outputs Illustrated ECE24 Digital Circuits and Systems Page 8

Some More Terminology Useful to be aware of some terminology When we have a function and we are told the output is or for every possible input, the function is called completely specified. When we have a function and are told the output is or for only some of the inputs, we can assume the other inputs have don t cares as outputs. It the situation that we have don t care outputs, the function is incompletely specified. Consider the minterms for any function. We can separate the minterms in to three sets: The on-set is those minterms which require the output to be. The off-set is those minterms which require the output to be. The dc-set is those minterms which have an output of X (don t care). ECE24 Digital Circuits and Systems Page 9

Implicants, Prime Implicants and Covers A product term is called an Implicant if the logic function outputs a for all minterms in the product term. E.g., all rectangles in a K-Map that contain only s are implicants. An Implicant is called a Prime Implicant if the removal of any literal from the implicant results in a new product term that is not an implicant. E.g., Removing any literal from a product term in a K-Map corresponds to increasing the size (doubling the area) of the rectangle. If we cannot increase the size of the rectangle without including a, then the implicant is prime. A cover is a collection of implicants that account for all cases in which the function is. We can always form a cover using only prime implicants. ECE24 Digital Circuits and Systems Page

Example of Implicants In the K-Map, product terms x and x 2 x 3 are prime implicants. Product term x x 2 is an implicant, but it is not a prime implicant. ECE24 Digital Circuits and Systems Page

Essential Prime Implicants A prime implicant is called an Essential Prime Implicant if it includes a minterm that in not found in any other prime implicant. In realizing any function using only prime implicants, all essential prime implicants must be included! If not, we would miss terms for which the function outputs a. ECE24 Digital Circuits and Systems Page 2

Why all this Terminology? Understanding implicants, primes and essentials help us form a more methodical procedure for minimization of logic functions. Covers using prime implicants typically have low cost. So to minimize, we should Generate prime implicants. Identify essential prime implicants. Include the essential prime implicants in the cover. If the function is covered, stop. Include as few non-essential prime implicants to finish covering the function. And then stop ECE24 Digital Circuits and Systems Page 3

Methodical Example The following K-Map has 6 prime implicants. 4 of them are essential, 2 are not essential. ECE24 Digital Circuits and Systems Page 4

Supplmentary Notes on KMaps Some people have trouble understanding why the area of the rectangles in the K-map must always double in size when combining boxes, but it important to understand what s happening when you use a K-Map. Understanding K-Maps is important! So, I ll do a simple example here, illustrating what is happening in the K-Map, the truth table and in Boolean Algebra. ECE24 Digital Circuits and Systems Page 5

The Example Say we have the following function with 4-inputs. We can draw the truth table, the K-Map, and write the Canonical SOP using minterms. xx2 x3x4 m m4 m2 m8 m m5 m3 m9 m3 m7 m5 m m2 m6 m4 m Note that the minterms are x boxes (area ) in the K-Map. ECE24 Digital Circuits and Systems Page 6

The Example (First Step) Rearrange and duplicate rows of the truth table so that pairs of rows adjacent to each other produce an output of. Make sure only variable changes in these pairs of rows. We can put m and m 3 next to each other; We can put m 5 and m 7 next to each other; We can put m 3 and m 5 next to each other; We can put m 6 and m 7 next to each other. ECE24 Digital Circuits and Systems Page 7

What Happens Algebraically (First Step)? Since only variable in changing, we can duplicate minterms (which are product terms) and factor out a common part. The result is a set of product terms with some variables removed. ECE24 Digital Circuits and Systems Page 8

What Happens In the K-Map (First Step)? In the K-Map, we see that the x boxes grow to be boxes of area 2 (i.e., x2 or 2x). x3x4 xx2 x3x4 xx2 m m4 m2 m8 m m4 m2 m8 m m5 m3 m9 m m5 m3 m9 m3 m7 m5 m m3 m7 m5 m m2 m6 m4 m m2 m6 m4 m The boxes have DOUBLED in size by merging with an adjacent box of compatible dimension. The result are product terms that handles two rows (minterms) in the truth table. ECE24 Digital Circuits and Systems Page 9

The Example (Second Step) Again, rearrange and duplicate rows of the condensed truth table so that pairs of rows adjacent to each other produce an output of. Make sure only variable changes in these pairs of rows. If a variable was removed and replaced with - previously, then the - must match too!!! We can put (m,m 3 ) and (m 5,m 7 ) next to each other. (Only x 2 changes and doesn t matter; x 3 = - in both cases). We can put (m 5,m 7 ) and (m 3.m 5) next to each other. (Only x changes and doesn t matter; x 3 = - in both cases). ECE24 Digital Circuits and Systems Page 2

What Happens Algebraically (Second Step)? Since only variable in changing, we can duplicate product terms and factor out a common part of the product terms. The result is a set of product terms with some variables removed. ECE24 Digital Circuits and Systems Page 2

What Happens In the K-Map (Second Step)? In the K-Map, we see that (some) of the squares of area two have been expanded to be squares of area 4. x3x4 xx2 x3x4 xx2 m m4 m2 m8 m m4 m2 m8 m m5 m3 m9 m m5 m3 m9 m3 m7 m5 m m3 m7 m5 m m2 m6 m4 m m2 m6 m4 m The boxes have DOUBLED in size by merging with an adjacent box of compatible dimension. The result are product terms that handles four rows (minterms) in the truth table. ECE24 Digital Circuits and Systems Page 22

The Summary So why do rectangles in the K-Map need to have areas of, 2, 4, 8, etc Given a product term, we need to find another product term involving the same set of variables. For these two product terms, it must also be true that one and only one variable appears in complemented form in one of the product terms and in un-complemented form in the other product term. The two product terms get merged by factoring out the common part which gives something like the following: Therefore, we are always merging pairs (two) of product terms. Since we begin with minterms (area ), and merge, and merge, etc. We should see that areas will always double going, 2, 4, 8, 6, etc ECE24 Digital Circuits and Systems Page 23

XOR gates XOR gates are expensive to implement in silicon, but they are very useful for circuits like parity checkers and arithmetic circuits (e.g., adders, subtractors, and so forth). Sometimes, we can find an XOR gate hidden or buried inside of a lot of AND, OR and NOT gates. If we can find and extract the XOR gate, we can take advantage of it to get a large savings in circuit size. Recall truth tables for XOR and NXOR These gates perform the odd and even functions, respectively (with 2-inputs, they perform the difference or equivalence functions, respectively). ECE24 Digital Circuits and Systems Page 24

4-input XOR and NXOR truth tables (for illustration purposes) ECE24 Digital Circuits and Systems Page 25

XOR and XNOR functions using AND, OR and NOT gates Notice that we can implement XORs using AND, OR and NOT gates: ECE24 Digital Circuits and Systems Page 26

K-Maps for 4-Input XOR and XNOR XOR and XNOR gates have checker-board patterns in their K-Maps. xx2 xx2 x3x4 x3x4 ECE24 Digital Circuits and Systems Page 27

How can XORs Sometimes Reduce Implementation Size? Sometimes, it might be true that XORs are hidden inside of other logic. By finding and extracting an XOR, we might get a very simple circuit. xx2 x3x4 The first equation above is the minimum Sum-Of-Products 6 AND gates (2, 4-input, 4, 3-input) and OR gate (6 inputs). ECE24 Digital Circuits and Systems Page 28

Continuing Our Example xx2 x3x4 ECE24 Digital Circuits and Systems Page 29

Finishing Our Example We can draw a circuit We can see what is happening with the XOR by drawing the K-Maps for x, x 2, x 3, x 4 and overlaying them We are taking advantage of the XOR odd property. x3x4 xx2 x3x4 xx2 x3x4 xx2 x3x4 xx2 ECE24 Digital Circuits and Systems Page 3

XOR Summary In general, finding and extracting XOR gates is a complicated and hard problem. When we can write a function as the XOR of a bunch of Product Terms (ANDs), we are finding not Sum-Of-Products, but rather Exclusive Sum-Of-Products (ESOP). ECE24 Digital Circuits and Systems Page 3

Another XOR Example Just another example of finding an XOR (but not an ESOP) The K-Map appears to have an XOR pattern x3x4 xx2 The input x3 is acting like a gating signal, preventing the XOR from affecting the output when it shouldn t (we can gate signals with ANDs). ECE24 Digital Circuits and Systems Page 32