Introduction to Digital Logic - Missouri University of...

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

Transcript of Introduction to Digital Logic - Missouri University of...

Page 1: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Introduction to Digital Logic Missouri S&T University CPE 2210

Karnaugh Maps

Egemen K. Çetinkaya

Department of Electrical & Computer Engineering

Missouri University of Science and Technology

[email protected]

http://web.mst.edu/~cetinkayae/teaching/CPE2210Fall2016

16 September 2016 rev. 16.0 © 2014–2016 Egemen K. Çetinkaya

Page 2: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Outline

• Introduction

• Karnaugh maps

• Incomplete Boolean functions

• Summary

MST CPE2210 – Karnaugh Maps 16 September 2016 2

Page 3: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Boolean Representations Mappings

• Equations

– 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.

MST CPE2210 – Karnaugh Maps 16 September 2016 3

F x

x F

0 1

1 0

Page 4: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Boolean Algebra Theorems

• Commutativity

• Distributivity

• Associativity

• Identity

• Complementery

• Null elements

• Idempotent law

• Involution law

• DeMorgan’s law

• Absorption law

MST CPE2210 – Karnaugh Maps 16 September 2016 4

Page 5: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Boolean Representations Terminology Example

• F(a,b,c)=ab+c+ac’

• What are the variables?

• What are the literals?

• What are the product terms?

MST CPE2210 – Karnaugh Maps 16 September 2016 5

Page 6: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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’

MST CPE2210 – Karnaugh Maps 16 September 2016 6

Page 7: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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

MST CPE2210 – Karnaugh Maps 16 September 2016 7

Page 8: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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

MST CPE2210 – Karnaugh Maps 16 September 2016 8

Page 9: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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’

MST CPE2210 – Karnaugh Maps 16 September 2016 9

Page 10: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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

MST CPE2210 – Karnaugh Maps 16 September 2016 10

Page 11: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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’

MST CPE2210 – Karnaugh Maps 16 September 2016 11

Page 12: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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

MST CPE2210 – Karnaugh Maps 16 September 2016 12

Page 13: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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’)

MST CPE2210 – Karnaugh Maps 16 September 2016 13

Page 14: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Boolean Representations Minterms and Maxterms

• Minterm is a product term that is 1

• Maxterm is a sum term that is 0

MST CPE2210 – Karnaugh Maps 16 September 2016 14

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) ? ?

Page 15: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Boolean Representations Minterms and Maxterms

• Minterm is a product term that is 1

• Maxterm is a sum term that is 0

MST CPE2210 – Karnaugh Maps 16 September 2016 15

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’

Page 16: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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?

MST CPE2210 – Karnaugh Maps 16 September 2016 16

row x y F

0 0 0 1

1 0 1 1

2 1 0 0

3 1 1 0

Page 17: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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)

– note that book shows ∑m

• Maxterm list: ∏x,y (2,3)

MST CPE2210 – Karnaugh Maps 16 September 2016 17

row x y F

0 0 0 1

1 0 1 1

2 1 0 0

3 1 1 0

Page 18: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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

MST CPE2210 – Karnaugh Maps 16 September 2016 18

Page 19: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Gray Code Overview

• One bit changes between two successive integers

• Shown below up to decimal 7

MST CPE2210 – Karnaugh Maps 16 September 2016 19

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

Page 20: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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

MST CPE2210 – Karnaugh Maps 16 September 2016 20

Page 21: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps One-Variable K-map

• One-variable k-map has 21 cells

MST CPE2210 – Karnaugh Maps 16 September 2016 21

x f (x)

0 f (0)

1 f (1) f (0) f (1)

x 0 1

Page 22: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Two-Variable K-map

• Two-variable k-map has 22 cells

• Neighborhood is based on 1 difference

– remember the gray code

MST CPE2210 – Karnaugh Maps 16 September 2016 22

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)

f (0,0) f (0,1)

f (1,0) f (1,1)

y 0 1

0

1 x

Page 23: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Two-Variable K-map

• Two-variable k-map has 22 cells

• Neighborhood is based on 1 difference

– remember the gray code

• Note that x and y can substitute for 2-variable case

MST CPE2210 – Karnaugh Maps 16 September 2016 23

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)

f (0,0) f (1,0)

f (0,1) f (1,1)

x 0 1

0

1 y

Page 24: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 1

• Lets try to simplify f = x’y’ + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 24

Page 25: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 1

• Lets try to simplify f = x’y’ + xy’

