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

Similar documents
Introduction to Digital Logic Missouri S&T University CPE 2210 Boolean Representations

Introduction to Digital Logic Missouri S&T University CPE 2210 Boolean Algebra

Introduction to Digital Logic Missouri S&T University CPE 2210 Combinatorial Circuit Analysis and Synthesis

Introduction to Digital Logic Missouri S&T University CPE 2210 Multiplexers/Demultiplexers

Introduction to Digital Logic Missouri S&T University CPE 2210 PLDs

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

This form sometimes used in logic circuit, example:

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

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

Combinational Logic Design Principles

CHAPTER III BOOLEAN ALGEBRA

Chapter 2 Combinational Logic Circuits

Digital Logic Design. Combinational Logic

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

ELC224C. Karnaugh Maps

Combinatorial Logic Design Principles

CHAPTER III BOOLEAN ALGEBRA

UNIT 5 KARNAUGH MAPS Spring 2011

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

Chapter 2 Combinational Logic Circuits

DIGITAL ELECTRONICS & it0203 Semester 3

Optimizations and Tradeoffs. Combinational Logic Optimization

Unit 2 Session - 6 Combinational Logic Circuits

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

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

Standard Expression Forms

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

Karnaugh Maps Objectives

Chapter-2 BOOLEAN ALGEBRA

Combinational Logic Fundamentals

ENG2410 Digital Design Combinational Logic Circuits

Week-I. Combinational Logic & Circuits

Digital Circuit And Logic Design I. Lecture 4

Chapter 2 : Boolean Algebra and Logic Gates

Logic Design. Chapter 2: Introduction to Logic Circuits

Chap 2. Combinational Logic Circuits

Chapter 2 Combinational Logic Circuits

Chapter 2 Boolean Algebra and Logic Gates

Boolean Algebra and Logic Design (Class 2.2 1/24/2013) CSE 2441 Introduction to Digital Logic Spring 2013 Instructor Bill Carroll, Professor of CSE

Lecture 2 Review on Digital Logic (Part 1)

Simplifying Logic Circuits with Karnaugh Maps

CHAPTER 5 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):

Digital Circuit And Logic Design I. Lecture 3

Logic Design I (17.341) Fall Lecture Outline

Boolean Algebra & Logic Gates. By : Ali Mustafa

CS/EE 181a 2010/11 Lecture 4

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

Combinational Logic Circuits Part II -Theoretical Foundations

Review for Test 1 : Ch1 5

Chapter 7 Logic Circuits

Combinational Logic. Review of Combinational Logic 1

Chapter 2. Boolean Algebra and Logic Gates

211: Computer Architecture Summer 2016

MC9211 Computer Organization

Gate-Level Minimization

ELCT201: DIGITAL LOGIC DESIGN

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

Signals and Systems Digital Logic System

Number System conversions

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

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

Boolean Algebra, Gates and Circuits

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

Chapter 4 Optimized Implementation of Logic Functions

Contents. Chapter 3 Combinational Circuits Page 1 of 36

Logic Gate Level. Part 2

Section 4.1 Switching Algebra Symmetric Functions

CHAPTER 2 BOOLEAN ALGEBRA

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 1 Gate Circuits and Boolean Equations

Introduction to Karnaugh Maps

CHAPTER1: Digital Logic Circuits Combination Circuits

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

Chapter 2: Switching Algebra and Logic Circuits

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

Chapter 2 Combinational Logic Circuits

CSE 140, Lecture 2 Combinational Logic CK Cheng CSE Dept. UC San Diego

Possible logic functions of two variables

Chapter 2 Combinational logic

Minimization techniques

Electronics. Overview. Introducction to Synthetic Biology

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

Sample Marking Scheme

Chapter 2 Boolean Algebra and Logic Gates

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

BOOLEAN ALGEBRA TRUTH TABLE

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

CS 226: Digital Logic Design

INTRODUCTION TO INFORMATION & COMMUNICATION TECHNOLOGY LECTURE 8 : WEEK 8 CSC-110-T

Part 5: Digital Circuits

CS/EE 181a 2008/09 Lecture 4

Combinational Logic Design/Circuits

If f = ABC + ABC + A B C then f = AB C + A BC + AB C + A BC + A B C

Unit 2 Boolean Algebra

Systems I: Computer Organization and Architecture

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

1 Boolean Algebra Simplification

