minimization of boolean functions

23
ХНУРЭ,кафедра ПО ЭВМ, Тел. 7021-446, e-mail: [email protected] N N . . V V . . Bilous Bilous Факультет компьютерных наук Кафедра ПО ЭВМ, ХНУРЭ Discrete mathematics Discrete mathematics . . Minimization of Minimization of Boolean Boolean Functions. Functions.

Upload: thu

Post on 10-Jan-2016

58 views

Category:

Documents


3 download

DESCRIPTION

Discrete mathematics. Minimization of Boolean Functions. N . V . Bilous. Факультет компьютерных наук Кафедра ПО ЭВМ, ХНУРЭ. ХНУРЭ,кафедра ПО ЭВМ, Тел . 7021-446, e-mail: [email protected]. Criterion of minimization. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Minimization of Boolean Functions

ХНУРЭ,кафедра ПО ЭВМ,Тел. 7021-446, e-mail: [email protected]

NN..VV. . BilousBilous

Факультет компьютерных наук

Кафедра ПО ЭВМ, ХНУРЭ

Discrete mathematicsDiscrete mathematics..

Minimization of Minimization of Boolean Functions.Boolean Functions.

Page 2: Minimization of Boolean Functions

2

Criterion of minimization.Criterion of minimization.

The task of minimization is to find the simplest formula according to chosen criterion of minimization among the set of formulae corresponding to given Boolean function.

Page 3: Minimization of Boolean Functions

3

The Karnaugh mapThe Karnaugh map

The Karnaugh map is a graphical method for finding terms to combine for Boolean functions involving a relatively small number of variables.

Page 4: Minimization of Boolean Functions

4

The Karnaugh mapThe Karnaugh map

Cells are said to be adjacent if the minterms that they represent differ in exactly one literal.

For instance, the cell representing is

adjacent to the cells representing and .

yx

yxyx

Page 5: Minimization of Boolean Functions

5

The rule of gluing contours of the Karnaugh Maps.The rule of gluing contours of the Karnaugh Maps.

1.Build Karnaugh map corresponding to given function.

2.The cells are united in groups defining the operations of gluing. Only adjacent cells in which the unities are situated take part in the unification.

3.Only the number of cells equal to 2n, n=1,2,3,... may be united in group. In this case group may be have only rectangle or square form.

Page 6: Minimization of Boolean Functions

6

The rule of gluing contours of the Karnaugh The rule of gluing contours of the Karnaugh Maps.Maps.

4.The task of gluing consists in finding the collection of maximum groups.

Maximum group is a group which does not completely belong to any other group and corresponds to elementary implicant of function.

5.Each group obtaining after gluing corresponds to implicant of function.

6.Disjunction of all obtaining elementary implicant is the result of minimization formula and it is minimal DNF.

Page 7: Minimization of Boolean Functions

7

The Karnaugh Map for Three Variables.The Karnaugh Map for Three Variables.

The Karnaugh maps for three variables have the form of table 24 where the columns corresponds to different collections of values the first two variables,

and the lines – to values 0 an 1 the third variable.

Page 8: Minimization of Boolean Functions

8

The Karnaugh Map for Three Variables.The Karnaugh Map for Three Variables.

Example.

Build the Karnaugh map for function

