Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 35

Discrete mathematics.

Normal Forms.

Lecture 6
N.V. Belous
Факультет компьютерных наук
Кафедра ПО ЭВМ, ХНУРЭ

ХНУРЭ,кафедра ПО ЭВМ,
Тел. 7021-446, e-mail: belous@kture.Kharkov.ua
Complete normal form

Among the majority of equivalent formulae


representing chosen Boolean functions f, one
formula is distinguished, it is called Complete
normal form of function f.

It has regulating logical structure and is defined


only according to function f .

2
Theorem about disjunctive decomposition of
function

Any Boolean function f(x1,x2,…,xn) can be


represented in such form:

f(x1,…,xk,xk+1,…,xn)=
 x1 1  x2 2  ...  xk kf(1,2,…,k,xk+1,…,xn)
(1,2,…,k)

3
Theorem about disjunctive decomposition of
function

Note  1 2
x 1
 x 2
 ...  x k
k means frequent
(1,2,…,k)
disjunction which is taken in all possible sets of
value (1, 2,…, k) by any k (1<k<n).

Note f(1, 2,…, k,xk+1,…,xn) represents values


of function in set x1,x2,…,xn, where instead of
values for variables x1,x2,…,xk, according to which
the decomposition is conducted, values 1, 2,…,
k are substituted.

4
Theorem about disjunctive decomposition of
function

Example.
Consider disjunctive decomposition of function
by variables x, z.

f ( x, y , z , t )  ( x  y  z )  t

5
Theorem about disjunctive decomposition of
function

Solution.
Use the theorem about decomposition:

f ( x, y , z , t )   x  z
1 2
 f ( 1 , y,  2 , t ) 
x  z  f (0, y,0, t )  x  z  f (0, y,1, t )
 x  z  f (1, y,0, t )  x  z  f (1, y,1, t )

6
Theorem about disjunctive decomposition of
function

Continuation of example.
Calculate:

f (0, y ,0, t )  (0  y  0)  t  0,
f (0, y ,1, t )  (0  y  1)  t  t ,
f (1, y,0, t )  (1  y  0)  t  0,
f (1, y,1, t )  (1  y  1)  t  y  t.
7
Theorem about disjunctive decomposition of
function

Continuation of example.
Substitute f(0,y,0,t), f(0,y,1,t), f(1,y,0,t),
f(1,y,1,t) in formula of disjunctive decomposition:

f ( x, y , z , t )  x  z  0  x  z  t  x  z  0  x  z  ( y  t ) 
x z t  x z  y t

8
Theorem about disjunctive decomposition of
function

Disjunctive decomposition of Boolean


function f(x1,x2,…,xn) by one variable.
Any Boolean function f(x1,x2,…,xn) can be
represented in the following form:

f(x1,x2,…,xn)= x f(x ,x ,…,x , ,x


i
1
1 2 i- i ,…,xn)
i+1
1

9
Theorem about disjunctive decomposition of
function

Disjunctive decomposition of Boolean function


f(x1,x2,…,xn) by all n variables.
Any Boolean function f(x1,x2,…,xn)  0 can be
represented in the following form:

f(x1,x2,…,xn) =  1 2
x  x  ...  x
1 2
n
n
(1,2,…,n)
f(1,2,…,n) = 1

10
Theorem about disjunctive decomposition of
function

Example.
Obtain disjunctive decomposition of the function
f ( x, y, z )  xy  z by all variables..

11
Theorem about disjunctive decomposition of
function

Solution.
Define the meaning of function in each
interpretation:
f (0,0,0)  0  0  0  0  1  1 f (1,0,0)  1  0  0  0  1  1
f (0,0,1)  0  0  1  0  0  0 f (1,0,1)  1  0  1  0  0  0
f (0,1,0)  0  1  0  0  1  1 f (1,1,0)  1  1  0  1  1  1
f (0,1,1)  0  1  1  0  0  0 f (1,1,1)  1  1  1  1  0  1

12
Theorem about disjunctive decomposition of
function

Continuation of example.

f ( x, y , z )  x y z  x y z  x y z  x y z  x y z 
0 0 0 0 1 0 1 0 0 1 1 0 1 1 1

x y z  x y z  x y z  xy z  xyz

13
The basic terms.

Elementary conjunction is conjunction of any


number of Boolean variables taken either with or
without negation in which each variable appears once.

14
Examples of elementary conjunctions

Elementary conjunctions for functions from

 one variable can be y, z ,

 two variables x  y, x  z ,

 three variables x  y  z , x  y  z , xyz .

15
Disjunctive normal form.

Disjunctive normal form (DNF) is the formula


which is represented as disjunction of elementary
conjunctions.

16
Minterm.

1 2 n
Elementary conjunction x  x2  ...  xn
1

is called minterm (constituent of unity ) of function


f(x1, x2, …, xn), if f(1,  2, …, n) = 1, i.e.
interpretation which converts into one given
elementary conjunction, converts also function f into
one.

17
The properties of minterm.

Minterm the function of n variables looks like


1 2 n
x1  x2  ...  xn and corresponds to
interpretation (1,2,…,n).
Minterm has the following properties:
 Minterm equals only in the corresponding to it
interpretation.
 Minterm is defined by the number of
corresponding to it interpretation.
 Conjunction of any number minterms of
function is equal to zero (for different minterms).
18
Sum-of-products.

Sum-of-products or complete disjunctive


normal form (CDNF) of Boolean function is called
the formula represented as disjunction of minterm
given function.