Digital Logic Design. Malik Najmus Siraj

Transcription:

Introduction to Digital Logic Missouri S&T University CPE 2210 Karnaugh Maps Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology cetinkayae@mst.edu http://web.mst.edu/~cetinkayae/teaching/cpe2210fall2016 16 September 2016 rev. 16.0 2014 2016 Egemen K. Çetinkaya

Introduction Karnaugh maps Karnaugh Maps Outline Incomplete Boolean functions Summary 2

Equations Boolean Representations Mappings allows simplification e.g. F = x Circuits using logic gates, represents actual physical implementation e.g. Truth tables represents all possible combinations of input values one function has only one truth table representation e.g. x x F 0 1 1 0 F 3

Commutativity Distributivity Associativity Identity Complementery Null elements Idempotent law Involution law DeMorgan s law Absorption law Boolean Algebra Theorems 4

Boolean Representations Terminology Example F(a,b,c)=ab+c+ac What are the variables? What are the literals? What are the product terms? 5

Boolean Representations Terminology Example F(a,b,c)=ab+c+ac Variables: a, b, c Literals: a, b, c, a, c Product terms: ab, c, ac 6

Boolean Representations Sum-of-Products Form Equation written as OR of product terms Examples: Following are in sum-of-products form ab + a c a + b + cde Following are not in sum-of-products form (a+b)c (a ) + b variable should be complemented or uncomplemented form 7

Boolean Representations Product-of-Sums Form Equation written as AND of sum terms Examples: Following are in product-of-sums form a (a + c) (a + b) a b (c + d + e) Following are not in sum-of-products form (a b)+c (a ) b variable should be complemented or uncomplemented form 8

Boolean Representations Normal Term A product or a sum term no variable appears more than once A nonnormal term can be simplified to a constant or a normal term Nonnormal terms example: abbc, a+a+c, aa b Normal terms example: abc, a +b+c 9

Boolean Representations Minterm A product term in which literals include every variable only once, either true or complemented form Example: What are the minterms of the function: F(a,b,c)=ab+abc +ac +c 10

Boolean Representations Minterm A product term in which literals include every variable only once, either true or complemented form Example: What are the minterms of the function: F(a,b,c)=ab+abc +ac +c Answer: abc An equation is sum-of-minterms form if: every product term is a minterm Example: F(a,b,c)=abc+ab c+a b c 11

Boolean Representations Maxterm A sum term in which literals include every variable only once, either true or complemented form Example: What are the maxterms of the function: F(a,b,c)=(a+b) (a+b+c ) (a+c ) c 12

Boolean Representations Maxterm A sum term in which literals include every variable only once, either true or complemented form Example: What are the maxterms of the function: F(a,b,c)=(a+b) (a+b+c ) (a+c ) c Answer: a+b+c An equation is product-of-maxterms form if: every sum term is a maxterm Example: F(a,b,c)=(a+b+c) (a+b +c) (a +b +c ) 13

Boolean Representations Minterms and Maxterms Minterm is a product term that is 1 Maxterm is a sum term that is 0 row x y z F minterm maxterm 0 0 0 0 F(0,0,0)?? 1 0 0 1 F(0,0,1)?? 2 0 1 0 F(0,1,0)?? 3 0 1 1 F(0,1,1)?? 4 1 0 0 F(1,0,0)?? 5 1 0 1 F(1,0,1)?? 6 1 1 0 F(1,1,0)?? 7 1 1 1 F(1,1,1)?? 14

Boolean Representations Minterms and Maxterms Minterm is a product term that is 1 Maxterm is a sum term that is 0 row x y z F minterm maxterm 0 0 0 0 F(0,0,0) x y z x+y+z 1 0 0 1 F(0,0,1) x y z x+y+z 2 0 1 0 F(0,1,0) x yz x+y +z 3 0 1 1 F(0,1,1) x yz x+y +z 4 1 0 0 F(1,0,0) xy z x +y+z 5 1 0 1 F(1,0,1) xy z x +y+z 6 1 1 0 F(1,1,0) xyz x +y +z 7 1 1 1 F(1,1,1) xyz x +y +z 15

Boolean Representations Minterms and Maxterms Example Minterm is a product term that is 1 Maxterm is a sum term that is 0 What is the canonical sum? What is the canonical product? What is the minterm list? What is the maxterm list? row x y F 0 0 0 1 1 0 1 1 2 1 0 0 3 1 1 0 16