xyzzyxyzxzyxzyxf ),,(

Page 9: Minimization of Boolean Functions

9

The Karnaugh Map for Three Variables.The Karnaugh Map for Three Variables.

The operation of gluing may be supplied to minterms corresponding to any two adjacent cells as they are different by just one variable.

Cells connecting with cells A and B

Page 10: Minimization of Boolean Functions

10

The Karnaugh Map for Three Variables.The Karnaugh Map for Three Variables.

Example.

Find MDNF for function

Solution.

Build the Karnaugh map for given function

xyzyzxzxyzyxzyxf ),,(

Page 11: Minimization of Boolean Functions

11

The Karnaugh Map for Four Variables.The Karnaugh Map for Four Variables.

The Karnaugh maps for four variables has the size 44. Each cell has four adjacent cells.

The rules of gluing cells and noting the resulting formula are previous. The difference is that not only the border right and border left columns are necessary to count but border upper and border lower lines too.

Page 12: Minimization of Boolean Functions

12

The Karnaugh Map for Four Variables.The Karnaugh Map for Four Variables.

Example.

Build MDNF for function

tzyxtzyxtzyx

tzyxztyxztyxtxyztzyxf

),,,(

Page 13: Minimization of Boolean Functions

13

The Karnaugh Map for Four Variables.The Karnaugh Map for Four Variables.

Solution.

Build the Karnaugh map.

txyzztxtyzytzyxf ),,,(

Page 14: Minimization of Boolean Functions

14

The Karnaugh Map for Five Variables.The Karnaugh Map for Five Variables.

The Karnaugh maps for five variables represents as two-layer parallelepiped in space where each layer corresponds to Karnaugh map from the first four variables.

Each cell in the Karnaugh maps for five variables has five adjacent cells: four on its layer of map and the fifth on the adjacent, i.e. the cell which coincides with given if the layers of map place one above the other.

Page 15: Minimization of Boolean Functions

15

The Karnaugh Map for Five Variables.The Karnaugh Map for Five Variables.

Example.

Build MDNF for function.

wtzyxwtxyzwxyzt

wztyxwtzyxwtzxywtzyx

wtzxywtzyxwtzyxwtzyxf

),,,,(

Page 16: Minimization of Boolean Functions

16

The Karnaugh Map for Five Variables.The Karnaugh Map for Five Variables.

Solution.

wxyzwtxtzywtzwztyxwtzyxf ),,,,(

Example

Page 17: Minimization of Boolean Functions

17

The Karnaugh Map for Six Variables.The Karnaugh Map for Six Variables.

The Karnaugh maps for six variables represents as four-layer parallelepiped in space where each layer corresponds to Karnaugh map from the first four variables.

The layers of map are considered adjacent if interpretation of the fifth and the sixth variables corresponding to them differs only by one literal.

Page 18: Minimization of Boolean Functions

18

The Karnaugh Map for Six Variables.The Karnaugh Map for Six Variables.

Each cell in the Karnaugh maps for six variables has six adjacent cells: four on its layer of map and two on the adjacent layers of map. The cells coincide with given if the layers of map place one above the other.

Page 19: Minimization of Boolean Functions

19

The Karnaugh Map for Six Variables.The Karnaugh Map for Six Variables.

Example.

Build MDNF for function.

vwxyztvwtzxy

vtwzxyvwxyztvwtzxyvwyztx

vwyztxvwtzyxvwtzxywvtzyx

vwtzyxvwtzyxvwtzyxvwtzyxf

),,,,,(

Page 20: Minimization of Boolean Functions

20

The Karnaugh Map for Six Variables.The Karnaugh Map for Six Variables.

Solution.

Given function equals to unit in the following interpretations: (0,0,1,0,0,0), (0,0,1,0,0,1), (0,0,1,0,1,0), (0,0,1,0,1,1), (0,1,0,1,0,0), (0,1,0,1,0,1), (0,1,1,1,0,0), (0,1,1,1,0,1), (1,1,0,1,0,0), (1,1,1,1,0,1), (1,1,0,1,1,0), (1,1,0,1,0,1), (1,1,1,1,0,0).

Build the Karnaugh map corresponding to given function.

Page 21: Minimization of Boolean Functions

21

The Karnaugh Map for Six Variables.The Karnaugh Map for Six Variables.

Continuation of example.

vtzxywyttzyxvwtzyxf ),,,,,(

Page 22: Minimization of Boolean Functions

22

Don't care conditions.Don't care conditions.

If for the decision of task not all combinations of input data are used then any value of function in non-using interpretations may be arbitrarily chosen and values of the function for these combinations are called don't care conditions.

Page 23: Minimization of Boolean Functions

23

Don't care conditions.Don't care conditions.

Example.

Function f(x,y,z,t) equals to unit in interpretations (0,0,1,0), (0,1,1,0), (1,0,1,0), (1,0,0,0) and is indefinite if xy=1. We need to build MDNF.

Solution.

txtzBAtzyxf ),,,(