Boolean Algebra - 2008 2015 08 09 16 17 09 768
Boolean Algebra - 2008 2015 08 09 16 17 09 768
Boolean Algebra - 2008 2015 08 09 16 17 09 768
Cambridge School
Boolean Algebra
Boolean algebra, also known as "the algebra of logic" was developed by an Eng!ish
mathematician George Boole. The original purpose of this algebra was to solve logic
Problems. Algebric logic states that a binary statement or a binary decision has two
values associated with it. These two values are True and False. Boolean algebra
effectively deals with binary decision. The concept of Boolean algebra was used by
Claud E. Shanor. to design electrical circuits and later on it was used to develop modern
high speed digital computers.
Logical Statement The Statements, which can be determined to be TRUE or FALSE are called loqical
statements or truth functions.
If the truth value of any logical statement or expression is always True or 1,it is called
Tautology and the truth value is always False or 0 it is called Fallacy.
Interrogatory and exclamatory statement can not be considered as logical statements.
What are you doing? Can't be answered in TRUE or FALSE
Logical ConstantsThe Truth Values of a logical statement are known as Logical Constants. Truth values are
depicted by logical constants TRUE (1) and FALSE (0).
Logical VariablesThe variables which can store these truth values are called Logical Variables or Boolean
variable. or Binary Valued Variables as these can store one of the two values TRUE or
FALSE.
Eg. 13-11=2 is always TRUE and Delhi is the largest state in India is always FALSE.
Boolean Literals :
A Boolean variable is denoted by alphabets A-Z and a-z. A Boolean variable in direct or
complemented form present in an expression is called a literal.
Truth Table
Truth Table is a table, which represents all the possible Truth values of logical variables/
statements along with all the possible results of the boolean expression they are making. To
construct truth table of n variables the truth table will have 2n rows where each row will
represent a combination of values of each variable where n = total no. of logical variables.
For eg. to construct the truth table of two variables X & Y, well have 22 = 4 rows.
So, all possible truth values of 2 variables will be:
X
Y
0
0
0
1
1
0
1
1
Similarly, truth values of three variables will have 8 combinations:
X
Y
Z
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
Class XII Computer Science
1
[Type text]
Cambridge School
1
1
1
1
0
1
Logical Operator
Boolean algebra contains 3 basic logical operators like AND, OR and NOT. These logical
operators are used to combine logical variables and logical constants to form logical
expression or compound statement. Assuming X, Y and Z as logical variables, some
examples of Logical Expression or Compound statement is given below:
X AND Y OR Z
NOT X OR Y AND Z
NOT Operator ( )
NOT operator is an unary operates which operates on a single logical variable. The
operation performed by NOT operator is called complementation and the symbol we use
for NOT is _(bar) or . Thus X means complement of X and NOT operation negates the
statement i.e if a statement X is TRUE X is FALSE and vice versa.
Example:
F:
I will go out today.
F :
I will not go out today.
Truth Table Of NOT operator
X
0
1
X / X
1
0
OR operator (+)
A second important operator in boolean algebra is OR operator which denotes operation
called logical addition and the symbol we use for it is +. The symbol therefore, does not
have the 'normal' meaning, but is a logical addition or logical OR symbol. Thus X+Y can
be read as X OR Y. For OR operation the possible input and output combinations are as
follows :
0+0=0
0+1=1
1+0=1
1+1=1
Truth table of OR operator
X
Y
X+Y
0
0
0
0
1
1
1
0
1
1
1
1
AND Operator (.)
AND Operator is another binary operator which performs logical multiplication. The
symbol for AND operation used is (.) dot. Thus X.Y will be read as X and Y. The rules for
AND operation are : 0 . 0 = 0
0.1=0
1.0=0
1.1=1
The truth table for AND is as given below :
X
Y
X .Y
0
0
0
0
1
0
Class XII Computer Science
2
[Type text]
Cambridge School
1
1
0
1
0
1
Q1.
Q2.
Y'
1
0
1
0
X' . Y'
1
0
0
0
Z
1
0
1
0
1
0
1
0
XYZ
0
0
0
0
0
0
1
0
XYZ
0
1
0
0
0
0
0
0
F
0
1
0
0
0
0
1
0
[Type text]
Cambridge School
operations are performed by logic gates. A gate is simply an electronic circuit which
operates on one or more signals to produce an output signal.
Gates are digital (two-state) circuits because the input and output signals are either low
voltage (denotes 0) or high voltage (denotes 1). Gates are often called logic circuits because
they can be analyzed with the boolean algebra.
There are three basic types of logic gates
1.
NOT gate
2.
OR gate
3.
AND gate
NOT Gate
The NOT gate has only one input signal and one output signal; the output state is always
the opposite of the input state. The output is also called complement gate (or Inverter) as it
complements the input.
OR Gate
The OR gate has two or more input signals but only one output signal. If any of the input
signals is 1 (high), the output signal is 1(high). An OR gate can have as many inputs as
desired. No matter how many inputs are there, the action of OR gate is same.
A
B
A+B
AND Gate
The AND gate can have two or more than two input signals and produce an output signal.
When all the inputs are 1 i.e. High than the output is 1 otherwise output is 0 . If any of the
inputs is 0, the output is 0. To obtain output 1 both the input must be 1. An AND gate can
have as many inputs as desired.
A.B
Circuit Implementation Of Boolean Expression
Boolean expression can be represented with the help of logic gates of AND, OR, NOT.
Example
ABC.(A+D)
[Type text]
Cambridge School
(A.B.C).(A+D)
(It is a fallacy)
(It is a tautology)
1+X
1
1
0.X
0
0
1.X
0
1
When X and Y are logical statements ( X, YB), then the result of operations X+Y B
and X.YB
Truth Table of X+Y
X
Y
0
0
0
1
1
0
1
1
X+Y
0
1
1
1
Identity law
0+X=X
Class XII Computer Science
5
[Type text]
Cambridge School
1.X=X
(ii)
(iii)
Indempotent law
X+X=X
X.X=X
Proof
X
0
1
X.X
0
1
X
1
0
(X)
0
1
Involution law
(X) = X
Proof
X
0
1
(iv)
X+X
0
1
(v)
Commutative law
- X+Y=Y+X
- X.Y=Y.X
(vi)
Associative law
- X + (Y + Z) = (X + Y) + Z
- X (Y Z) = (X Y) Z
(vii)
Distributive law
- X (Y + Z) = XY + XZ
- X + (YZ) = (X + Y)(X + Z)
Algebraic proof
X + (YZ) = (X + Y)(X + Z)
R.H.S
(X + Y)(X + Z)
= XX+XZ+YX+YZ
= XX+XY+XZ+YZ
= X+XY+XZ+YZ
= X(1+Y)+Z(X+Y)
= X+ZX+ZY
= X(1+Z)+ZY
= X + ZY
X . X
0
0
As XX=X
As 1+Z=1
[Type text]
Cambridge School
X
Y
XY
0
0
0
0
1
0
1
0
0
1
1
1
Prove using postulates.(algebraic proof)
X+XY
= X(1+Y) = X.1 = X = R.H.S.
- X(X + Y) = X
Proof using truth table.
X
Y
X+Y
0
0
0
0
1
1
1
0
1
1
1
1
Prove using postulates.(algebraic proof)
X(X+Y)
=XX + XY
(distribution law)
=X + XY
(Indepotence law)
=X(1+Y)
taking X common
=X . 1
=X
Some other rules for Boolean Algebra
(i)
X+XY = X + Y
L.H.S.
= (X+X) . (X+Y)
= 1.(X+Y)
= X+Y
(ii)
X+YX =X
0
0
1
1
X.(X+Y)
0
0
1
1
XY + YZ +YZ =XY+Z
LHS
=XY + Z(Y+Y)
=XY+Z
Hence Proved.
De Morgan's Theorem
To prove DeMOrgans theorem we will use Complementary law
-
[Type text]
Cambridge School
Using Demorgans law, we have to prove
(X+Y) + (X'Y') = 1
L.H.S. = X'Y' + (X + Y)
Using distributive law
.
=(X+Y+X').(X+Y+Y')
=Y+1 . X+1=1
(X+Y). X'Y' = 0
Using distributive law
=X'Y'X + Y'X'Y
=0.Y' + 0.X'
=0 + 0 =0
Y
0
1
0
1
(X+Y)' X'
1
1
1
0
0
0
0
0
Y'
1
0
1
0
X'Y'
1
0
0
0
X
0
0
1
1
Y
0
1
0
1
(XY).(XY)' = 0
(XY).(X'+Y') =0
LHS=
XYX' + XYY'
=0.Y + 0.X
=0 + 0
=0
(XY)'
1
1
1
0
X'
1
1
0
0
Y'
1
0
1
0
X'+Y'
1
1
1
0
(X+Y)(X+Z) = X+YZ
=XX+XZ+XY+YZ
= X+XZ+XY+YZ
=X(1+Z)+XY+YZ
= X+XY+YZ
= X(1+Y) +YZ = X+YZ
AS
AS
XX=X
1+Z=1
(A+B)(A+B'+C) = (A+B)(A+C)
=AA+AB'+AC+AB+BB'+BC
Class XII Computer Science
8
[Type text]
Cambridge School
=A+ AB'+AB+AC+BB'+BC
=A+A(B+B')+AC+BC
=A+A+AC+BC
=A+AC+BC
=A(1+C)+BC
=A+BC
=(A+B)(A+C)
4.
AS
AA=A AND BB'=0
B+B'=1
A+A=A
1+C=1
AB+A'C+BC=AB+A'C
=AB+A'C+BC.1
=AB+A'C+(A+A')BC
=AB+A'C+ABC+A'BC
=AB+ABC+A'C+A'BC
=AB(1+C)+A'C(1+B)
=AB+A'C
AS
A+A'=1
AS
1+C=1
AS
C+C=1
(III)
(IV)
(V)
ABC+AB'C'+A'B'C'
=ABC+B'C'(A+A)
=ABC+B'C'
= B(AC+C)
= B(C+C)(C+A)
= B(C+A)
AB+AB'+A'C+(AC)'
AS (AC)'= A'+C'
=AB+AB'+A'C+A'+C'
=A(B+B')+A'(1+C)+C'
=A+A'+C'
AS
A+ A'=1
=1+ C'
1+C'=1
=1
XY(X'YZ'+X(YZ)')
AS
(YZ)'= Y'+Z'
=XY(X'YZ'+X(Y'+Z'))
=XY(X'YZ'+XY'+XZ')
=XY XY'Z'+XXYY'+XY XZ'
AS
YY'=0 AND XX=X
=0+0+XYZ'
=XYZ'
( XYZ + X ( YZ) +XYZ )
= (XYZ). ( X(YZ)). ( XYZ) USING DE MORGANS THEOREM
= (X + Y + Z)(X + (YZ))(X +( Y) + Z)
= (X + Y + Z)(X + YZ)(X + Y + Z)
AS XX=X & YY=0
= ( X + XYZ + XY + XZ )( X + Y + Z)
= X(1 + YZ + Y + Z ) (X + Y + Z)
As 1+X=1
Class XII Computer Science
9
[Type text]
Cambridge School
=
=
=
=
=
=
(VI)
X( X + Y +Z)
X + XY +XZ)
X(1+Y)+XZ
X+XZ
X(1+Z)
X
Exercise
Q1. Prove Using Boolean Algebra.
(I)
AB'+B'C = AB'C+AB'C'+A'B'C
(II)
(A+B)(A+B') = A
(III)
AB+A'C+BC = AB+A'C
(IV)
AB+AB'C = AB +AC
(V)
(A+B)(A'+C) = AC+A'B
(VI)
(A+B)(A'+B')=A'B+A.B'
(VII)
(A'+B')(A'+B)(A+B') = A'B'
(VIII) AB+(A+B).ABC = AB
(IX)
AB'+BC'+CA'=A'BC +AB'C+ABC'+AC'B'+A'BC'+B'A'C
(X)
(XY)+(YZ)+(Z'Y) = Y
Q2. SIMPLIFY
(I)
(AB)'+A+AC
(II)
AB+AB'
(III)
ABC+A'BC+AB'C+ABC'+AB'C'+A'BC'+A'B'C'
(IV)
XY+XYZ'+XY'Y+XYZ
(V)
XY(X'YZ'+XY'Z'+XYZ)
Principle of Duality
Duality provides a way of transforming one Boolean expression into another. According to
the principle - every valid Boolean expression there exists an equally valid dual expression.
If a boolean expression is valid then the dual of that expression will also be valid. The
formulation of dual expression is carried out by following steps :
1.
Replace all 1's by 0's and 0's by 1'
Class XII Computer Science
10
[Type text]
2.
3.
Cambridge School
Example
A+(B.C) = (A+B).(A+C)
Dual of this expression is A.(B+C) = (A.B)+(A.C)
This can be proved by using a truth table.
Exercise
Q1. Find the dual expression of the following boolean expressions.
(i)
(X'+Y)(X+Y')
(ii)
XY+XY'+X'Y
(III) A+(A'B)
(IV) (A.1).(0.A')
(V)
(X'+Y+Z) (X+Y'+Z)(X+Y)
(VI) A.(B+C)
Complement of Boolean Expression
Complement of a Boolean expression is obtained by using NOT operator to the expression.
To get the complement of an expression
First the complement (not) of the expression is written.
Then the expression is simplified using de morgan's law
Example-
f = a+b+c'
f ' = (a+b+c)'
= a'b'(c')'
= a'b'c
[Type text]
Cambridge School
[Type text]
Cambridge School
For that row consider the truth value of each literal and represent each as direct
variable if its truth value is equal to 1 and complemented when its truth value is 0
Example
1. XY+YZ+Z'
X
Y
Z
XY
YZ
Z'
XY+YZ+Z'
Min term
0
0
0
0
0
1
1
x'y'z'
0
0
1
0
0
0
0
0
1
0
0
0
1
1
x'yz'
0
1
1
0
1
0
1
x'yz
1
0
0
0
0
1
1
xy'z'
1
0
1
0
0
0
0
1
1
0
1
0
1
1
xyz'
1
1
1
1
1
0
1
xyz
The required SOP form is: =
X'Y'Z'+X'Y Z'+X'YZ+XY'Z'+XYZ'+XYZ
2.
A+B
AB
A+B
0
0
0
Min term
0
1
1
A'B
1
0
1
AB'
1
1
1
AB
The required SOP form is: A'B+AB'+AB
Exercise
Q1
Convert the SOP expression to its canonical forms.
(i)
x+x'y+x'z'
(ii)
yz+x'y
(iii) AB'(B'+C')
Shorthand Minterm Notation
Every Minterm of a Boolean expression can be represented as a number using short hand
notation. To get the shorthand notation
Substitute 0s for complemented literal and 1s for direct literal
Express it to its decimal equivalent
For example the canonical SOP equation A'B+AB'+AB can be represented as
A'B - 01 = 1
AB' - 10 = 2
AB - 11 = 3
Now the canonical SOP equation can now be written as (1,2,3)
Conversion to POS expression to Canonical POS expresion
To convert a POS expression to Canonical POS,
In each term of the expression if any literal is missing, add that term with missing term . complement of(missing term))
Expand the expression
Remove all dupilicate terms
Example
1
(X+Y)(X+Z)
=((X+Y)+(Z.Z')]((X+Z)+YY'))
XX' = 0
=(X+Y+Z).(X+Y+Z')(X+Z+Y)(X+Y'+Z)
A+0 = A
=(X+Y+Z) (X+Y+Z')(X+Y'+Z)
Class XII Computer Science
13
[Type text]
Cambridge School
(A+B')(A+B'+C)(B+C')
=((A+B')+CC')(A+B'+C)((B+C')+AA')
=(A+B'+C)(A+B'+C')(A+B'+C)(A+B+C')(A'+B+C')
=(A+B'+C)(A+B'+C')(A+B+C')(A'+B+C')
F=(A+B)(A'+C)(B+C)
A'
A
B
C
1
0
0
0
1
0
0
1
1
0
1
0
1
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
0
1
1
1
The required canonical POS is
(A+B+C)(A+B+C')(A'+B+C)
A+B
0
0
1
1
1
1
1
1
A'+C
1
1
1
1
1
1
1
1
B+C
0
1
1
1
0
1
1
1
F
0
0
1
1
0
1
1
1
MAX TERM
A+B+C
A+B+C'
A'+B+C
Exercise
1.
Convert the POS expression into canonical forms
(i)
(A+C)(C+D)
(ii)
A(B+C)(C+D)
(iii) (x+y)(y+z)(x+z)
2.
Get the POS expression from the truth table
(i)
X
Y
Z
F
(ii)
X
Y
0
0
0
0
0
0
0
0
1
1
0
0
0
1
0
1
0
1
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
1
1
0
Z
0
1
0
1
0
1
F
1
1
0
1
1
0
[Type text]
Cambridge School
1
1
1
1
0
1
1
0
1
1
1
1
0
1
0
1
[Type text]
Cambridge School
Map Rolling: Roll the k-map i.e. consider the map as if its left edges are touching the right
edges and top edge touching the bottom edge. The following figures show all possible
combinations of grouping and their corresponding simplification.
While encircling the groups first search for octet, then quads and then pair. This is because
the larger group removes more variables there by making the resultant expression simpler.
If we have an isolated plotted cell (i.e it cannot be grouped with other cells), then it is
written as it is.
After grouping to simplify the expression, remove the literal, which changes its state and
consider only those literals, which remain same for all cells in the considered group.
When one group is completely overlapped by another group that group becomes the
redundant group and should be removed
Simplification of SOP equation using K-map
Karnaugh Map For Boolean expression using 3 variables:F (A,B,C ) = A B C + ABC + ABC + ABC
F (A, B, C) = (0, 5, 6, 7 )
Draw the K-map with 2 3cells where each cell will represent the all possible Min terms.
Class XII Computer Science
16
[Type text]
Cambridge School
To represent each min term in K-map represent 2 literals (A and B ) in one dimension and
C in another. Each minterm can be represented using its Shorthand notation. The
following are the Possible min terms and their corresponding shorthand notations.
Minterms
Shorthand notation
ABC
000
0
ABC
001
1
ABC
010
2
ABC
011
3
ABC
100
4
ABC
101
5
ABC
110
6
ABC
111
7
Step1: The first step is to draw the Karnaugh Map for the given no of variables (3 in this
case) and plot the cells with 1s for the given combinations.
AB
C
C
AB
AB
AB
AB
1
0
C
1
Note: here 11 and 10 exchanged positions because in k-maps moving from one cell to
another horizontally or vertically only one variable/literal should exchange from 0 to 2 or 2
to 0.
From the given Karnaugh Map, we get an isolated 1 in the cell A B C (which cant be
grouped or simplified) and pair in cell A B C and A B C (variable C is changing so it is
eliminated) and another pair in cell A B C and A B C (variable B is changing so it is
eliminated).Hence, the reduced expression is:ABC + AB + AC
=AB(C+1)+AC
=AB+AC
=A(B+C)
Karnaugh Map For Boolean expression using 4 variables:Let us consider a canonical SOPexpression - F(A,B,C,D) = (0,1,3,5,7,8,10,11)
0 - ABCD
1 - ABCD
3 - ABCD
5 ABCD
7 ABCD
8 - ABCD
10 - ABCD
11 ABCD
[Type text]
Cambridge School
he K-map will have 16 cells where A and B will be represented in one dimension and C and D will
be represented.
[Type text]
Cambridge School
Besides the three basic logic gates (NOT, AND and OR), there are some more gates
derived from the three basic gates.
NAND GateThis gate is a combination of NOT and AND gates. This gate takes two or more input
signals and produces one output. If all the input signals are 1 then the output produced is 0
otherwise the output is 1.
A
B
(A.B)'
0
0
1
0
1
1
1
0
1
1
1
0
Logic gate for NAND is
[Type text]
Cambridge School
(A.B)'
NOR GateThis gate is a combination of NOT and or gates. This gate takes two or more input signals
and produces one output. If all the input signals are 0 then the output produced is
1otherwise the output is 0.
A
B
(A+B)'
0
0
1
0
1
0
1
0
0
1
1
0
Logic gate for NOR is
XOR GateThis gate takes two or more input signals and produces one output. XOR gate results 1 for
those input combinations that have odd number of 1s
A
B
(AB)
0
0
0
0
1
1
1
0
1
1
1
0
Logic gate for XOR is
XOR
XNOR Gate
This gate is a combination of NOT and XOR. It takes two or more input signals and
produces one output. XNOR gate results 1 when the input combinations have even number
of 1s
A
B
(AB)'
0
0
1
0
1
0
1
0
0
1
1
1
(AB)'
XNOR
[Type text]
Cambridge School
(AB)
y =(( AB))
NAND as OR gate
f=((X+Y))=(X.Y)
A
A.B
B
B
Implementation of NOR Gate
NOR as NOT gate
If f = A, Not f = A
A
y=A
NOR as OR gate
If f = A+B =((A+B))'
A
B
A+ B
y=A+B
A.B
B
Class XII Computer Science
21
[Type text]
Cambridge School
Example
Draw the logic circuit of the following using NOR gate only
P=(x+y)(y+z)(z+x)
Ans
P
= (x+y)(y+z)(z+x)
= (((x+y)(y+z)(z+x)))
= ((x+y)+(y+z)+(z+x))
Now the above expression can be implemented through NOR gate
Circuit Diagram using NOR gate
[Type text]
Cambridge School
Sample Questions
Q1 a Draw a Logical Circuit Diagram for the following Boolean Expression
X . (Y + Z)
Ans:
X
Y
Z
(b)
Convert the following Boolean expression into its equivalent Canonical Sum of
Product Form((SOP)
(X+Y+Z).(X+Y+Z).(X+Y+Z).(X+Y+Z)
Ans:
F( X , Y , Z ) = (4 , 5 , 6 , 7)
= (0 , 1 , 2 , 3)
= X. Y. Z + X. Y. Z + X. Y. Z + X. Y. Z
(c)
Ans:
AB
CD
AB
1
AB
AB
1
12
CD
1
CD
CD
1
1
13
15
11
14
10
[Type text]
Cambridge School
W.X +Y.Z
F
Y
Z
Y.Z
F = W.X + Y.Z
(c)
Ans:
UV UV
WZ
WZ
WZ
WZ
UV
UV
12
13
15
14
1
1
11
10
[Type text]
Ans
b.
Ans
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
G(U,V,W) = (2, 3, 6) = (U+V+W).(U+V+W).(U+V+W)
Verify XY+X.Y+XY= (X+Y) using truth table.
X
0
0
1
1
c.
Ans
Cambridge School
Y
0
1
0
1
X
1
1
0
0
Y
1
0
1
0
XY
0
1
0
0
XY
0
0
1
0
XY
1
0
0
0
XY+XY+XY
1
1
1
0
0
0
1
1
0
1
X+Y
1
1
1
0