Boolean Representations Minterms and Maxterms Example Minterm is a product term that is 1 Maxterm is a sum term that is 0 Canonical sum: F=x y +x y Canonical product: F=(x +y) (x +y ) Minterm list: x,y (0,1) row x y F 0 0 0 1 1 0 1 1 2 1 0 0 3 1 1 0 note that book shows m Maxterm list: x,y (2,3) 17

Karnaugh Maps Overview Graphical method to simplify Boolean equations Also called K-maps Originally published by Edward W. Veitch in 1952 Further improved by Maurice Karnaugh in 1953 by extending Veitch s work to 3-dimensional arrays Generally more common for 3-4 variable functions Not practical for functions with many variables 18

Gray Code Overview One bit changes between two successive integers Shown below up to decimal 7 Decimal Binary Gray Gray as Decimal 0 000 000 0 1 001 001 1 2 010 011 3 3 011 010 2 4 100 110 6 5 101 111 7 6 110 101 5 7 111 100 4 19

Karnaugh Maps Overview K-maps: diagrammatic representation of truth table i.e. Boolean function One-variable k-map Two-variable k-map Three-variable k-map Four-variable k-map Five-variable k-map Six-variable k-map 20

Karnaugh Maps One-Variable K-map One-variable k-map has 2 1 cells x f (x) 0 f (0) x 0 1 1 f (1) f (0) f (1) 21

Karnaugh Maps Two-Variable K-map Two-variable k-map has 2 2 cells Neighborhood is based on 1 difference remember the gray code x y f (x, y) 0 0 f (0,0) 0 1 f (0,1) 1 0 f (1,0) 1 1 f (1,1) x 0 1 y 0 1 f (0,0) f (0,1) f (1,0) f (1,1) 22

Karnaugh Maps Two-Variable K-map Two-variable k-map has 2 2 cells Neighborhood is based on 1 difference remember the gray code Note that x and y can substitute for 2-variable case x y f (x, y) 0 0 f (0,0) 0 1 f (0,1) 1 0 f (1,0) 1 1 f (1,1) y 0 1 x 0 1 f (0,0) f (1,0) f (0,1) f (1,1) 23

Two-Variable K-map Example 1 Lets try to simplify f = x y + xy 24

Two-Variable K-map Example 1 Lets try to simplify f = x y + xy f = x y + xy = y (x + x) = y 25

Two-Variable K-map Example 1 Lets try to simplify f = x y + xy f = x y + xy = y (x + x) = y x y f (x, y) 0 0 1 0 1 0 1 0 1 1 1 0 26

Two-Variable K-map Example 1 Lets try to simplify f = x y + xy f = x y + xy = y (x + x) = y x y f (x, y) 0 0 1 0 1 0 1 0 1 1 1 0 y 0 1 x 0 1 1 1 0 0 27

Two-Variable K-map Example 1 Lets try to simplify f = x y + xy f = x y + xy = y (x + x) = y x y f (x, y) 0 0 1 0 1 0 1 0 1 1 1 0 y 0 1 x 0 1 1 1 0 0 Grouping of 1s: 2 0, 2 1, 2 2 28

Two-Variable K-map Example 1 Lets try to simplify f = x y + xy f = x y + xy = y (x + x) = y x y f (x, y) 0 0 1 0 1 0 1 0 1 1 1 0 y 0 1 x 0 1 1 1 0 0 If we group 1s, what would be the minimized f? 29

Two-Variable K-map Example 1 Lets try to simplify f = x y + xy f = x y + xy = y (x + x) = y x y f (x, y) 0 0 1 0 1 0 1 0 1 1 1 0 y 0 1 x 0 1 1 1 0 0 If we group 1s, the minimized f would be y 30

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy 31

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy x y f (x, y) 0 0 1 0 1 1 1 0 1 1 1 0 32

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy x y f (x, y) 0 0 1 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 1 1 1 0 33

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy x y f (x, y) 0 0 1 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 1 1 1 0 Note that a 1 can belong more than one group What is the minimized function f? 34

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy x y f (x, y) 0 0 1 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 1 1 1 0 Note that a 1 can belong more than one group The minimized function f = x + y 35

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy x y f (x, y) 0 0 1 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 1 1 1 0 Can we write the function as: f = x + y x? 36

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy x y f (x, y) 0 0 1 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 1 1 1 0 Can we write the function as: f = x + y x? Logically, both is same, but it is not minimized 37

