Presentation is loading. Please wait.

Presentation is loading. Please wait.

KNURE, Software department, Ph. 7021-446, N.V. Bilous Faculty of computer sciences Software department, KNURE Boolean Algebra.

Similar presentations


Presentation on theme: "KNURE, Software department, Ph. 7021-446, N.V. Bilous Faculty of computer sciences Software department, KNURE Boolean Algebra."— Presentation transcript:

1 KNURE, Software department, Ph. 7021-446, e-mail: belous@kture.Kharkov.ua N.V. Bilous Faculty of computer sciences Software department, KNURE Boolean Algebra and Logic Circuits. Duality Discrete mathematics

2 Topic 1 Boolean Algebra and Logic Circuits ХНУРЭ,кафедра ПО ЭВМ, Тел. 7021-446, e-mail: belous@kture.Kharkov.ua

3 3 Boolean Variables and Functions Let B = {0, 1}. Boolean variable logic variable The variable x is called a Boolean variable or a logic variable if it assumes values only from B. Boolean constants Values 0 and 1 Boolean variables is called Boolean constants.

4 4 Boolean Variables and Functions Boolean functionlogic function A function y=f(x 1,x 2,...,x n ) is called a Boolean function or a logic function if it assumes values from B and each of its variables also assumes values from B. Boolean function of degree n A Boolean function is called a Boolean function of degree n if its formula contains n different variables.

5 5 The conjunction L(x 1, x 2 )= x 1  x 2 where L=1 if x1=1 and x 2 =1, L=0 otherwise. conjunction ANDoperator The “  ” symbol is called the conjunction or AND operator, and the circuit in Figure 1 is said to implement the conjunction. Figure 1 – The conjunction (series connection)

6 6 The disjunction L(x 1, x 2 ) = x 1  x 2 where L=1 if x 1 =1 or x 2 =1 or if x 1 =x 2 =1, L=0 if x 1 =x 2 =1. disjunctionOR operator The  symbol is called the disjunction or OR operator, and the circuit in Figure 2 is said to implement the disjunction. Figure 2 – The disjunction (parallel connection)

7 7 The negation L(x) = x where L=1 if x=0 L=0 if x=1. negationcomplement The value of this function is the inverse of the value of the input variable. Instead of using the word inverse, it is more common to use the term negation or complement.

8 8 Methods of Boolean function representation I. Truth table truth table The values of a Boolean function are often displayed in the form of a table called the truth table. The rows amount in a truth table is equal to the amount of different interpretations of the function (2 n ).

9 9 The Boolean Functions for 1 variables 1.  0  0 – the constant of zero; 2.  1 = x – the repetition of the argument; 3.  2 = – the negation of the argument; 4.  3  1 – the constant of unity. x 00 11 22 33 00011 10101 y=f(x)

10 10 The Boolean Functions of Degree 2 xyf0f0 f1f1 f2f2 f3f3 f4f4 f5f5 f6f6 f7f7 f8f8 f9f9 f 10 f 11 f 12 f 13 f 14 f 15 000000000011111111 010000111100001111 100011001100110011 110101010101010101 z=f(x,y)