19
Product-of-sums.

Product-of-sums or complete conjunctive


normal form (CCNF) of Boolean function is called
formula represented as conjunction of maxterm
given function.

20
Consequences from the defining sum-of-products
and product-of-sums of Boolean functions.

 For each Boolean function f(x1,x2,…,xn) which is


not a maxterm exists an expression in the form
of sum-of-products.
 For each Boolean function f(x1,x2,…,xn), which is
not a minterm exists an expression in the form of
product-of-sums.
 Two different Boolean functions can’t have the
same sum-of-products or product-of-sums.
 For each Boolean function f(x1,x2,…,xn) exists an
expression in the form of formula of Boolean algebra
containing only operations of disjunction, conjunction
and negation.
21
Example of minterm and maxterm for f(x, y, z).

Number of Interpretation
interpret. Minterm Maxterm
x y z

22
Transition algorithm from truth table of Boolean
function to sum-of-products.

1. Distinguish all interpretations (1,2,…,n) in


which the value of function equals to one.
2. Write down the minterm in form
1 2 n
x1  x2  ...  xn corresponding to given
interpretations.
3. Obtain sum-of-products of function by means
of connection by the operation of disjunction
written down minterm.

23
Transition algorithm from truth table of Boolean
function to sum-of-products.
Example.
Obtain sum-of-products for functions f13(x,y) and f8(x,y).

Function f13(x,y)

x y f13(x,y)
0 0 1
0 1 1
1 0 0
1 1 1

f13 ( x, y )  x y  x y  x y  x y  x y  xy
0 0 0 1 1 1
24
Transition algorithm from truth table of Boolean
function to sum-of-products.
Continuation of example.

Function f8(x,y)
x y f8(x,y)
0 0 1
0 1 0
1 0 0
1 1 0

f 8 ( x, y )  x y  x y
0 0

25
Transition algorithm from truth table of Boolean
function to product-of-sums.

1. Distinguish all interpretations (1,2,…,n) in


which the value of function equals to zero.
2. Write down the maxterm of form
  
x1 1  x2 2  ...  xn n corresponding to given
interpretations.
3. Writing down conjunction of maxterms obtain
product-of-sums of function.

26
Transition algorithm from truth table of Boolean
function to product-of-sums.
Example.
Obtain product-of-sums for functions f13(x,y) and
f8(x,y). Function f (x,y)
13

x y f13(x,y)
0 0 1
0 1 1
1 0 0
1 1 1
_ _
f13(x,y) = (x1  y0) = (x0  y1) = ( x  y)
27
Transition algorithm from truth table of Boolean
function to product-of-sums.
Continuation of example.
Function f8(x,y)
x y f8(x,y)
0 0 1
0 1 0
1 0 0
1 1 0
_ _ _ _ _ _
f8(x,y) = (x0  y1) (x1  y0) (x1  y1) = ( x  y )( x  y )( x  y )
28
Building algorithm the truth table of
function given by sum-of-products.

1. Build the truth table containing 2n interpretations


in form (1,2,…,n).
2. Remark in the truth table all interpretations (1,2,
…,n) corresponding to minterms in form
 xn n from sum-of-products.
x1 1  x2 2  ...given
3. Write down in column 1-s opposite distinguishing
interpretations the values of functions.
4. Write down in column 0-s opposite the last
interpretations.
29
Building algorithm the truth table of
function given by product-of-sums.
1. Build the truth table containing 2n interpretations in
form (1,2,…,n).
2. Remark in the truth table all interpretations (1,2,
…,n), corresponding to maxterms in form
  
x1  xgiven
1
2
2
 ...  x
fromn product-of-sums.
n

3. Write down in column 0-s opposite distinguishing


interpretations the values of functions.
4. Write down in column 1-s opposite the last
interpretations.

30
Transition algorithm from arbitrary formula of logic
algebra to sum-of-products.

1.Except constants using the laws of acting with


constants.
2.Put down the negation directly on the variables
using the De Morgan’s laws.
3.Open the brackets using the distributive law.
Apply the idempotentce and complementation laws to
the receiving elementary conjunctions, simplify them
and reduce similar. The result of the doing given acts is
getting DNF of Boolean function.

31
Transition algorithm from arbitrary formula of logic
algebra to sum-of-products.

4.Build the minterm adding in each elementary


conjunction variables that are absent by the excluded
middle law.
5.With the help of distributive law open the
brackets and reduce similar using the idempotent law.

6.The receiving formula corresponds to sum-of-


products of function.

32
Transition algorithm from arbitrary formula of logic
algebra to product-of-sums.
1.Except constants using the laws of acting with
constants.
2.Put down the negation directly on the variables
using the De Morgan’s laws.
3.Using the distributive law reduce the function to
the form of conjunction of elementary disjunctions.
Apply the idempotent and the excluded middle laws to
the receiving elementary disjunctions, simplify them
and reduce similar. The result of the fulfilling given
acts is getting CNF of Boolean function.

33
Transition algorithm from arbitrary formula of logic
algebra to product-of-sums.
4. Build the maxterms adding in each elementary
disjunction variables that are absent by the
contradiction law.
5. With the help of distributive law reduce function to
the form of the conjunction the maxterms and simplify
formula using the idempotentce law.
6. The receiving formula is product-of-sums of
function.

34
Examples.

Example 1. Transition from sum-of-products to the truth table.

Example 2. Transition from product-of-sums to the truth table.

35

You might also like