Boolean Algebra the basic fundamentals of computer science
1. XI Computer Science
UNIT-1
Chapter-3
Boolean Algebra
• Introduction to Boolean Algebra
• Logical Operators NOT, AND, OR, and
Boolean Logic
• Principle of Duality
• Basic Postulates of Boolean Algebra
• DeMorgan’s Theorem
• Universal Gates (NAND, NOR) , XOR
• Truth Tables
2. operation called NOT denoted by prime(’)/not/bar symbol.
Boolean Algebra uses a set of Laws and Rules to define the
operation of a digital logic circuit.
WHAT IS BOOLEAN
ALGEbRA?
WHO INTRODUcED IT?
In 1854, Mathematician George Bool introduced a
systematic treatment of logic and develop for this program and
algebraic system called BOOLEAN ALGEBRA.
In 1938, Sennon demonstrated that the properties of by-
stable switching circuits can be represented by this algebra
and
called it SWITCHING ALGEBRA.
BY WHAT IT IS MADE OY???
A Switching Algebra or Boolean Algebra is an algebraic
system consisting of the set {0,1} the binary operations ‘OR’ &
‘AND’ denoted the symbol ‘+’ and ‘.’ respectively and unary
3. LOGICAL OPERATORS
• Boolean algebra also deals with functions which have their values in the set {0,
1}. The basic operations of Boolean algebra are as follows:
• Conjunction ( AND operation)
• Disjunction ( OR operation)
• Negation ( Not operation)
TRUTH TABLE:
• A Truth Table is a table which represents all the possible input combinations of
logical variables along with all the possible results/output of the given
combinations of values.
LOGIC GATES:
• Logic gates are the basic building blocks of any digital system. It is an
electronic circuit having one or more than one input and only one output.
The relationship between the input and the output is based on a certain logic.
Based on this, logic gates are named as AND gate, OR gate, NOT gate etc.
4. AND
OPERATOR
Operation performed by AND operator is called
Logical Multiplication. Thus X.Y means X AND Y.
0.0=0
0.1=0
1.0=0
1.1=1
The Symbol and Truth table of AND gate
X Y F= ( X.Y)
0 0 0
0 1 0
1 0 0
1 1 1
X
Y
F
5. X
F
Y
X Y F=(X+Y)
0 0 0
0 1 1
1 0 1
1 1 1
OR
OPERATOR
Operation performed by OR operator is called
Logical Addition. Thus X+Y means X OR Y.
0+0=0
0+1=1
1+0=1
1+1=1
The Symbol and Truth table of OR gate
6. X X’
0 1
1 0
This operator operates on single variable and
operation performed by NOT operator is called
complementation. Thus X’ means complement
of X.
0’=1
1’=0
The Symbol and Truth table of NOT gate
X X’
NOT
OPERATOR
7. W h a t is B a s i c Postulates Of B o o l e a n
Al ge b ra?
Boolean algebra, consists of fundamental laws that are used to build
a workable, cohesive framework upon which are based the theorem of
Boolean algebra. These fundamental laws are known as Basic
Postulates Of Boolean Algebra.
POSTULATES
i. If X!=0 then X=1; If
X!=1 then X=0
ii. OR relations
0+0=0
0+1=1
1+0=1
1+1=1
iii. AND relations
0.0=0
0.1=0
1.0=0
1.1=1
iv. NOT relations
0’=1
1’=0
8. WHAT IS THE PRINcIPLE OY
DUALITY?
This principle states that starting with a Boolean relation,
another Boolean relation can be derived by:
1. Changing each OR sign(+) to an AND sign(.)
2. Changing each AND sign(.) to an OR sign(+)
3. Replacing each 0 by 1 and each 1 by 0.
EXAMPLE:-
If X.Y=1 then its dual will be X+Y=0
, where X & Y belongs to 0,1.
EXAMPLE:-
If (X+Z)(Y+1)=1 then its dual will be
X.Z+Y.0=0
, where X & Y belongs to 0,1.
NOTE:-
The derived relation using duality principle is called
10. 1.Properties of 0 and 1
a)
0+X=X
b)
1+X=1
c)
0.X=0
d)
1.X=X
0 X R=X
0 0 0
0 1 1
1 X R=1
1 0 1
1 1 1
0 X R=0
0 0 0
0 1 0
1 X R=X
1 0 0
1 1 1
0
X
X
1
X
1
0
X
0
1
X
X
11. 2. Indempotence Law
a) X+X=X
X X R=X
0 0 0
1 1 1
X
X
X
b) X.X=X
X X R=X
0
0
0
1
1
1
X
X
X
i.e.,
0+0=0
1+1=1
i.e.,
0.0=0
1.1=1
The law states that,
13. 4.Complementarity Law
a)
X+X’=1
X X’ R=X+X’
0 1 1
1 0 1
X
X’
b)
X.X’=0
X X’ R=X.X’
0 1 0
1 0 0
X.X’=0
i.e.,
0+1=1
1+0=1
i.e.,
0.1=0
1.0=0
X+X’=1
X’
X
The law states that,
14. 5.Commutative Law
X
Y R
Y
X R
a)
X+Y=Y+X
The law states that,
X Y R=X+Y R=Y+X
0 0 0 0
0 1 1 1
1 0 1 1
1 1 1 1
+ is
17. X Y Z YZ XY R=X(YZ) R=(XY) Z
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 0 0 0 0 0
0 1 1 1 0 0 0
1 0 0 0 0 0 0
1 0 1 0 0 0 0
1 1 0 0 1 0 0
1 1 1 1 1 1 1
Y
Z
Y
R
R
Z
X X XY
YZ
b) X (Y.Z)=(X.Y)
Z
6.Associative Law
The law states that,
18. Y
Z
R
X
Y+Z
Y
X
R
Z
XY
XZ
X Y
Z
Y+Z XY XZ R=X(Y+Z) R=XY+XZ
0 0
0
0 0 0 0 0
0 0
1
1 0 0 0 0
0 1
0
1 0 0 0 0
0 1
1
1 0 0 0 0
1 0 0 0 0 0 0
a) X(Y+Z)=XY+XZ
7. Distributive Law (First)
The law states that,
19. Y
Z
R
X
Y.Z
Y
X
R
Z
X+Y
X+Z
b)X+YZ=(X+Y).(X+Z)
R.H.S = (X+Y).(X+Z)
=X.(X+Z)+Y.(X+Z)
= X.X+XZ+XY+YZ
=X+XZ+XY+YZ
=(X.1)+XZ+XY+YZ
=X(1+Z+Y) + YZ
=X.1+YZ
=X+YZ = Hence
(Distributive Law1
X(Y+Z)=XY+XZ)
(Properties of 0 and 1)
(Properties of 0 and 1 ,
X=X.1)
(Properties of 0 and 1)
7. Distributive Law (Second)
The law states that,
PROOF ( By Algebraic
Method)
21. X
X
Y
a) X+XY=X
XY
X Y X.Y X+XY
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
=R.H.S.
PROOF ( By Algebraic
Method)
L.H.S. = X+XY
=X(1+Y)
=X.1 = X
(By Properties of 0 and
1)
Hence
8. Absorption Law
The law states that,
22. X
The law states that,
X
Y X.Y
PROOF ( By Algebraic
Method)
b) X(X+Y)=X
L.H.S =X(X+Y)
=X.X+X.Y
=X+X.Y
=X(1+Y)
=X
=R.H.S Hence
(Distributive Law )
(Indempotence
Law)
(Properties of 0 and
1), 1+Y=1
8. Absorption Law
23. DEMORGAN’S /IRST
THEOREM (X+Y)’=X’.Y’
X
Y
R
X+Y
X’
Y’
X
Y
Let us assume that P=X+Y where P,X,Y are logical
variables. Then, according to complementarity law,
P+P’=1 and P.P’=0.
i.e., if P=X+Y then P’=X’Y’ , so,
P+P’= (X+Y)+X’Y’ must be equal to 1
and P.P’ = (X+Y).(X’Y’) must be equal to 0
It states that
NOTE: BOTH THE DEMORGANS THEOREM CAN BE PROVED USING TRUTH TABLE ALSO
X+Y
R
X’.Y’
24. Hence First Part Proved
Let us prove the first part of 1st theorem,
i.e.,
(X+Y)+(X’Y’)=1
(Distributive Law: A+BC=(A+B).
(A+C) ) (Complementarity Law:
X+X’=1)
(Properties of 0 and
1)
(Properties of 0 and
1)
L.H.S.
= (X+Y)+(X’Y’)
= (X+Y+X’).(X+Y+Y’)
= (1+Y).(X+1)
= 1.1
= 1
25. Hence Second Part Proved
Now, let us prove the second part of 1st
theorem, i.e.,
(X+Y).(X’Y’)=0
(Distributive Law):
A+B).C=A.C+A.B (Associative
Law): X.Y=Y.X
(Complementarity Law):
X.X’=0
(Properties of 0 and 1)
(Properties of 0 and 1)
L.H.S.
= (X+Y).(X’Y’)
= (XX’Y’)+(YX’Y’)
= (XX’Y’)+(X’YY’)
= (0.Y’) + (X’.0)
= 0+0
= 0
Thus, De-Morgan’s 1st Law proved (X+Y)’=X’.Y
26. (X.Y)’=X’+Y’
X
Y
R
XY
R
X’
Y’
X
Y
Let us assume that P=X.Y where P,X,Y are logical
variables. Then, according to complementarity law,
P.P’=1 and P.P’=0.
i.e., if P=X.Y then P’=X’+Y’ so, we have to
prove
P+P’= XY+(X’+Y’) must be equal to 1
and P.P’= XY.(X’+Y’) must be equal to 0
DEMORGAN’S SEcOND
THEOREM
It states that,
XY X’+Y’
27. L.H.S.
= XY+(X’+Y’)
=(X+X’+Y’).(Y+X’+Y’)
= (X+X’+Y’).(X’+Y+Y’)
= (1+Y’). (X’+1)
= 1.1
= 1
Let us prove the first part of 2nd theorem, i.e.,
XY+(X’+Y’)=1
(Distributive Law:
A+BC=(A+B).
(A+C) )
(Commutative Law):
X+Y=Y+X (Properties of 0 and
1): X+1=1
(Properties of 0 and 1): 1.1=1
Hence First Part Proved
28. L.H.S.
= (XY).(X’+Y’)
= XY.X’+XY.Y’
= X.X’.Y + X.Y.Y’
= 0.Y + X.0
= 0+0
= 0
Now, let us prove the second part of 2nd
theorem, i.e.,
XY.(X’+Y’)=0
Hence Second Part Proved
Thus, De-Morgan’s 2nd Law proved (XY)’=X’+Y’
(Distributive Law):
A+B).C=A.C+A.B (Associative
Law): X.Y=Y.X
(Complementarity Law): X.X’=0
(Properties of 0 and 1)
(Properties of 0 and 1)
29. Boolean Algebra Rules
1. 0+X=X Properties of 0
2. 0.X=0
3. 1+X=1 Properties of 1
4. 1.X=X
5. X+X=X Indempotence Law
6. X.X=X
7. (X’)’=X Involution Law
8. X+X’=1 Complementarity Law
9. X.X’=0
30. Boolean Algebra Rules
10. X+Y=Y+X
Commutative Law
11. X.Y=Y.X
12. X+(Y+Z)=(X+Y)+Z
Associative Law
13. (X.Y).Z=X.(Y.Z)
14. X(Y+Z)=XY+XZ
Distributive Law
15. X+YZ=(X+Y).(X+Z)
16. X+XY=X
Absorption Law
17. X(X+Y)=X
18. X+X’Y=X+Y Third Distributive Law
19. (X+Y)’=X’.Y’
Demorgan’s Theorem
20. (X.Y)’=X’+Y’
32. NAND Gate
NAND gate is a universal gate which is a
combination of AND with NOT
2 input NAND
Gate
X
Y
3 input NAND
Gate
P
Q
R
4 i
n
p
X Y X.Y F= X.Y
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0
X
Y
F= X.Y
X Y Z X.Y.Z X.Y.Z
0 0 0 0 1
0 0 1 0 1
0 1 0 0 1
0 1 1 0 1
1 0 0 0 1
1 0 1 0 1
1 1 0 0 1
1 1 1 1 0
33. NOR Gate
NOR gate is a universal gate which is
a combination of OR with NOT
2 input NOR
Gate
X
Y
3 input NOR
Gate
P
Q
R
4 input NOR
Gate
A
B
C
X Y X+Y F=X+Y
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0
X
Y
F= X+Y
X Y Z X+Y+Z F=X+Y+Z
0 0 0 0 1
0 0 1 1 0
0 1 0 1 0
0 1 1 1 0
1 0 0 1 0
1 0 1 1 0
1 1 0 1 0
1 1 1 1 0
F
F
F
34. XOR Gate
XOR gate produces output 1 for only those
input combinations that have ODD number of
1’s
3 input XOR
Gate
P
Q
R
4 input XOR
Gate
A
B
C
No. of 1’s
Even/Odd X Y X + Y
Even 0 0 0
Odd 0 1 1
Odd 1 0 1
Even 1 1 0
X
Y F = X + Y
No. of 1’s X Y Z F = X + Y + Z
Even 0 0 0 0
Odd 0 0 1 1
Odd 0 1 0 1
Even 0 1 1 0
Odd 1 0 0 1
Even 1 0 1 0
Even 1 1 0 0
Odd 1 1 1 1
F
F
XOR Addition can be summarized as:
0 + 0=0
1 + 0=1
0 + 1=1
1 + 1=0
36. Q) Verify the following expression using Truth Table:
(A’+B’).(A+B) = A’.B + A.B’
Solution :
A B A’ B’ A’+B’ A+B (A’+B’).(A+B) A’.B A.B’ (A’.B)+(A.B’)
0 0 1 1 1 0 0 0 0 0
0 1 1 0 1 1 1 1 0 1
1 0 0 1 1 1 1 0 1 1
1 1 0 0 0 1 0 0 0 0
Since, Column no. 7 and 10 are having same values as per the given
question. Hence, proved.
38. Q) Draw a logic circuit for the following expression:
F(X,Y,Z) = (X+Y’+Z).(X+Y’+Z’)
Solution:
X
Y’
Z
X
Y’
Z’
F
(X+Y’+Z).(X+Y’+Z’)
X+Y’+Z
X+Y’+Z’
39. Q) Write the equivalent Boolean expression for
the following logic circuit:
Solution :
F(A,B,C) = A’B+AB+B’C
F
40. Q) Draw a logic circuit for the following expression:
F(A,B,C) = (AB’C)+(C’B)
Using NAND-to-NAND Logic Gate only.
Solution:
A
B
C
C
B
C’
B’
F(A,B,
C)
(AB’C). (C’B)
= (AB’C)+ (C’B)
= (AB’C)+(C’B)
(A.B’.C)
(C’.B)
De-Morgan’s
Theorem
(applied).
NOTE: No need to solve. Directly write the answer. This is done just to
prove and show.