480 likes | 1.04k Views
Discrete mathematics. Boolean Algebra and Logic Circuits . Duality. N.V. Bilous. Faculty of computer sciences Software department, KNURE. KNURE, Software department, Ph. 7021-446, e-mail: belous@kture.Kharkov.ua. Topic 1 Boolean Algebra and Logic Circuits. ХНУРЭ,кафедра ПО ЭВМ,
E N D
Discrete mathematics BooleanAlgebraandLogicCircuits. Duality N.V. Bilous Faculty of computer sciences Software department, KNURE KNURE, Software department, Ph. 7021-446, e-mail: belous@kture.Kharkov.ua
Topic 1Boolean Algebra and Logic Circuits ХНУРЭ,кафедра ПО ЭВМ, Тел. 7021-446, e-mail: belous@kture.Kharkov.ua
Boolean Variables and Functions Let B = {0, 1}. The variable x is called aBoolean variable or a logic variable if it assumes values only from B. Values 0 and 1 Boolean variables is called Boolean constants.
Boolean Variables and Functions A function y=f(x1,x2,...,xn) 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. A Boolean function is called a Boolean function of degree n if its formula contains n different variables.
The conjunction Figure 1 – The conjunction (series connection) L(x1, x2)= x1x2 where L=1 if x1=1 and x2=1, L=0 otherwise. The “ ” symbol is called the conjunction or ANDoperator, and the circuit in Figure 1 is said to implement the conjunction.
The disjunction L(x1, x2) = x1x2 where L=1 if x1=1 or x2=1 or if x1=x2=1, L=0 if x1=x2=1. 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)
The negation L(x) = x where L=1 if x=0 L=0 if x=1. 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.
Methods of Boolean function representation I. 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 (2n).
The Boolean Functions for 1 variables 0 0 – the constant of zero; 1 = x – the repetition of the argument; 2 = – the negation of the argument; 3 1 – the constant of unity. x 0 1 2 3 0 0 0 1 1 1 0 1 0 1 y=f(x)
The Boolean Functions of Degree 2 z=f(x,y)
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)).
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 2n–1, where n is an amount of variables which depends a Boolean function.
Example Find the sequence number for function f(x,y),which hasnext values: f(0,0)=1, f(0,1)=1, f(1,0)=0, f(1,1)=1. Binary code for the value of this function – 1101. 11012 = 123 +122 +021 +120 = =8+4+0+1=1310 Thus, f13(x,y)= (1101)2
Example Build the truth table for functionf198(x,y) 1 1 0 0 0 1 1 0
Methods of Boolean function representation III. Boolean function representation with using formulas A formula is expression which propose some function as superposition of another functions. Superposition is a method of new functions construction by the substitution of one function values in place of argument values of another function
Example Consider the formula of boolean algebra for functionf(x,y,z) This formula has functions: g(x1) – negation, s(x1,x2) – conjunction, l(x1,x2) – disjunction. Present this formula as superposition of the indicated functions as follows: f (x,y,z) = l(s(x,g(y)),z)
Precedence ofoperations Negation. Conjunction. Disjunction. Implication. Equivalence. Example Cleanall possible brackets Add some brackets taking into account precedence of operations
Equivalent function Two different Boolean expressions that represent the same function are called equivalent. For instance, all the Boolean expressions xy1, xy0, and xy are equivalent.
Boolean Identities 1) Commutative laws xy = yx xy = yx 2)Associative laws x(yz)= (xy)z x(yz)=(xy)z 3) Distributive laws x(yz) = (xy)(xz) x(yz) = (xy)(xz)
Boolean Identities 4) Idempotent laws xx = xx = 5) The excluded middle law 6) The contradiction law 7) The absorption laws (elimination laws) x(xy) = x(xy) = x x 1 0 x x
Boolean Identities 8) Identity laws x0 = x1 = 9) Domination laws x1 = x0 = 10) Law of the double negation 11) De Morgan`s laws x x 1 0 x
Topic 2Duality ХНУРЭ,кафедра ПО ЭВМ, Тел. 7021-446, e-mail: belous@kture.Kharkov.ua
Dual Boolean function Functionf*(x1,…,xn)is calleddualto functionf(x1,…,xn), if
Selfdual Boolean function A Boolean function is called selfdual if
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.
Selfdual Boolean function Example. Define if the function f14(x,y)is selfdual. Solution. Given function is not selfdual.
Selfdual Boolean function Example. Define, if functionf(x,y,z)is selfdual. Solution.f(x,y,z) — selfdual. 0 1 1 1 0 0 0 1
Duality principle The functionfis given by superpositionof function f0,…,fn, wherenN. Functionf*, dual tof, can be obtained, changingfunctionsf0,…,fnin the formula ffor dualtof0*,…,fn*.
Duality principle Example. Find dual functions. Solution.
Rule of obtaining dual formula To obtain dual formula of Boolean algebra it is needed to change all conjunctionsfor disjunctions, disjunctionsfor conjunctions, 0 for 1, 1 for 0 in it, and usebracketswhere it is neededto keep previous order of fulfilling operations.
Rule of obtaining dual formula Example. Find function dual to function Solution. Let’s use previousrule of obtaining dual formula.
Rule of obtaining dual formula If functions are equal then dual to them functions are equal too. Letf1andf2are some functions expressing by such formulas.If f1 = f2, then f1* = f2*