• f = x’y’ + xy’ = y’ (x’ + x) = y’

MST CPE2210 – Karnaugh Maps 16 September 2016 25

Page 26: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 1

• Lets try to simplify f = x’y’ + xy’

• f = x’y’ + xy’ = y’ (x’ + x) = y’

MST CPE2210 – Karnaugh Maps 16 September 2016 26

x y f (x, y)

0 0 1

0 1 0

1 0 1

1 1 0

Page 27: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 1

• Lets try to simplify f = x’y’ + xy’

• f = x’y’ + xy’ = y’ (x’ + x) = y’

MST CPE2210 – Karnaugh Maps 16 September 2016 27

x y f (x, y)

0 0 1

0 1 0

1 0 1

1 1 0

1 1

0 0

x 0 1

0

1 y

Page 28: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 1

• Lets try to simplify f = x’y’ + xy’

• f = x’y’ + xy’ = y’ (x’ + x) = y’

• Grouping of 1s: 20, 21, 22

MST CPE2210 – Karnaugh Maps 16 September 2016 28

x y f (x, y)

0 0 1

0 1 0

1 0 1

1 1 0

1 1

0 0

x 0 1

0

1 y

Page 29: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 1

• Lets try to simplify f = x’y’ + xy’

• f = x’y’ + xy’ = y’ (x’ + x) = y’

• If we group 1s, what would be the minimized f?

MST CPE2210 – Karnaugh Maps 16 September 2016 29

x y f (x, y)

0 0 1

0 1 0

1 0 1

1 1 0

1 1

0 0

x 0 1

0

1 y

Page 30: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 1

• Lets try to simplify f = x’y’ + xy’

• f = x’y’ + xy’ = y’ (x’ + x) = y’

• If we group 1s, the minimized f would be y’

MST CPE2210 – Karnaugh Maps 16 September 2016 30

x y f (x, y)

0 0 1

0 1 0

1 0 1

1 1 0

1 1

0 0

x 0 1

0

1 y

Page 31: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 31

Page 32: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 32

x y f (x, y)

0 0 1

0 1 1

1 0 1

1 1 0

Page 33: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 33

x y f (x, y)

0 0 1

0 1 1

1 0 1

1 1 0

1 1

1 0

y 0 1

0

1 x

Page 34: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

• Note that a 1 can belong more than one group

• What is the minimized function f?

MST CPE2210 – Karnaugh Maps 16 September 2016 34

x y f (x, y)

0 0 1

0 1 1

1 0 1

1 1 0

1 1

1 0

y 0 1

0

1 x

Page 35: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

• Note that a 1 can belong more than one group

• The minimized function f = x’ + y’

MST CPE2210 – Karnaugh Maps 16 September 2016 35

x y f (x, y)

0 0 1

0 1 1

1 0 1

1 1 0

1 1

1 0

y 0 1

0

1 x

Page 36: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

• Can we write the function as: f = x’ + y’x ?

MST CPE2210 – Karnaugh Maps 16 September 2016 36

x y f (x, y)

0 0 1

0 1 1

1 0 1

1 1 0

1 1

1 0

y 0 1

0

1 x

Page 37: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

• Can we write the function as: f = x’ + y’x ?

• Logically, both is same, but it is not minimized

MST CPE2210 – Karnaugh Maps 16 September 2016 37

x y f (x, y)

0 0 1

0 1 1

1 0 1

1 1 0

1 1

1 0

y 0 1

0

1 x

Page 38: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Compare the circuits: x’ + y’ vs. x’ + y’x

MST CPE2210 – Karnaugh Maps 16 September 2016 38

Page 39: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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)

MST CPE2210 – Karnaugh Maps 16 September 2016 39

Page 40: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 2

• Lets try to simplify f = x’y’ + x’y + xy’

• Use Boolean algebra to simplify above equation

MST CPE2210 – Karnaugh Maps 16 September 2016 40

Page 41: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 3

• Lets try to simplify f = x’y + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 41

Page 42: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 3

• Lets try to simplify f = x’y + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 42

x y f (x, y)

0 0 0

0 1 1

1 0 1

1 1 0

Page 43: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 3

• Lets try to simplify f = x’y + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 43

x y f (x, y)

0 0 0

0 1 1

1 0 1

1 1 0

0 1

1 0

y 0 1

0

1 x

Page 44: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 3

• Lets try to simplify f = x’y + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 44

x y f (x, y)

0 0 0

0 1 1

1 0 1

