= = + + f m ( 1 , 2 , 3 ) x x x x x x 1 0 0 1 - - PowerPoint PPT Presentation

f m 1 2 3 x x x x x x 1 0 0 1 1 0 william sandqvist
SMART_READER_LITE
LIVE PREVIEW

= = + + f m ( 1 , 2 , 3 ) x x x x x x 1 0 0 1 - - PowerPoint PPT Presentation

Minterms A minterm is a product of all OR variables and it describes the x x f combination of 1 and 0 that 1 0 toghether makes the term to 0 0 0 0 adopt the value 1. 1 0 1 1 2 1 0 1 SoP-form with three minterms. 3


slide-1
SLIDE 1

Minterms

1 1 1

) 3 , 2 , 1 ( x x x x x x m f + + = =∑

William Sandqvist william@kth.se

1 1 1 1 1 1 1 3 2 1

1

f x x

OR

A minterm is a product of all variables and it describes the combination of ”1” and ”0” that toghether makes the term to adopt the value 1.

SoP-form with three minterms.

slide-2
SLIDE 2

Minimization with Boolean algebra

1 1 1

) 3 , 2 , 1 ( x x x x x x m f + + = =∑

William Sandqvist william@kth.se

1 1 1 1 1 1 1 3 2 1

1

f x x

OR Simplification with boolean algebra

1 1 1 1 1 1 1 1 1 1 1 1 1

) ( ) 1 ( ...) 1 ( ) ( x x x x x x x x x x x x x x x x x x x x x x x + = = + + = = + + = = + + = = + + = = + + =

As expected!

slide-3
SLIDE 3

Maxterm

William Sandqvist william@kth.se

1 1 1 1 1 1 1 3 2 1

1

f x x

OR

A maxterm är en sum-factor of all variables and it describes the combination of ”1” and ”0” that toghether makes the sum to adopt the value 0.

1

) ( x x M f + = =∏

This time we got the simple expression direct with the maxterm!

slide-4
SLIDE 4

Venn-diagram

OR In a Venn diagram, one can see that a function can be expressed in a variety of ways, but it is not easy to see what is optimal. Another question is also how to draw Venn diagrams for more than three variables??

William Sandqvist william@kth.se

All minterms OR, some of the minterms

slide-5
SLIDE 5

Graphical minimization method

William Sandqvist william@kth.se

1 1 1 1 1 1 1 3 2 1

1

f x x

OR

0 1 1 1

x0 x1 1 0 1

m0 m1 m2 m3

x0 x1 1 0 1

1 1 1 1 3 2

) ( x x x x x x x x m m = + = = + = +

1 1 1 1 3 1

) ( x x x x x x x x m m = + = = + = +

1

x x f + =

slide-6
SLIDE 6

Graphical minimization method

William Sandqvist william@kth.se

1 1 1 1 1 1 1 3 2 1

1

f x x

OR

0 1 1 1

x0 x1 1 0 1

1

x x f + =

Make ”groups” two ones that are "neighbors" (vertically or horizontally) the minterms could then be reduced to "what they have in common".

1

x x

slide-7
SLIDE 7

Gate functions Graphical form

William Sandqvist william@kth.se

0 0 0 1 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 0 1 0 0 1

AND OR XOR NAND NOR XNOR

x0 x1 1 0 1 x0 x1 1 0 1 x0 x1 1 0 1 x0 x1 1 0 1 x0 x1 1 0 1 x0 x1 1 0 1

1

x x +

1 x

x ⋅

1 1

x x x x +

{ }

1 1

x x dM x x + ⋅

{ }

1 1

x x dM x x ⋅ +

1 1

x x x x +

slide-8
SLIDE 8

3D boolean numberspace

William Sandqvist william@kth.se

The corners are coded with Gray-code. Between neighbor corners only one variable differs.

slide-9
SLIDE 9
  • Ex. 3.4 Cube representation

William Sandqvist william@kth.se 1 2 1 2 1 2 1 2 1 2 1 2

) 6 , 4 , 3 , 2 , ( ) , , ( x x x x x x x x x x x x x x x m x x x f + + + + = = =∑ This is the way to represent a function

  • f three variables,
  • n a 3D cube with

Gray-coded corners.

slide-10
SLIDE 10
  • Ex. 3.4 minimization with cube

William Sandqvist william@kth.se

A surface is represented by a variable, a side of a product term with two variables, and a corner a minterm with three

  • variables. Cube methods can be generalized to "Hyper Cubes"

with any number of variables.

1 2

x x x x

1 2x

x

slide-11
SLIDE 11

Hypercubes

William Sandqvist william@kth.se

A corner is a 0-dimension subspace, A side is a 1-dimension subspace, A surface is a 2-dimension subspace, A cube is a 3-dimension subspace … There are minimization methods for hypercubes and they can apply for any number of variables! The methods based on hypercubes are suited to computer algorithms.

slide-12
SLIDE 12

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-13
SLIDE 13

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-14
SLIDE 14

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-15
SLIDE 15

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-16
SLIDE 16

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-17
SLIDE 17

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-18
SLIDE 18

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-19
SLIDE 19

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-20
SLIDE 20

William Sandqvist william@kth.se

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-21
SLIDE 21

William Sandqvist william@kth.se

And so on …

Graycode is a mirrored binarycode

One can easily construct a Gray code with an arbitrary number

  • f bits needed for numbering the

"corners" in "hypercubes" with!

slide-22
SLIDE 22

How do you draw a 3D-cube?

William Sandqvist william@kth.se

You draw two 2D-cubes ( = squares), and then connects their corners.

slide-23
SLIDE 23

William Sandqvist william@kth.se

How do you draw a 3D-cube?

You draw two 2D-cubes ( = squares), and then connects their corners.

slide-24
SLIDE 24

How do You draw a 4D-cube?

William Sandqvist william@kth.se

You draw two 3D-cubes (=cubes), and then connects their corners.

slide-25
SLIDE 25

William Sandqvist william@kth.se

How do You draw a 4D-cube?

You draw two 3D-cubes (=cubes), and then connects their corners.

slide-26
SLIDE 26

4D-cube in Paris

William Sandqvist william@kth.se

slide-27
SLIDE 27

4D-Donut

William Sandqvist william@kth.se

4D-hypercube can be represented by a torus, a donut.

slide-28
SLIDE 28

4D-cubes in USA

William Sandqvist william@kth.se

slide-29
SLIDE 29

3D-cube ⇒ 2D-map

William Sandqvist william@kth.se

00 a b c a 1 b c 01 11 10

Gray-code → mirror b = 0 b = 1

000 001 100 101 011 010 111 110

slide-30
SLIDE 30

Karnaugh-map

William Sandqvist william@kth.se

Graphical method for minimization with "paper and pencil" minor Boolean functions? (For up to six variables)

Maurice Karnaugh ( The Map for Synthesis of Combinational Logic Circuits, AIEE, Nov. 1953 )

slide-31
SLIDE 31

William Sandqvist william@kth.se

A function of four variables a b c d.

Truth Table with 11 ”1” and 5 ”0”. The function can be expressed in SoP-form with 11 minterms or in PoS-form with 5 maxterms.

slide-32
SLIDE 32

William Sandqvist william@kth.se

4D-cube ⇒ 2D-map

The Karnaugh map is the truth table lined up in a different way. The frames are ordered in such way that only one bit changes between two vertical frames or horisontal frames. This order is called Gray-code.

slide-33
SLIDE 33

William Sandqvist william@kth.se

Two "neighbors"

The frames "5" and "13" are "neighbors" in the Karnaugh map ( but they are distant from each

  • ther in the truthtable ).

They correspond to two minterms with four variables, and the figure shows how, with Boolean algebra, they can be reduced to one term with three variables. What the two frames have in common is that b = 1, c = 0 and d = 1; and the reduced term expresses just that. Everywhere in the Karnaugh map where one can find two ones that are "neighbors" (vertically or horizontally) the minterms could be reduced to "what they have in common". This is called a grouping.

d c b

slide-34
SLIDE 34

William Sandqvist william@kth.se

Four "neighbors"

Frames "1" "3" "5" "7" is a group of four frames with "1" that are "neighbors" to each

  • ther. Here too, the four

minterms could be reduced to a term that expresses what is common for the frames, namely that a = 0 and d = 1. Everywhere in Karnaugh map where one can find such groups of four ones such simplifications can be done, grouping of four.

d a

slide-35
SLIDE 35

William Sandqvist william@kth.se

Eight "neighbors"

All groups of 2, 4, 8, (... 2 N ie. powers of 2) frames containing ones can be reduced to a term, with what they have in common, grouping of n.

a

slide-36
SLIDE 36

William Sandqvist william@kth.se

Karnaugh - toros

The Karnaugh map should be drawn on a torus (a donut). When we reach an edge, the graph continnues from the opposite side! Frame 0 is the "neighbor" with frame 2, but also the "neighbor" with frame 8 which is "neighbor" to frame 10.

d b

4 12 5 13 7 15

slide-37
SLIDE 37

The optimal groupings?

One is looking for the bigest grouping as

  • possible. In the example,

there is a grouping with eight ones (frames 0, 1, 3, 2, 4, 5, 7, 6). Corners (0, 2, 8, 10) is a group of four

  • nes.

Two of the frames (0.10) has already been included in the first group, but it does not matter if a minterm is included multiple times. All ones in the logic function must either be in a grouping, or be included as a minterm. The "1" in frame 13 may form a group with "1" in frame 5, unfortunately there are no bigger grouping for this "1".

William Sandqvist william@kth.se

d c b d b a d c b a f + + = ) , , , (

slide-38
SLIDE 38

William Sandqvist william@kth.se

Grouping of "0"

The Karnaugh map is also useful for groupings of 0's. The groupings may include the same number of frames as the case of groupings of 1's. In this example, 0: s are grouped together in pairs with their "neighbors". Maxterms are simplified to what is in common for the frames.

) )( )( ( ) , , , ( d b a d c a d b a d c b a f + + + + + + =

slide-39
SLIDE 39

William Sandqvist william@kth.se

Maps for other number of variables

Karnaugh maps with three and two variables are also useful. The Karnaugh map can conveniently be used for functions of up to four variables, and with a little practice up to six variables.

6

slide-40
SLIDE 40

Minimization Example

William Sandqvist william@kth.se

000 100 010 110 101 011 111

a b c

1 1 1 1 1

00 01 1 11 10 bc a

001

) 7 , 5 , 3 , 2 , ( ) , , (

= m c b a f

1 3 2 4 5 7 6

2 5 3 7

slide-41
SLIDE 41

Implicants

William Sandqvist william@kth.se

000 100 010 110 101 011 111

a b c

1 1 1 1 1

00 01 1 11 10 bc a

Circle the adjacent min-terms

001

) 7 , 5 , 3 , 2 , ( ) , , (

= m c b a f

slide-42
SLIDE 42

Little implicant terminology

William Sandqvist william@kth.se

  • Implicant – a group of min-terms
  • Prime-implicant – a group of minterms that cant be

made bigger.

  • Essential prime-implicant – must be included in order to

cover the function.

  • Redundant prime-implicant – must not be included, the

function can be covered by other implicants.

slide-43
SLIDE 43

Implicants

William Sandqvist william@kth.se

000 100 010 110 101 011 111

a b c

1 1 1 1 1

00 01 1 11 10 bc a

Redundant implicants - not both are necessary (one of them must be in- cluded) to cover the function.

001

) 7 , 5 , 3 , 2 , ( ) , , (

= m c b a f ac b a c a f ac bc c a f + + = + + =

slide-44
SLIDE 44

Two-level minimization

William Sandqvist william@kth.se

slide-45
SLIDE 45

Minimal Sum-Product Implementation

William Sandqvist william@kth.se

a b c f

1 1 1 1 1

00 01 1 11 10 bc a

) 7 , 5 , 3 , 2 , ( ) , , (

= m c b a f ac bc c a f + + =

slide-46
SLIDE 46

Programmable Logic Array (PLA)

William Sandqvist william@kth.se

Programmable AND and OR - matrix. The programming consists

  • f "burning fuses" to

the connections you do not want. (now an obsolete technology)

slide-47
SLIDE 47

Programmable Logic Array (PLA)

William Sandqvist william@kth.se

The Gate-matrix has so many inputs that one use to drav the circuit in a simplified way.

slide-48
SLIDE 48

Programmable Logic Array (PLA)

OR plane AND plane

William Sandqvist william@kth.se

  • PLA. Both

AND- and OR- matrix are programable ( a flexibility that costs )

1

x

2

x

3

x

1

f

2

f

1

P

2

P

3

P

4

P

Simplified drawing

slide-49
SLIDE 49

Programmable Array Logic (PAL)

William Sandqvist william@kth.se 1

x

2

x

3

x

1

P

2

P

3

P

4

P

1

f

2

f

  • PAL. Only the

AND-matrix is programable. (an economic compromise)

slide-50
SLIDE 50

PAL, what functions hides behind the crosses?

William Sandqvist william@kth.se 1

x

2

x

3

x

1

P

2

P

3

P

4

P

1

f

2

f

? ?

slide-51
SLIDE 51

Sub-cube with four varibles

William Sandqvist william@kth.se

1 1 1 1 1 1 1

00 01 11 10 00 01 11 10

x1x0

x3x2

We always group a full sub-cube when possibly!!!

3

x f =

1

slide-52
SLIDE 52

William Sandqvist william@kth.se

1 1

00 01 11 10 00 01 11 10

x1x0

x3x2

x f =

1 1 1 1 1 1

Sub-cube with four varibles

We always group a full sub-cube when possibly!!!

slide-53
SLIDE 53

XOR can be helpful

William Sandqvist william@kth.se

1 1 1 1 1 1 1 1

00 01 11 10 00 01 11 10

x1x0

x3x2

If two groups of four minterms can not form a group of eight, the XOR / XNOR function may be helpful.

2 2 2

x x x x x x f ⊕ = + =

This is under the assumption that there exists an efficient implementation of the XOR function.

slide-54
SLIDE 54

4D the order of the Minterms ...

William Sandqvist william@kth.se

5 3 2 7

00 01 00 01 11 10 11 10

1 4 6

MSB LSB

12 9 15 14 11 13 8 10

) 14 , 7 , 3 , ( ) , , , (

1 2 3

= m x x x x f

x1x0

x3x2

slide-55
SLIDE 55

5D five variables

1

00 01 11 10 00 01 11 10

x1x0

x3x2

1

00 01 11 10 00 01 11 10

x1x0

x3x2

x4

0 1

William Sandqvist william@kth.se

Same in both diagrams, independent of x4.

1 2 3

x x x x

4 =

x 1

4 =

x

slide-56
SLIDE 56

Mirroring with 5 variables

William Sandqvist william@kth.se

1

110 111 101 100

1

000 001 011 010 00 01 11 10

x4x1x0

x3x2

1 2 3

x x x x

Mirror!

slide-57
SLIDE 57

And with an other order …

William Sandqvist william@kth.se

110 111 101 100

1

000 001 011 010 00 01 11 10

x2x1x0

x4x3

1

1 2 3

x x x x

slide-58
SLIDE 58

Karnaugh-map with 6 variables

William Sandqvist william@kth.se

x4

0 1

1

00 01 11 10 00 01 11 10

1

00 01 11 10 00 01 11 10

1

00 01 11 10 00 01 11 10

1

00 01 11 10 00 01 11 10

x3x2 x1x0 x3x2 x1x0 x3x2 x1x0 x3x2 x1x0

x5 1

1 2 3

x x x x

Independent

  • f x5 and x4.

4 =

x 1

4 =

x

5 =

x 1

5 =

x

slide-59
SLIDE 59

Mirroring with 6 variables

William Sandqvist william@kth.se

1

110 111 101 100

1

000 001 011 010 000 001 011 010 110 111 101 100

x4x1x0

x5x3x2

1 1

1 2 3

x x x x

Note!

slide-60
SLIDE 60

William Sandqvist william@kth.se

1

110 111 101 100

1

000 001 011 010 000 001 011 010 110 111 101 100

x2x1x0

x5x4x3

1 1

1 2 3

x x x x

And with an other order …

slide-61
SLIDE 61

Groupings of 0’s

William Sandqvist william@kth.se

Group the zeroes if they are fewer than the ones! 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1

00 01 11 10 00 01 11 10

x1x0

x3x2

1

{ }

) (

1 2 3 1 2 3

x x x x dM x x x x f f + + + = = = = =

”0” as minterm – totaly wrong! invert, then its correct!

1 2 3

x x x x f =

slide-62
SLIDE 62

Don’t care

William Sandqvist william@kth.se

  • Often you can simplify the specification of the

logical function because we know that certain combinations can never occur

  • For these combinations, we use a value of "do

not care"

  • There are different symbols for "do not care" in

use ’d’, ’D’, ’-’, ’Φ’, ’x’

slide-63
SLIDE 63

Incompletely specified functions

William Sandqvist william@kth.se

x

1

x x

3

x

2

00 01 11 10 1 1 1 1 d d d d 1 00 01 11 10 x

2

x

1

x

1

x (a) SOP implementation

Two implementations of the function f ( x3,…, x0) = Σ m(2, 4, 5, 6, 10) + D(12, 13, 14, 15).

00 01 11 10 1 1 1 1 d d d d 1 00 01 11 10 x

2 x 1

+

( )

x

1 x

+

( )

(b) POS implementation x

1

x x

3

x

2

slide-64
SLIDE 64

Another notation (-) …

William Sandqvist william@kth.se

x

1

x x

3

x

2

00 01 11 10 1 1 1 1

  • 1

00 01 11 10 x

2

x

1

x

1

x (a) SOP implementation 00 01 11 10 1 1 1 1

  • 1

00 01 11 10 x

2 x 1

+

( )

x

1 x

+

( )

(b) POS implementation x

1

x x

3

x

2

Two implementations of the function f ( x3,…, x0) = Σ m(2, 4, 5, 6, 10) + D(12, 13, 14, 15).

slide-65
SLIDE 65

Funktions with multiple outputs

William Sandqvist william@kth.se

Different outputs can share prime-implicants!!!

3 1

x x f f + =

slide-66
SLIDE 66

Multi-level synthesis

William Sandqvist william@kth.se

slide-67
SLIDE 67

Do You need mere levels than two?

William Sandqvist william@kth.se

One can realize any combinational circuits with two levels(AND-OR, OR- AND)

– The assumption then is that all inputs are also available in inverted form? (as in PAL, PLA)

slide-68
SLIDE 68

Why multi-level logic?

William Sandqvist william@kth.se

  • The number of inputs in a circuit could

be limited

  • High fan-in leads to long delays
  • It may be more cost effective to use

an implementation with more levels

slide-69
SLIDE 69

Two strategies for multi-level logic

William Sandqvist william@kth.se

1 Factoring 2 Functional decomposition

slide-70
SLIDE 70

Factoring

William Sandqvist william@kth.se

f = x1x

2x3x 4x5x6 + x1x2x 3x 4x 5x6

We have only AND gates with a maximum of 4 inputs? Factor the expression

) (

5 3 2 5 3 2 6 4 1

x x x x x x x x x f + ⋅ =

6 4 1

x x x

slide-71
SLIDE 71

Factoring

William Sandqvist william@kth.se

) (

5 3 2 5 3 2 6 4 1

x x x x x x x x x f + ⋅ =

x

6

x

4

x

1

x

5

x

2

x

3

x

2

x

3

x

5

slide-72
SLIDE 72

Functional decomposition

William Sandqvist william@kth.se

  • You can often reduce the complexity
  • f a logic function by reusing functions

multiple times

  • To implement this it means to reuse a

"circuit" at several points in the construction

slide-73
SLIDE 73

Functional decomposition

William Sandqvist william@kth.se

f = x

1x2x3 + x1x 2x3 + x1x2x4 + x 1x 2x4

Functions can be seen as composed of sub-functions.

slide-74
SLIDE 74

Functional decomposition

William Sandqvist william@kth.se

f = x

1x2x3 + x1x 2x3 + x1x2x4 + x 1x 2x4

= (x

1x2 + x1x 2)x3 + (x1x2 + x 1x 2)x4 XOR XNOR

f = gx3 + g x4

= g = g Can You think up this? … Factor x3 respective x4

slide-75
SLIDE 75

( XOR och XNOR )

William Sandqvist william@kth.se

0 1 1 0 1 0 0 1

XOR XNOR

x2 x1 1 0 1 x2 x1 1 0 1

2 1 2 1

x x x x +

2 1 2 1

x x x x +

XNOR XOR =

With an efficient implementation of the XOR gate (with few transistors) you can see solutions in Karnaugh map even when it is not possible to make any groups!

slide-76
SLIDE 76

Functional decomposition

William Sandqvist william@kth.se

1

x

2

x

3

x

4

f g h x

x

1

x

2

x

3

x

4

f g

Implementation

2 1 2 1

x x x x g + = f = gx3 + g x4

slide-77
SLIDE 77

Algorithms for minimization

William Sandqvist william@kth.se

  • Karnaugh minimization gives a good insight

into how to minimize logic functions

  • But to minimize complex functions using

computer there are better algorithms

  • Chapter 4.9 and 4.10 in Brown / Vranesic

provides an introduction to the minimization algorithms (for the interested student)

slide-78
SLIDE 78

Summary

William Sandqvist william@kth.se

  • Karnaugh map is a good tool for minimizing

logic functions with few variables

  • There are algorithms for both two-level and

multi-level minimization