Unit - 2: Boolean Algebra and Switching Functions
Unit - 2: Boolean Algebra and Switching Functions
Unit - 2: Boolean Algebra and Switching Functions
Boolean Algebra: Boolean algebra, like any other deductive mathematical system, may be defined with a
set of elements, a set of operators, and a number of unproved axioms or postulates. A set of elements is any
collection of objects having a common property. If S is a set and x and y are certain objects, then x S
denotes that x is a member of the set S, and y S denotes that y is not an element of S. A set with a
denumerable number of elements is specified by braces: A = {1,2,3,4}, i.e. the elements of set A are the
numbers 1, 2, 3, and 4. A binary operator defined on a set S of elements is a rule that assigns to each pair of
elements from S a unique element from S.
Example: In a*b=c, we say that * is a binary operator if it specifies a rule for finding c from the pair (a,b)
and also if a, b, c S.
CLOSURE: The Boolean system is closed with respect to a binary operator if for every pair of Boolean values,
it produces a Boolean result. For example, logical AND is closed in the Boolean system because it accepts only
Boolean operands and produces only Boolean results.
A set S is closed with respect to a binary operator if, for every pair of elements of S, the binary
operator specifies a rule for obtaining a unique element of S.
For example, the set of natural numbers N = {1, 2, 3, 4, 9} is closed with respect to the binary
operator plus (+) by the rule of arithmetic addition, since for any a, b N we obtain a unique c N
by the operation a + b = c.
ASSOCIATIVE LAW:
A binary operator * on a set S is said to be associative whenever (x * y) * z = x * (y * z) for all x, y, z S, for
all Boolean values x, y and z.
COMMUTATIVE LAW:
A binary operator * on a set S is said to be commutative whenever x * y = y * x for all x, y, z S
IDENTITY ELEMENT:
A set S is said to have an identity element with respect to a binary operation * on S if there exists an element
e S with the property e * x = x * e = x
for every x S
INVERSE:
A set S having the identity element e with respect to a binary operator * is said to have an inverse whenever,
for every x S, there exists an element y S such that x * y = e
DISTRIBUTIVE LAW:
If * and () are two binary operators on a set S, * is said to be distributive over, () whenever
x * (y z) = (x * y) (x * z)
HUNTINGTON POSTULATES:
Closure with respect to the operator + and
Identity element with respect to + (0) and (1) x+0=0+x=x; x1=1x=x
Commutative with respect to + and ; x+y = y+x; xy = yx;
Distributive over + and ; x(y+z) = (xy) + (xz); x+(yz) = (x+y) (x+z) Not valid in ordinary
algebra
For every element of x B, there exists an element x B such that (a) x + x = 1 and (b) x x = 0.
There exists at least two elements x, y B such that x y.
Huntington postulates do not include the associative law. However, this law holds for Boolean algebra. The
distributive law of + over () is valid for Boolean algebra but not for ordinary algebra. Boolean algebra does
not have additive or multiplicative inverses, no subtraction or division. The operator complement is not
available in ordinary algebra. Ordinary algebra deals with real numbers, Boolean algebra deals with only two
elements.
TWO-VALUED BOOLEAN ALGEBRA:
A two-valued Boolean algebra is defined on a set of two elements, B = {0,1} with rules for the two binary
operators + and () as shown in the following operator tables:
x
0
0
1
1
y
0
1
0
1
xy
0
0
0
1
x+y
0
1
1
1
x
1
1
0
0
x+0=x
x+y=y+x
x (y + z) = xy + xz
x + x = 1
x1=x
xy = yx
x + yz = (x + y)(x + z)
x x = 0
Theorems a and b
Theorem
Theorem 1
Theorem 2
Theorem 3, Involution
Theorem 4, Associative
Theorem 5, DeMorgan
Theorem 6, Absorption
a
x+x=x
x+1=1
( x ) = x
x + (y + z) = (x + y) + z
(x + y) = xy
x + xy = x
b
xx = x
x0=0
x (y z) = (x y) z
(xy) = x + y
x (x + y) = x
Postulate 2(a)
Postulate 5(b)
Postulate 5(a)
Postulate 2(b)
Therefore xA = xB = x
Second,
x'A = x'[x + (y + z)] = x'x + x'(y + z)
= xx' + x'(y + z) = 0 + x'(y + z)
= x'(y + z)
x'B = x'[(x + y) + z]
= x'(x + y) + x'z = (x'x + x'y) + x'z
= (xx' + x'y) + x'z = (0 + x'y) + x'z
= x'y + x'z 0 = x'(y + z)
Therefore x'A = x'B = x'(y + z)
Finally,
A=A1
= A(x + x')
= Ax + Ax'
= xA + x'A
= xB + x'A
= xB + x'B
= Bx + Bx'
= B(x + x')
=B1
=B
Since A = x + (y + z) and B = (x + y) + z, we have
shown that x + (y + z) = (x + y) + z
(x+y) (x + y)
0
0
0
1
0
1
1
0
1
0
1
0
1
1
1
0
DeMorgan's Theorems:
a. (A + B) = A* B
b. A*B = A + B
Note: * = AND operation
x
1
1
0
0
y
1
0
1
0
xy
1
0
0
0
Prove: (A*B)*( A + B) = 0
(A*B)*( A + B) = (A*B)*A + (A*B)*B) by distributive postulate
= (A*A)*B + A*(B*B) by Associativity postulate
= 0*B + A*0
= 0+0
=0
(A*B)*( A + B) = 0
by Complement postulate
by Nullity theorem
by identity theorem
Prove: (A*B) + ( A + B) =1
(A*B) + ( A + B) =(A + A + B))*(B + A + B) by distributivity B*C + A = (B + A)*(C + A)
(A*B) + ( A + B) =(A + A + B))*(B + B + A) by associativity postulate
=(1 + B)*(1 + A)
by complement postulate
=1*1
=1
(A*B) + ( A + B) =1
by nullity theorem
by identity theorem
2. NOT
3. AND 4. OR
SWITCHING FUNCTIONS
Let T(x1, x2, x3, , xn) be a switching expression. Each of the variables can assume any of two values 0 or 1 and
hence there are 2n combinations for determining the values of T. For example T = xz + xz + xy. Then T(0,0,1)
= 01 +01 +01 = 1 + 0 + 0 = 1. Similarly T can be computer for every combination and a truth table may be
built.
x
0
0
0
0
1
1
1
1
y
0
0
1
1
0
0
1
1
z
0
1
0
1
0
1
0
1
T
1
1
0
1
1
0
1
0
When built a truth table for T = xz + xz + yz, this will be identical to the above. Hence different switching
functions may produce the same assignments. If a truth table is given for functions say f and g, then (fg),
(f+g), f and g can easily built.
x
0
0
0
0
1
1
1
1
y
0
0
1
1
0
0
1
1
z
0
1
0
1
0
1
0
1
f
1
0
1
1
0
0
1
1
g
0
1
0
1
1
0
1
0
f
0
1
0
0
1
1
0
0
g
1
0
1
0
0
1
0
1
fg
0
0
0
1
0
0
1
0
f+g
1
1
1
1
1
0
1
1
Simplify
i) T(A,B,C,D) = AC + ABD + BCD + ABD +ABCD . Ans : AC + A[BD + D(B+C)]
ii) T(A,B,C,D) = AB + ABD + ABCD + BC
. Ans : AB + BD +ACD
Exclusive OR Gates
A Boolean (logic) function can be expressed in a variety of algebraic forms. For example
y = c a + c b = c(a + b) = c(c + b + a)
Each algebraic form entails specific gate implementation. A Boolean function can be uniquely described by
its truth table, or in one of the canonical forms. Two dual canonical forms of a Boolean function are available:
(a) The sum of Minterms (SoM) form (b) The product of Maxterms (PoM) form. A Minterm is a product of all
variables taken either in their direct or complemented form. A Maxterm is a sum of all variables taken either
in their direct or complemented form.
x x2
x1
x0
Minterms
0 0
m0 =
1 0
2 0
3 0
4 1
5 1
6 1
7 1
xxx
m =x x x
m =x x x
m =x x x
m =x x x
m =x x x
m =x x x
m =x x x
2
m0
m1
m2
m3
m4
m5
m6
m7
The logic circuit that generates all Minterms is called an n-to-2n decoder:
x
x
x
0
1
2
3
4
5
6
m0 =
xxx
m4=
xxx
m7=
xxx
x1
x0
x1
x0
Minterms
M0
M1
M2
M3
M4
0 0
m0 =
1 0
2 0
3 0
xx
m =x x
m =x x
m =x x
1
m1 =
m0 =
m2 =
m3 =
X1
X0
2 1
y = f (x n1 ............, x0 ) = y
i =0
It is clearly equivalent to the sum of minterms for which the values of the function are 1, say, yj = 1
y = f (xn1............, x0 ) =
y j =1
xxx+xxx+xxx+xxx
2
MAXTERMS
A logic sum (OR) of all variables taken in their direct or complemented form is called a Maxterm,
Mi.
A Maxterm is a complement of an equivalent Minterm
For example, all three-variable Maxterms are listed in the following table:
X
0
X2
0
X1
0
X0
0
2
3
4
0
0
1
1
1
0
0
1
0
MAXTERMS
x
M =x
M =x
M =x
M =x
M0
0
M1
1
M2
1
M3
1
M4
1
M5
1
M6
1
M7
1
M0=
+ x1 + x0
+ x1 + x
+ x + x0
+x +x
+ x1 + x0
1
1
1
0
1
x +x +x
M =x +x +x
M2=
1
M0 =
x +x +x
2
The logic circuit that generates all Maxterms is also called an n-to-2n decoder:
x
x
x
0
1
2
3
4
5
6
M0=
x +x +x
M3=
x +x +x
M7 =
x +x +x
2
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
0
0
1
0
1
1
1
1
Now the equation is formed by identifying the values of ABC for all
combinations that produce 1 as output (F).
F = ABC + ABC + ABC + ABC + ABC = = m7 + m6 +m5+m4 + m2
Product of Maxterms:
Example: F = xy + xz ... express this in terms of Maxterms
F = xy + xz = (xy + x)(xy + z) = (x+xy )(z + xy )
= (x + y)(z + x) ( z + y)
However this function has three variables; Let us convert each term into a three variable term
(x + y) = x + y + zz = (x + y +z)(x + y + z)
(z + x) = z + x + yy = (x + y + z)(x = y + z)
( z + y) = z + y + xx = (z + y + x)( z + y + x)
F = (x + y +z)(x + y + z) (x + y + z)(x + y + z) (z + y + x)( x + y + z)
F = ( x + y + z) + (x + y + z) + (x + y + z)(x + y + z)
F = M4 + M5 + M0+M2
Conveniently it is written as F(x,y,z) = (0,2,4,5)
Standard Forms: This is other way to express Boolean function. All Minterms and Maxterms must
have all the variables in each term. However in standard form the expression will be in most
minimal and completely simplified form. In the above example F = A + BC is in standard form or it is in
sum of the products form, where as F = ABC + ABC + ABC + ABC + ABC is in sum of Minterms form.
Similarly for the case of Maxterms too. The Maxterms will have all the variables in each term where as in
standard form it will be in simplified form and called Product of Sums. For example F = (x + y)(z + x) ( z + y).
This is in a standard form and also said to be the Product of Sums, where as F = ( x + y + z) + (x + y + z) + (x
+ y + z)(x + y + z) is in Product of Maxterms form.
Examples: F1 = y + xy + xyz Sum of the products . in two level implementation
F2 = x(y+z)(x + y + z) .Product of Sums in two level implementation
F3 = AB + C(D+E) . Non-Standard form ------- Can be two level or Three level
Implementation
---------------------------
XOR Gate:
The exclusive-OR (XOR), operator uses the symbol , and it performs the following logic operation:
X Y = X Y + X Y
The graphic symbol and truth table of XOR gate is shown in the figure.
XNORe:
The exclusive-NOR (XNOR), operator uses the symbol , and it performs the logic operation.
X
Y = X Y + X Y = (X Y). The graphic symbol and truth table of XNOR (Equivalence) gate is shown in the
figure.
The result is 1 when either both X and Y are 0s or when both are 1s. That is why this gate is often referred to
as the Equivalence gate. The truth tables clearly show that the exclusive-NOR operation is the complement
of the exclusive-OR. This can also be shown by algebraic manipulation as follows:
(X Y) = (X Y + X Y)
= (X Y) (X Y) = (X + Y) (X + Y)
= (XY + XY)
=XY
Properties of XOR/XNOR Operations:
1- Commutativity
A B = B A, and
AB=BA
2- Associativity
A (B C) = (A B) C, and A (B C) = (A B) C
The figure provides a graphical presentation of important XOR/XNOR rules and gate equivalence.
Example:
Show that (A B) (C D) = A B C D
Proving the above identity is easier done using graphical equivalence between gates as specified by
the previous figure.
The following figure shows a step-by-step approach starting by the logic circuit corresponding to the
left-hand-side of the identity and performing equivalent gate transformations till a circuit is reached
that corresponds to the right-hand-side of the identity.
P a g e | 13
ODD Function:
X Y Z = 1, IFF (if and only if) the number of 1s in the input combination is odd.
X
0
0
0
0
1
1
1
1
Y
0
0
1
1
0
0
1
1
Z
0
1
0
1
0
1
0
1
Odd
0
1
1
0
1
0
0
1
EVEN Function:
The complement of an odd function is an even function. The even function is equal to 1 when the number of
1s in the input combination is even. The complement of an odd function (an even function) is obtained by
replacing the output gate with an exclusive-NOR gate, as shown in figure.
x
0
0
0
0
1
1
1
1
y z Parity Bit
0 0 0
0 1 1
1 0 1
1 1 0
0 0 1
0 1 0
1 0 0
1 1 1
The 4 bits (X, Y, Z & P) are transmitted to their destination, where they are applied to a paritychecker circuit to check for possible errors in the transmission.
Since the information was transmitted with even parity, the received four bits must have an even
number of 1s. The parity checker generates an error signal (C = 1), whenever the received four bits
have an odd number of 1s. The table below shows the truth table for the even-parity checker.
Received Data
Received Data
x
0
0
0
0
0
0
0
0
C
0
1
1
0
1
0
0
1
x
1
1
1
1
1
1
1
1
C
1
0
0
1
0
1
1
0
y
0
0
0
0
1
1
1
1
z
0
0
1
1
0
0
1
1
p
0
1
0
1
0
1
0
1
y
0
0
0
0
1
1
1
1
z
0
0
1
1
0
0
1
1
p
0
1
0
1
0
1
0
1
Obviously, the parity checker error output signal C is given by the following expression:
C = X 0Y Z P. The 1logic diagram of the even-parity checker is shown in the figure.
It is worth noting that the parity generator can also be implemented with the circuit of this figure if
the input P is connected to logic-0 and the output is marked with P. This is because Z 0 = Z,
causing the value of Z to pass through the gate unchanged.
The advantage of this is, the same circuit can be used for both parity generation and checking.
Universal Gates:
Universal gates are the ones which can be used for implementing any gate like AND, OR and NOT, or any
combination of these basic gates; NAND and NOR gates are universal gates. But there are some rules that
need to be followed when implementing NAND or NOR based gates. Any logic function can be implemented
using NAND gates. To achieve this, first the logic function has to be written in Sum of Product (SOP) form.
Once logic function is converted to SOP, then is very easy to implement using NAND gate. In other words any
logic circuit with AND gates in first level and OR gates in second level can be converted into a NAND-NAND
gate circuit.
Consider the following SOP expression
F = W.X.Y + X.Y.Z + Y.Z.W
The above expression can be implemented with three AND gates in first stage and one OR gate in second
stage as shown in figure
olean function
F0 = 0
F1 = xy
F2 = xy
F3 = x
F4 = xy
F5 = y
F6 = xy + xy
F7 = x + y
F8 = (x + y)
F9 = xy + xy
F10 = y
F11 = x + y
F12 = x
F13 = x + y
F14 = (xy)
F15 = 1
Operator Symbol
x.y
x/y
y/x
xy
x+y
x y
(xy
y
xy
X
x y
xy
Name
NULL
AND
Inhibition
Transfer
Inhibition
transfer
Exclusive - OR
OR
NOR
Equivalence
Complement
Implication
Complement
Implication
NAND
Identity
Comments
Binary Constant 0
x and y
x but not y
x
y but not x
Y
x or y but not both
x or y
Not-OR
X equals y
Not y
If y, then x
Not x
If x, then y
NOT-AND
Binary Constant
(x+y)
[(x+y) + z]
z
= (x+y) . z
(y+z)
[(y+z) + x] =(y+z) . x
z
x
H
0
Positive
Logic
x
y
x
A
y
H
L
x y A Logic
Negative
0 0 0
0 1 1
1 0 1
1 1 1
x
1
1
0
0
y
1
0
1
0
A
1
0
0
0
A
0
0
0
0
0
0
1
1
1
1
1
0
1
1
1
1
B
0
0
0
0
1
1
0
0
1
1
1
1
0
0
1
1
C
0
0
1
1
0
1
0
1
0
1
1
0
0
1
0
1
D
0
1
0
1
1
0
1
0
1
0
1
0
0
1
0
1
OUT
0
1
1
0
0
1
1
1
0
1
0
D
D
D
D
D
ABCD+
ABCD+
ABCD+
ABCD+
ABCD+
ABCD+......
Examples:
1.
2.
3.
4.
F = [(ab) + (cd) + e]
F = a[b+c(d+e)+fg] +hij + k
F = [(a+b)c + d]e +f
F1 = (A + B)C+F+DE . F as given in (1)
Assignments
Implement the following expressions using i) NOR gates only ii) NAND gates only
1. F (A,B,C,D) = m(11,12,13,14,15)
2. F (A,B,C,D) = m(3,7,11,12,13,15)
3. F (A,B,C,D) = m(3,7,11,12,13,15)
Simplify
SOME QUESTIONS
1.(a)State Duality theorem.List Boolean laws and their Duals.
(b)Simplify the following Boolean functions to minimum number of literals:
i. F = ABC + ABC + AB
ii. F = (A+B) (A+B).
(c)Realize XOR gate using minimum number of NAND gates
2. Simplify the following Boolean expressions using K-map and implement them using NOR gates:
(a) F (A, B, C, D) = ABC + AC + ACD
(b) F (W, X, Y, Z) = WXYZ + WXYZ + WXYZ + WXYZ
3.(a)Simplify the following Boolean functions to minimum number of literals:
i. ( a + b ) ( a + b )
ii. y(wz + wz) + xy
(b) Prove that AND-OR network is equivalent to NAND-NAND network.
(c) State Duality theorem. List Boolean laws and their Duals.
4.(a)What are dont-care conditions? Explain its advantage with example.
5. (a) List the Minterms and Maxterms for three binary variables.Draw the truthtable and express the Boolean
function F(A,B,C) whose minterms are 1,3,5 ,7as Canonica Sum of Minterms form.
(b) Simplify the following Boolean functions to minimum number of literals:
i. F = XY + XYZ + XY
ii. F = X + Y[ Z + (X+Z) ]
(c) For the logic expression Y = AB + AB:
i. Obtain the truth table.
ii. Name the operation performed.
iii. Realize this using AND, OR, NOT gates.
6.(a)State and prove the following Boolean laws:
i. Commutative
ii. Associative
iii. Distributive.
(b)Find the complement of the following Boolean functions and reduce them to minimum number of literals:
i. (bc+ ad) (ab + cd)
ii. bd + abc + acd + abc
(c) Which gate can be used as parity checker? Why?
***