Two-Variable K-map Example 2 Compare the circuits: x + y vs. x + y x 38

Two-Variable K-map Example 2 Compare the circuits: x + y vs. x + y x x + y : has 1 OR gate (excluding inverters) x + y x : has 1 OR and 1 AND gate (excluding inverters) 39

Two-Variable K-map Example 2 Lets try to simplify f = x y + x y + xy Use Boolean algebra to simplify above equation 40

Two-Variable K-map Example 3 Lets try to simplify f = x y + xy 41

Two-Variable K-map Example 3 Lets try to simplify f = x y + xy x y f (x, y) 0 0 0 0 1 1 1 0 1 1 1 0 42

Two-Variable K-map Example 3 Lets try to simplify f = x y + xy x y f (x, y) 0 0 0 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 0 1 1 0 43

Two-Variable K-map Example 3 Lets try to simplify f = x y + xy x y f (x, y) 0 0 0 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 0 1 1 0 44

Two-Variable K-map Example 3 Lets try to simplify f = x y + xy x y f (x, y) 0 0 0 0 1 1 1 0 1 1 1 0 x 0 1 y 0 1 0 1 1 0 It is not possible to group 1s Then, leave as is 45

Karnaugh Maps Three-Variable K-map Three-variable k-map has 2 3 cells Neighborhood is based on 1 variable difference x y z f (x, y, z) 0 0 0 f (0,0,0) 0 0 1 f (0,0,1) 0 1 0 f (0,1,0) 0 1 1 f (0,1,1) 1 0 0 f (1,0,0) 1 0 1 f (1,0,1) 1 1 0 f (1,1,0) 1 1 1 f (1,1,1) x 0 1 00 01 f (0,0,0) f (0,0,1) f (0,1,1) f (0,1,0) f (1,0,0) f (1,0,1) f (1,1,1) f (1,1,0) 46 yz 11 10

Three-Variable K-map Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f (x, y, z) 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 47

Three-Variable K-map Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f (x, y, z) 0 0 0 1 0 0 1 0 0 1 0 1 00 01 yz 11 10 0 1 1 0 1 0 0 1 x 0 1 1 0 1 1 1 1 0 0 1 1 1 0 48

Three-Variable K-map Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f (x, y, z) 0 0 0 1 0 0 1 0 0 1 0 1 00 01 yz 11 10 0 1 1 0 1 0 0 1 x 0 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 1 1 0 49

Three-Variable K-map Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f (x, y, z) 0 0 0 1 0 0 1 0 0 1 0 1 00 01 yz 11 10 0 1 1 0 1 0 0 1 x 0 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 1 1 0 50

Three-Variable K-map Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f (x, y, z) 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 F = x z + xy 1 1 1 0 x 0 1 00 01 1 0 0 1 1 1 0 0 51 yz 11 10

Three-Variable K-map Example 2 What s the minimized f(x,y,z) = (0,1,6,7)? Egemen K. Çetinkaya 52

Three-Variable K-map Example 2 What s the minimized f(x,y,z) = (0,1,6,7)? Egemen K. Çetinkaya 00 01 yz 11 10 x 0 1 53

Three-Variable K-map Example 2 What s the minimized f(x,y,z) = (0,1,6,7)? Egemen K. Çetinkaya 00 01 yz 11 10 x 0 1 1 1 0 0 0 0 1 1 54

Three-Variable K-map Example 2 What s the minimized f(x,y,z) = (0,1,6,7)? Egemen K. Çetinkaya 00 01 yz 11 10 x 0 1 1 1 0 0 0 0 1 1 55

Three-Variable K-map Example 2 What s the minimized f(x,y,z) = (0,1,6,7)? Egemen K. Çetinkaya 00 01 yz 11 10 x 0 1 1 1 0 0 0 0 1 1 F = x y + xy 56

Karnaugh Maps Simplification Rules Group together adjacent cells containing ones 1s grouping is done for a group of: 2 0, 2 1, 2 2 1s that means no 3, 5, 7 groupings Every one must be in at least one group Each group should be as large as possible Fewest number of groups possible Overlapping of 1s is allowed Zeros are not allowed unless you are doing sum terms Diagonal groupings are not allowed 57