1 1 0

0 1

1 0

y 0 1

0

1 x

Page 45: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Two-Variable K-map Example 3

• Lets try to simplify f = x’y + xy’

• It is not possible to group 1s

• Then, leave as is

MST CPE2210 – Karnaugh Maps 16 September 2016 45

x y f (x, y)

0 0 0

0 1 1

1 0 1

1 1 0

0 1

1 0

y 0 1

0

1 x

Page 46: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Three-Variable K-map

• Three-variable k-map has 23 cells

• Neighborhood is based on 1 variable difference

MST CPE2210 – Karnaugh Maps 16 September 2016 46

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)

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)

yz 00 01

0

1 x

11 10

Page 47: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 1

• What’s the minimized function?

MST CPE2210 – Karnaugh Maps 16 September 2016 47

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

Page 48: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 1

• What’s the minimized function?

MST CPE2210 – Karnaugh Maps 16 September 2016 48

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

yz 00 01

0

1 x

11 10

Page 49: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 1

• What’s the minimized function?

MST CPE2210 – Karnaugh Maps 16 September 2016 49

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

1 0 0 1

1 1 0 0

yz 00 01

0

1 x

11 10

Page 50: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 1

• What’s the minimized function?

MST CPE2210 – Karnaugh Maps 16 September 2016 50

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

1 0 0 1

1 1 0 0

yz 00 01

0

1 x

11 10

Page 51: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 1

• What’s the minimized function?

• F = x’z’ + xy’

MST CPE2210 – Karnaugh Maps 16 September 2016 51

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

1 0 0 1

1 1 0 0

yz 00 01

0

1 x

11 10

Page 52: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 2

• What’s the minimized f(x,y,z) = ∑ (0,1,6,7) ?

MST CPE2210 – Karnaugh Maps 16 September 2016 52

Page 53: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 2

• What’s the minimized f(x,y,z) = ∑ (0,1,6,7) ?

MST CPE2210 – Karnaugh Maps 16 September 2016 53

yz 00 01

0

1 x

11 10

Page 54: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 2

• What’s the minimized f(x,y,z) = ∑ (0,1,6,7) ?

MST CPE2210 – Karnaugh Maps 16 September 2016 54

1 1 0 0

0 0 1 1

yz 00 01

0

1 x

11 10

Page 55: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 2

• What’s the minimized f(x,y,z) = ∑ (0,1,6,7) ?

MST CPE2210 – Karnaugh Maps 16 September 2016 55

1 1 0 0

0 0 1 1

yz 00 01

0

1 x

11 10

Page 56: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Three-Variable K-map Example 2

• What’s the minimized f(x,y,z) = ∑ (0,1,6,7) ?

• F = x’y’ + xy

MST CPE2210 – Karnaugh Maps 16 September 2016 56

1 1 0 0

0 0 1 1

yz 00 01

0

1 x

11 10

Page 57: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Simplification Rules

• Group together adjacent cells containing ones

• 1s grouping is done for a group of: 20, 21, 22 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

MST CPE2210 – Karnaugh Maps 16 September 2016 57

Page 58: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Four-Variable K-map

• Four-variable k-map has 24 cells

MST CPE2210 – Karnaugh Maps 16 September 2016 58

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)

Page 59: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Four-Variable K-map

• Four-variable k-map has 24 cells

MST CPE2210 – Karnaugh Maps 16 September 2016 59

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)

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)

yz

00 01

00

01 wx

11 10

11

10

Page 60: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Four-Variable K-map

• The grid is toroidally connected