11 11 The Boolean Functions of Degree 2 Func- tion Denote Names of the functions Another denote Read f 0 (x,y)0The constant of zeroconstant 0 f 1 (x,y) xyxy The conjunction (“logical and”) ·, &, &&,*, , AND, min x and y f2(x,y)f2(x,y)The negation of the implication>x and not y f3(x,y)f3(x,y)xThe repetition of the first argumentlike x f4(x,y)f4(x,y)The negation of the inverse implication <not x and y f5(x,y)f5(x,y)yThe repetition of the second argument like y f 6 (x,y) xyxy The sum to the module two (or “exclusive or”) ,, > <, !=, XOR x not like y f 7 (x,y) xyxy The disjunction (or “ logical or ")OR, +, maxx or у

12 12 The Boolean Functions of Degree 2 Func- tion Denote Names of the functions Another denote Read f 8 (x,y) xyxy The negation of the disjunction (or “ logical not-or ”, Piers pointer) not x and not y f 9 (x,y) xyxy The equivalence , , Eqv, = x like y f 10 (x,y) The negation of the second argument yy not y f 11 (x,y) xyxy The inverse implication  x, if y (x or not y) f 12 (x,y)The negation of the first argument xx not x f 13 (x,y) xyxy The implication , , Imp if x, then y (not x or y) f 14 (x,y)x | yThe negation of the conjunction not x or not y f 15 (x,y)1 The constant of unity constant 1

13 13 Methods of Boolean function representation II. Numbers of Boolean functions and interpretations Every function has a sequence number as a natural number a binary code of which is a column of function values in a truth table. A least significant bit is consider a lowermost row (value of function on interpretation (1,1,.,1)), and senior — most overhead (value of function on interpretation (0,0,.,0)).

14 14 Methods of Boolean function representation Every interpretation of Boolean function has the number – value of binary code which is interpretation. Interpretation, which is written in the overhead row of truth table, has a number 0, after interpretation has number 1 and etc. In a lowermost row interpretation is located with a number 2 n –1, where n is an amount of variables which depends a Boolean function.

15 15Example Find the sequence number for function f(x,y), which has next values: f(0,0)=1, f(0,1)=1, f(1,0)=0, f(1,1)=1. xyf(x,y) 001 011 100 111 Binary code for the value of this function – 1101. 1101 2 = 1  2 3 +1  2 2 +0  2 1 +1  2 0 = =8+4+0+1=13 10 Thus, f 13 (x,y) = (1101) 2

16 16Example Build the truth table for function f 198 (x,y) xyzf (x,y,z) 000 001 010 011 100 101 110 111 0 0 0 0 1 1 1 1

17 17 Methods of Boolean function representation III. Boolean function representation with using formulas formula A formula is expression which propose some function as superposition of another functions. Superposition Superposition is a method of new functions construction by the substitution of one function values in place of argument values of another function

18 18Example Consider the formula of boolean algebra for function f(x,y,z) This formula has functions: g(x 1 ) – negation, s(x 1,x 2 ) – conjunction, l(x 1,x 2 ) – disjunction. Present this formula as superposition of the indicated functions as follows: f (x,y,z) = l(s(x,g(y)),z)

19 19 Precedence of operations 1.Negation. 2.Conjunction. 3.Disjunction. 4.Implication. 5.Equivalence. –    ~ Example Clean all possible brackets Add some brackets taking into account precedence of operations

20 20 Equivalent function equivalent Two different Boolean expressions that represent the same function are called equivalent. For instance, all the Boolean expressions xy  1, xy  0, and xy are equivalent.

21 21 Boolean Identities 1) Commutative laws x  y = y  x x  y = y  x 2) Associative laws x  (y  z)= (x  y)  z x  (y  z)=(x  y)  z 3) Distributive laws x  (y  z) = (x  y)  (x  z) x  (y  z) = (x  y)  (x  z)

22 22 Boolean Identities 4) Idempotent laws x  x = x  x = 5) The excluded middle law 6) The contradiction law 7) The absorption laws (elimination laws) x  (x  y) = x  (x  y) = x x 1 0 x x

23 23 Boolean Identities 8) Identity laws x  0 = x  1 = 9) Domination laws x  1 = x  0 = 10) Law of the double negation 11) De Morgan`s laws x x 1 0 x

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

25 25 Dual Boolean function dual Function f*(x 1,…,x n ) is called dual to function f(x 1,…,x n ), if

26 26 Selfdual Boolean function A Boolean function is called selfdual if

27 27 Selfdual Boolean function It is easy to define if a given Boolean function is selfdual or not by its truth table. For this we divide a truth table by half, using the symmetrical line. If any arc connects equal values, then the function is not selfdual. If every arc connects different values, then the function is selfdual.

28 28 Selfdual Boolean function Example. Define if the function f 14 (x,y) is selfdual. Solution. Given function is not selfdual. xyf 14 = x|y 001 011 101 110

29 29 Example. Define, if function f(x,y,z) is selfdual. Solution. f(x,y,z) — selfdual. xyzf (x,y,z)f* (x,y,z) 0000 0011 0101 0111 1000 1010 1100 1111 Selfdual Boolean function 0 1 1 1 0 0 0 1

30 30 Duality principle The function f is given by superposition of function f 0,…,f n, where n  N. Function f*, dual to f, can be obtained, changing functions f 0,…,f n in the formula f for dual to f 0 *,…,f n *.

31 31 Example. Find dual functions. Solution. Duality principle

32 32 To obtain dual formula of Boolean algebra it is needed to change all conjunctions for disjunctions, disjunctions for conjunctions, 0 for 1, 1 for 0 in it, and use brackets where it is needed to keep previous order of fulfilling operations. Rule of obtaining dual formula

33 33 Example. Find function dual to function Solution. Let’s use previous rule of obtaining dual formula. Rule of obtaining dual formula

34 34 If functions are equal then dual to them functions are equal too. Let f 1 and f 2 are some functions expressing by such formulas. If f 1 = f 2, then f 1 * = f 2 * Rule of obtaining dual formula


Download ppt "KNURE, Software department, Ph. 7021-446, N.V. Bilous Faculty of computer sciences Software department, KNURE Boolean Algebra."

Similar presentations


Ads by Google