Karnaugh Maps Four-Variable K-map Four-variable k-map has 2 4 cells Egemen K. Çetinkaya w x y z f (x, y, z) 0 0 0 0 f (0,0,0,0) 0 0 0 1 f (0,0,0,1) 0 0 1 0 f (0,0,1,0) 0 0 1 1 f (0,0,1,1) 0 1 0 0 f (0,1,0,0) 0 1 0 1 f (0,1,0,1) 0 1 1 0 f (0,1,1,0) 0 1 1 1 f (0,1,1,1) 1 0 0 0 f (0,0,0,0) 1 0 0 1 f (1,0,0,1) 1 0 1 0 f (1,0,1,0) 1 0 1 1 f (1,0,1,1) 1 1 0 0 f (1,1,0,0) 1 1 0 1 f (1,1,0,1) 1 1 1 0 f (1,1,1,0) 1 1 1 1 f (1,1,1,1) 58

Karnaugh Maps Four-Variable K-map Four-variable k-map has 2 4 cells w x y z f (x, y, z) 0 0 0 0 f (0,0,0,0) 0 0 0 1 f (0,0,0,1) 0 0 1 0 f (0,0,1,0) 00 01 yz 11 10 0 0 1 1 f (0,0,1,1) 0 1 0 0 f (0,1,0,0) 0 1 0 1 f (0,1,0,1) wx 00 01 11 10 f (0,0,0,0) f (0,0,0,1) f (0,0,1,1) f (0,0,1,0) f (0,1,0,0) f (0,1,0,1) f (0,1,1,1) f (0,1,1,0) f (1,1,0,0) f (1,1,0,1) f (1,1,1,1) f (1,1,1,0) f (1,0,0,0) f (1,0,0,1) f (1,0,1,1) f (1,0,1,0) 0 1 1 0 f (0,1,1,0) 0 1 1 1 f (0,1,1,1) 1 0 0 0 f (0,0,0,0) 1 0 0 1 f (1,0,0,1) 1 0 1 0 f (1,0,1,0) 1 0 1 1 f (1,0,1,1) 1 1 0 0 f (1,1,0,0) 1 1 0 1 f (1,1,0,1) 1 1 1 0 f (1,1,1,0) 1 1 1 1 f (1,1,1,1) 59