[ref: https://en.wikipedia.org/wiki/Karnaugh_map]

MST CPE2210 – Karnaugh Maps 16 September 2016 60

Page 61: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical One-Variable Elimination1

• Simplified functions?

MST CPE2210 – Karnaugh Maps 16 September 2016 61

0 0 0 0

0 0 0 0

0 1 1 0

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

0 0 0 0

0 1 0 0

0 1 0 0

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 62: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical One-Variable Elimination1

• Simplified functions?

F = wxz F = xy’z

MST CPE2210 – Karnaugh Maps 16 September 2016 62

0 0 0 0

0 0 0 0

0 1 1 0

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

0 0 0 0

0 1 0 0

0 1 0 0

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 63: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical One-Variable Elimination2

• Simplified functions?

MST CPE2210 – Karnaugh Maps 16 September 2016 63

0 0 0 0

1 0 0 1

0 0 0 0

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

0 0 0 1

0 0 0 0

0 0 0 0

0 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 64: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical One-Variable Elimination2

• Simplified functions?

F = w’xz’ F = x’yz’

MST CPE2210 – Karnaugh Maps 16 September 2016 64

0 0 0 0

1 0 0 1

0 0 0 0

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

0 0 0 1

0 0 0 0

0 0 0 0

0 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 65: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Two-Variable Elimination1

• Simplified functions?

MST CPE2210 – Karnaugh Maps 16 September 2016 65

0 0 0 0

0 0 0 0

0 0 1 1

0 0 1 1

yz

00 01

00

01 wx

11 10

11

10

1 0 0 0

1 0 0 0

1 0 0 0

1 0 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 66: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Two-Variable Elimination1

• Simplified functions?

F = wy F = y’z’

MST CPE2210 – Karnaugh Maps 16 September 2016 66

0 0 0 0

0 0 0 0

0 0 1 1

0 0 1 1

yz

00 01

00

01 wx

11 10

11

10

1 0 0 0

1 0 0 0

1 0 0 0

1 0 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 67: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Two-Variable Elimination2

• Simplified functions?

MST CPE2210 – Karnaugh Maps 16 September 2016 67

0 0 0 0

1 0 0 1

1 0 0 1

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

0 0 0 0

0 0 0 0

1 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 68: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Two-Variable Elimination2

• Simplified functions?

F = xz’ F = x’z’

MST CPE2210 – Karnaugh Maps 16 September 2016 68

0 0 0 0

1 0 0 1

1 0 0 1

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

0 0 0 0

0 0 0 0

1 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 69: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Three-Variable Elimination1

• Simplified functions?

MST CPE2210 – Karnaugh Maps 16 September 2016 69

0 0 0 0

0 0 0 0

1 1 1 1

1 1 1 1

yz

00 01

00

01 wx

11 10

11

10

1 1 0 0

1 1 0 0

1 1 0 0

1 1 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 70: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Three-Variable Elimination1

• Simplified functions?

F = w F = y’

MST CPE2210 – Karnaugh Maps 16 September 2016 70

0 0 0 0

0 0 0 0

1 1 1 1

1 1 1 1

yz

00 01

00

01 wx

11 10

11

10

1 1 0 0

1 1 0 0

1 1 0 0

1 1 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 71: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Three-Variable Elimination2

• Simplified functions?

MST CPE2210 – Karnaugh Maps 16 September 2016 71

1 1 1 1

0 0 0 0

0 0 0 0

1 1 1 1

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

1 0 0 1

1 0 0 1

1 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 72: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Four-Variable K-map Typical Three-Variable Elimination2

• Simplified functions?

F = x’ F = z’

MST CPE2210 – Karnaugh Maps 16 September 2016 72

1 1 1 1

0 0 0 0

0 0 0 0

1 1 1 1

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

1 0 0 1

1 0 0 1

1 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 73: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps K-maps for Sum Terms

• Can we simplify Boolean functions using 0s?

MST CPE2210 – Karnaugh Maps 16 September 2016 73

Page 74: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps K-maps for Sum Terms

• Simplified functions?

MST CPE2210 – Karnaugh Maps 16 September 2016 74

1 1 1 1

0 0 0 0

0 0 0 0

1 1 1 1

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

1 1 1 1

1 1 1 1

1 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 75: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps K-maps for Sum Terms

• Simplified functions?

F = x’ F = x + z’

MST CPE2210 – Karnaugh Maps 16 September 2016 75

1 1 1 1

0 0 0 0

0 0 0 0

1 1 1 1

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

1 1 1 1

1 1 1 1

1 0 0 1

yz

00 01

00

01 wx

11 10

11

10

Page 76: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Cell Designations

MST CPE2210 – Karnaugh Maps 16 September 2016 76

Page 77: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps K-maps Example 1

• Simplified functions for F(w,x,y,z)=∑(0,2,4,6,12,14) ?

MST CPE2210 – Karnaugh Maps 16 September 2016 77

Page 78: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps K-maps Example 1

• Simplified functions for F(w,x,y,z)=∑(0,2,4,6,12,14) ?

MST CPE2210 – Karnaugh Maps 16 September 2016 78

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

yz

00 01

00

01 wx

11 10

11

10

? ? ? ?

? ? ? ?

? ? ? ?

? ? ? ?

yz

00 01

00

01 wx

11 10

11

10

Page 79: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps K-maps Example 1

• Simplified functions for F(w,x,y,z)=∑(0,2,4,6,12,14) ?

MST CPE2210 – Karnaugh Maps 16 September 2016 79

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

1 0 0 1

1 0 0 1

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 80: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps K-maps Example 1

• Simplified functions for F(w,x,y,z)=∑(0,2,4,6,12,14) ?

F = w’z’ + xz’

MST CPE2210 – Karnaugh Maps 16 September 2016 80

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

yz

00 01

00

01 wx

11 10

11

10

1 0 0 1

1 0 0 1

1 0 0 1

0 0 0 0

yz

00 01

00

01 wx

11 10

11

10

Page 81: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Constructing n-bit Gray Code

• Construction can be done via reflect and prefix

[ref: https://en.wikipedia.org/wiki/Gray_code]

MST CPE2210 – Karnaugh Maps 16 September 2016 81

Page 82: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Five-Variable K-map

• Five-variable k-map has 25 cells

MST CPE2210 – Karnaugh Maps 16 September 2016 82

Page 83: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Six-Variable K-map

• Six-variable k-map has 26 cells

MST CPE2210 – Karnaugh Maps 16 September 2016 83

Page 84: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Many Variable

• K-maps can be useful in minimizing few variables

• Many variable functions can be challenging

MST CPE2210 – Karnaugh Maps 16 September 2016 84

Page 85: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Don’t Care Conditions

• Three-variable incomplete Boolean function example

MST CPE2210 – Karnaugh Maps 16 September 2016 85

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

Page 86: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Don’t Care Conditions

• Three-variable incomplete Boolean function example

don’t care conditions

MST CPE2210 – Karnaugh Maps 16 September 2016 86

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

Page 87: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Don’t Care Conditions

• Describing incomplete Boolean function example

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)

MST CPE2210 – Karnaugh Maps 16 September 2016 87

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

Page 88: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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

MST CPE2210 – Karnaugh Maps 16 September 2016 88

Page 89: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Don’t Care Conditions Example 1

• What’s the minimized function?

MST CPE2210 – Karnaugh Maps 16 September 2016 89

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

Page 90: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Don’t Care Conditions Example 1

• What’s the minimized function?

MST CPE2210 – Karnaugh Maps 16 September 2016 90

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

yz 00 01

0

1 x

11 10

Page 91: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Don’t Care Conditions Example 1

• What’s the minimized function?

MST CPE2210 – Karnaugh Maps 16 September 2016 91

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

1 - 0 -

1 - 0 0

yz 00 01

0

1 x

11 10

Page 92: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Don’t Care Conditions Example 1

• What’s the minimized function?

• you can assign a dc a 0 or a 1

MST CPE2210 – Karnaugh Maps 16 September 2016 92

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

1 - 0 -

1 - 0 0

yz 00 01

0

1 x

11 10

Page 93: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Don’t Care Conditions Example 1

• What’s the minimized function?

• you can assign a dc a 0 or a 1

MST CPE2210 – Karnaugh Maps 16 September 2016 93

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

1 1 0 0

1 1 0 0

yz 00 01

0

1 x

11 10

Page 94: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Don’t Care Conditions Example 1

• What’s the minimized function?

• F = y’

MST CPE2210 – Karnaugh Maps 16 September 2016 94

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

1 1 0 0

1 1 0 0

yz 00 01

0

1 x

11 10

Page 95: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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)

MST CPE2210 – Karnaugh Maps 16 September 2016 95

Page 96: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Example

MST CPE2210 – Karnaugh Maps 16 September 2016 96

Page 97: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Example

MST CPE2210 – Karnaugh Maps 16 September 2016 97

Page 98: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Example

MST CPE2210 – Karnaugh Maps 16 September 2016 98

Page 99: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

Karnaugh Maps Summary

• Karnaugh maps used to simplify truth tables

• Group together adjacent cells containing ones

• 1s grouping is done for a group of: 20, 21, 22 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 MST CPE2210 – Karnaugh Maps 16 September 2016 99

Page 100: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

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.

MST CPE2210 – Karnaugh Maps 16 September 2016 100

Page 101: Introduction to Digital Logic - Missouri University of ...web.mst.edu/.../CPE2210-F2016-karnaugh-maps-annotated.pdf · Introduction to Digital Logic ... • Karnaugh maps • Incomplete

© Egemen K. Çetinkaya

End of Foils

MST CPE2210 – Karnaugh Maps 16 September 2016 101