Karnaugh Maps Four-Variable K-map The grid is toroidally connected [ref: https://en.wikipedia.org/wiki/karnaugh_map] 60

Four-Variable K-map Typical One-Variable Elimination 1 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 0 0 0 0 wx 01 11 0 0 0 0 0 1 1 0 wx 01 11 0 1 0 0 0 1 0 0 10 0 0 0 0 10 0 0 0 0 61

Four-Variable K-map Typical One-Variable Elimination 1 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 0 0 0 0 wx 01 11 0 0 0 0 0 1 1 0 wx 01 11 0 1 0 0 0 1 0 0 10 0 0 0 0 10 0 0 0 0 F = wxz F = xy z 62

Four-Variable K-map Typical One-Variable Elimination 2 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 0 0 0 1 wx 01 11 1 0 0 1 0 0 0 0 wx 01 11 0 0 0 0 0 0 0 0 10 0 0 0 0 10 0 0 0 1 63

Four-Variable K-map Typical One-Variable Elimination 2 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 0 0 0 1 wx 01 11 1 0 0 1 0 0 0 0 wx 01 11 0 0 0 0 0 0 0 0 10 0 0 0 0 10 0 0 0 1 F = w xz F = x yz 64

Four-Variable K-map Typical Two-Variable Elimination 1 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 1 0 0 0 wx 01 11 0 0 0 0 0 0 1 1 wx 01 11 1 0 0 0 1 0 0 0 10 0 0 1 1 10 1 0 0 0 65

Four-Variable K-map Typical Two-Variable Elimination 1 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 1 0 0 0 wx 01 11 0 0 0 0 0 0 1 1 wx 01 11 1 0 0 0 1 0 0 0 10 0 0 1 1 10 1 0 0 0 F = wy F = y z 66

Four-Variable K-map Typical Two-Variable Elimination 2 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 1 0 0 1 wx 01 11 1 0 0 1 1 0 0 1 wx 01 11 0 0 0 0 0 0 0 0 10 0 0 0 0 10 1 0 0 1 67

Four-Variable K-map Typical Two-Variable Elimination 2 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 1 0 0 1 wx 01 11 1 0 0 1 1 0 0 1 wx 01 11 0 0 0 0 0 0 0 0 10 0 0 0 0 10 1 0 0 1 F = xz F = x z 68

Four-Variable K-map Typical Three-Variable Elimination 1 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 1 1 0 0 wx 01 11 0 0 0 0 1 1 1 1 wx 01 11 1 1 0 0 1 1 0 0 10 1 1 1 1 10 1 1 0 0 69

Four-Variable K-map Typical Three-Variable Elimination 1 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 0 0 0 0 00 1 1 0 0 wx 01 11 0 0 0 0 1 1 1 1 wx 01 11 1 1 0 0 1 1 0 0 10 1 1 1 1 10 1 1 0 0 F = w F = y 70

Four-Variable K-map Typical Three-Variable Elimination 2 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 1 1 1 1 00 1 0 0 1 wx 01 11 0 0 0 0 0 0 0 0 wx 01 11 1 0 0 1 1 0 0 1 10 1 1 1 1 10 1 0 0 1 71

Four-Variable K-map Typical Three-Variable Elimination 2 Simplified functions? yz yz 00 01 11 10 00 01 11 10 00 1 1 1 1 00 1 0 0 1 wx 01 11 0 0 0 0 0 0 0 0 wx 01 11 1 0 0 1 1 0 0 1 10 1 1 1 1 10 1 0 0 1 F = x F = z 72

Karnaugh Maps K-maps for Sum Terms Can we simplify Boolean functions using 0s? 73

Simplified functions? Karnaugh Maps K-maps for Sum Terms yz yz 00 01 11 10 00 01 11 10 00 1 1 1 1 00 1 0 0 1 wx 01 11 0 0 0 0 0 0 0 0 wx 01 11 1 1 1 1 1 1 1 1 10 1 1 1 1 10 1 0 0 1 74

Simplified functions? Karnaugh Maps K-maps for Sum Terms yz yz 00 01 11 10 00 01 11 10 00 1 1 1 1 00 1 0 0 1 wx 01 11 0 0 0 0 0 0 0 0 wx 01 11 1 1 1 1 1 1 1 1 10 1 1 1 1 10 1 0 0 1 F = x F = x + z 75

Karnaugh Maps Cell Designations 76

Karnaugh Maps K-maps Example 1 Simplified functions for F(w,x,y,z)= (0,2,4,6,12,14)? 77

Karnaugh Maps K-maps Example 1 Simplified functions for F(w,x,y,z)= (0,2,4,6,12,14)? yz yz 00 01 11 10 00 01 11 10 00 0 1 3 2 00???? wx 01 11 4 5 7 6 12 13 15 14 wx 01 11???????? 10 8 9 11 10 10???? 78

Karnaugh Maps K-maps Example 1 Simplified functions for F(w,x,y,z)= (0,2,4,6,12,14)? yz yz 00 01 11 10 00 01 11 10 00 0 1 3 2 00 1 0 0 1 wx 01 11 4 5 7 6 12 13 15 14 wx 01 11 1 0 0 1 1 0 0 1 10 8 9 11 10 10 0 0 0 0 79

Karnaugh Maps K-maps Example 1 Simplified functions for F(w,x,y,z)= (0,2,4,6,12,14)? yz yz 00 01 11 10 00 01 11 10 00 0 1 3 2 00 1 0 0 1 wx 01 11 4 5 7 6 12 13 15 14 wx 01 11 1 0 0 1 1 0 0 1 10 8 9 11 10 10 0 0 0 0 F = w z + xz 80

Karnaugh Maps Constructing n-bit Gray Code Construction can be done via reflect and prefix Egemen K. Çetinkaya [ref: https://en.wikipedia.org/wiki/gray_code] 81

Karnaugh Maps Five-Variable K-map Five-variable k-map has 2 5 cells 82

Karnaugh Maps Six-Variable K-map Six-variable k-map has 2 6 cells 83

Karnaugh Maps Many Variable K-maps can be useful in minimizing few variables Many variable functions can be challenging 84

Karnaugh Maps Don t Care Conditions Three-variable incomplete Boolean function example x y z f 0 0 0 1 0 0 1 0 0 1 0-0 1 1 0 1 0 0 1 1 0 1-1 1 0 0 1 1 1 0 x y z fˈ 0 0 0 0 0 0 1 1 0 1 0-0 1 1 1 1 0 0 0 1 0 1-1 1 0 1 1 1 1 1 85

Karnaugh Maps Don t Care Conditions Three-variable incomplete Boolean function example x y z f 0 0 0 1 0 0 1 0 0 1 0-0 1 1 0 1 0 0 1 1 0 1-1 1 0 0 1 1 1 0 don t care conditions x y z fˈ 0 0 0 0 0 0 1 1 0 1 0-0 1 1 1 1 0 0 0 1 0 1-1 1 0 1 1 1 1 1 86

Karnaugh Maps Don t Care Conditions Describing incomplete Boolean function example x y z f 0 0 0 1 0 0 1 0 0 1 0-0 1 1 0 1 0 0 1 1 0 1-1 1 0 0 1 1 1 0 minterm canonical formula f (x,y,z) = (0,4) + dc(2,5) maxterm canonical formula f (x,y,z) = (1,3,6,7) + dc(2,5) 87

Karnaugh Maps Don t Care Conditions Some input states never occur output states are irrelevant Input states may occur but output don t need to be specified In k-map, dc can be used for minterms or maxterms To simplify with dc conditions: assign a dc condition a 0 or 1, then simplify In a k-map, dc conditions are shown as: -, d, x 88

Don t Care Conditions Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f 0 0 0 1 0 0 1-0 1 0-0 1 1 0 1 0 0 1 1 0 1-1 1 0 0 1 1 1 0 89

Don t Care Conditions Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f 0 0 0 1 0 0 1-0 1 0-00 01 yz 11 10 0 1 1 0 1 0 0 1 x 0 1 1 0 1-1 1 0 0 1 1 1 0 90

Don t Care Conditions Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f 0 0 0 1 0 0 1-0 1 0-00 01 yz 11 10 0 1 1 0 1 0 0 1 x 0 1 1-0 - 1-0 0 1 0 1-1 1 0 0 1 1 1 0 91

Don t Care Conditions Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f 0 0 0 1 0 0 1-0 1 0-0 1 1 0 1 0 0 1 1 0 1-1 1 0 0 you can assign a dc a 0 or a 1 1 1 1 0 x 0 1 00 01 1-0 - 1-0 0 92 yz 11 10

Don t Care Conditions Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f 0 0 0 1 0 0 1-0 1 0-0 1 1 0 1 0 0 1 1 0 1-1 1 0 0 you can assign a dc a 0 or a 1 1 1 1 0 x 0 1 00 01 1 1 0 0 1 1 0 0 93 yz 11 10

Don t Care Conditions Example 1 What s the minimized function? Egemen K. Çetinkaya x y z f 0 0 0 1 0 0 1-0 1 0-0 1 1 0 1 0 0 1 1 0 1-1 1 0 0 F = y 1 1 1 0 x 0 1 00 01 1 1 0 0 1 1 0 0 94 yz 11 10

Minimization Strategies Other Methods Other than K-maps, methods exist for minimizing CAD-based tools (Computer Automated Design) heuristic: good solution, close to optimal but not necessarily optimal exact algorithm: yields optimal solution Cubical representations Tabular method (Quine-McCluskey) 95

Karnaugh Maps Example 96

Karnaugh Maps Example 97

Karnaugh Maps Example 98

Karnaugh Maps Summary Karnaugh maps used to simplify truth tables Group together adjacent cells containing ones 1s grouping is done for a group of: 2 0, 2 1, 2 2 1s Every one must be in at least one group Each group should be as large as possible Fewest number of groups possible Overlapping of 1s is allowed Zeros are not allowed Diagonal groupings are not allowed For DC conditions; assign a 0 or a 1 and then simplify 99

References and Further Reading [V2011] Frank Vahid, Digital Design with RTL Design, VHDL, and Verilog, 2nd edition, Wiley, 2011. [BV2009] Stephen Brown and Zvonko Vranesic, Fundamentals of Digital Logic with VHDL Design, 3rd edition, McGraw-Hill, 2009. [MKM2016] M. Morris Mano, Charles R. Kime, Tom Martin, Logic and Computer Design Fundamentals, 5th edition, Pearson, 2016. [W2006] John F. Wakerly, Digital Design Principles and Practices, 4th edition, Prentice Hall, 2006. [G2003] Donald D. Givone, Digital Principles and Design, McGraw-Hill, 2003. 100

End of Foils 101