Vous êtes sur la page 1sur 25

[Type text]

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

Evaluation of a boolean expression using truth table


Logical variable combined by the means of logical operators ( AND, OR, NOT ) forms a
boolean expression. To study a boolean expression,
First construct a truth table denoting all possible combination of truth values for
the variables
Then evaluate the expression for each of the possible combinations of variables
in turn.
To make a truth Table of a boolean expression, the rules are
1.
No. of combinations is equal to 2n where n is the No. of variables used in the
Boolean expression.
2.
While evaluating a Boolean expression precedence order of operators should be
followed first NOT then AND then OR.
3.
If there is any parenthesis then the expression in the parenthesis is evaluated first.
Verify using truth table ( X + Y )' = X' Y'
No. of variable = 2, Combinations = 22 = 4
X
Y
X+Y
(X + Y)'
X'
0
0
0
1
1
0
1
1
0
1
1
0
1
0
0
1
1
1
0
0

Q1.

Q2.

Prepare table for F=XYZ + XYZ


No of variable = 3,Combination = 23 = 8
X
Y
Z
X
Y
0
0
0
1
1
0
0
1
1
1
0
1
0
1
0
0
1
1
1
0
1
0
0
0
1
1
0
1
0
1
1
1
0
0
0
1
1
1
0
0
Draw the truth table for the following:
(i)
X . (Y + Z) + X . Y'
(ii)
X . (Y + Z') + X . (W' + Y') .Z'
(iii)
a . (b' + c) + c'
(iv)
a . b . c + a . b' c' + a' b' c'
(v)
a . b . (a' . b' . c' + b . c)
Verify the following equations.
(i)
x.y + y.z + y.z = x.y+z

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

Basic Logical Gates


The concept of Boolean algebra is implemented in the digital computer to implement the
evaluation of mathematical and logical expression. In the computers, these boolean
Class XII Computer Science
3

[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)

Class XII Computer Science


4

[Type text]

Cambridge School

(A.B.C).(A+D)

Postulates of Boolean Algebra


Boolean algebra consists of some fundamental law and postulates that are used to simplify
complex Boolean expression. The basic postulates are given below.
If X != 0 then X = 1
and if X != 1 then X = 0
Complement Rule
0 = 1
1 = 0
Properties of 0 and 1
0.X=0
1.X=X
0+X=X
1+X=1
Proof:
X
X+0
0
0
1
1
Closure Property

(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

Truth Table of X.Y


X
Y
X .Y
0
0
0
0
1
0
1
0
0
1
1
1
Here the result of two operations X+Y and X.Y is 0 or 1. So the closure property holds
good in Boolean Algebra
(i)

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

Inverse law / Complementary law


X + X = 1
X . X = 0
Proof
X
X
X+X
0
1
1
1
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

(viii) Absorption law


- X + XY = X
Proof using truth table.
Class XII Computer Science
6

[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

(Using distributive law)

XY + YZ +YZ =XY+Z
LHS
=XY + Z(Y+Y)
=XY+Z
Hence Proved.

(Using Complementary law)

De Morgan's Theorem
To prove DeMOrgans theorem we will use Complementary law
-

De Morgan's first Theorem


(X+Y)' = X'Y'
Algebrical Proof
(X+Y)' = X'Y'
LHS
The complementary law states that Z+Z = 1 & Z.Z=0
So, if we prove :,
(X+Y) + (X+Y')' = 1 and (X+Y) . (X+Y)' = 0 Using the De Morgans theorem, the
theorem will be proved
(i) (X+Y) + (X+Y) = 1 & (ii)
(X+Y) . (X+ Y)=0
Class XII Computer Science
7

[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

Proof using Truth Table


X
0
0
1
1

Y
0
1
0
1

(X+Y)' X'
1
1
1
0
0
0
0
0

Second De Morgan's Theorem


(XY)' = X'+ Y'
As we know Z+Z'=1 & Z.Z'=0
Assume XY = Z
then (XY) + (XY)' =1
Replacing (XY)' by X'+Y'
XY + (X' + Y') =1
LHS =
X'+Y'+X . X'+Y'+Y
=1 + Y' . 1+X'
=1.1
=1
Proof using Truth Table

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

Simplification of Boolean Expression using Boolean Algebra.


Prove
1. A+(A'.B) = A+B
=(A+A'). A+B
=1.A+B=A+B
2.

(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

SIMPLIFY THE FOLLOWING


(I)
A'B+ A'B'+ AB
=A'(B+B')+AB
=A'+AB
=(A'+A).(A'+B)
=1.(A'+B)
= A'+B
(II)

(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

[X (YZ) (XY)Z (XYZ)+ XYZ + X (YZ))]


= [(X(Y+Z)) ((X+Y)Z) (X+Y+Z) + XYZ+ X(Y+Z)]
= [(XY+XZ) (XZ+YZ) (X+Y+Z) + XYZ + XY+XZ]
= [(XYX'Z+XXZZ+XYYZ+XZZY) (X+Y+Z)+XYZ+XY+XZ]
= [(XYZ)(X+Y+Z)+XYZ+XY+XZ]
As XX=0
= [XXYZ+XYYZ+XYZZ+XYZ+XY+XZ]
= [XYZ +XYZ+XY+XZ]
= [XYZ+XY+XYZ+XZ]
= [(XY(1+Z)+XZ(1+Y)]
= [XY+XZ]
= [(XY).(XZ)]
= (X+(Y))(X+(Z)
= (X+Y)(X+Z)
= X+YZ

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

Replace all AND's by OR's and OR's by AND's


Leave NOT's unchanged.

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

Apply de Morgan's law

Note : Complement of a Boolean expression can also be obtained by


Replacing variables in direct form by their complement and complemented
variables by their direct form.
Interchange the symbols + and .
Example
f(x,y,z) = (x+y+z) (x+z)
f'(x y z) ' = (x'y'z') + x'z'
Exercise
1.
Find the complement of the following boolean expression
(i)
f(a,b,c) = ab'+bc'+a'c
(ii)
f(a,b,c) = (abc'+b')(a+b'.c)
(iii) f(a,b) = a'b'+ab
(iv)
f(a,b,c) = a+b+c'
(v)
f(a,b,c,d) = (b.c'+a'd)(ab'+cd')
(vi)
f(a,b,c,d) = bc+ac'+ab+bcd
(vii) f(a,b,c,d) = ((cd)'+a)'+a+cd+ab
(viii) f(a,b,c,d) = (a+c+d)(a+c+d')(a+c'+d)(a+b')
Representation of boolean expression
Any Boolean expression can be in the form of
SOP - Sum of product
POS - Product of sum
In an SOP Boolean expression the product terms of the expression are connected by OR
operaor (+).
Class XII Computer Science
11

[Type text]

Cambridge School

The follwing expression is a SOP equation.


Example:
xy+xy'z'+xz'
In an POS Boolean expression the sum terms of the expression are connected by AND
operaor (.).
For example the equation
(x+y).(x+y'+z').(x+z') is a POS equation
Canonical Forms
Any Boolean expression is said to be canonical if and only if :
Each term consists of exactly n - variables or literal where n is the total no of literals
present in the expression.
A literal in direct or complemented form appears only once in each term.
Canonical Boolean expression can be in both SOP and POS form.
The expression xy'+x'y'+x'y is a Canonical SOP expression whereas the expression x+yz is
not canonical.
Similarly the expression (x+y)(x+y')(x'+y') is a canonical POS expression. But the Boolean
expression (x+z)(x+y) is not canonical.
Every term of a canonical SOP term is called a Minterm. Each Minterm is product of all
the literals of the expression in its direct or complement form.
A canonical POS term is called Maxterm. Each Maxterm is sum of all the literals of the
expression in its direct or complemented form
Conversion to Canonical SOP
To convert a SOP expression to Canonical SOP,
In each term if any literal is missing, multiply that term with (missing term +
complement of(missing term))
Expand the expression
Remove all duplicate terms
Example Represent the following expression in canonical SOP
A+B
=
A(B+B')+B(A+A')
since A+A' = 1
=
AB+AB'+BA+A'B
A.1 =A
=
AB+AB'+A'B
(ii) XY+YZ+XZ
= XY(Z+Z')+(X+X')YZ+A(Y+Y')Z
= XYZ+XYZ'+XYZ+X'YZ+XYZ+XY'Z
= XYZ+XYZ'+X'YZ+XY'Z
(iii) (X'+Y)'+X'Y
= (X')'.Y'+X'Y
= XY'+X'Y
(IV) XY+YZ+Z'
= XY(Z+Z')+(X+X')YZ+(X+X')(Y+Y')Z'
= XYZ+XYZ'+XYZ+X'YZ+XYZ'+XY'Z'+X'YZ'+X'Y'Z'
= XYZ+XYZ'+X'YZ+XY'Z+X'YZ'+X'Y'Z'
Canonical SOP using truth table
Another way to get canonical SOP from an expression is using truth tables.
To get the canonical SOP expression from its truth table
Represent the expression in the truth table.
Form the SOP expression by considering the rows whose final result is 1
Class XII Computer Science
12

[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')

Canonical POS using truth table


To get the canonocal POS expression from its truth table
Represent the expression in the truth table.
Form the POS expression by considering the rows whose final result is 0
For that row consider the truth value of each literal and represent each as direct
variable if it is equal to 0 and complemented when its value is 1
eg (x+y)(x+z)
X
Y
Z
X+Y X+Z
(X+Y)(X+Z) MAX TERM
0
0
0
0
0
0
X+Y+Z
0
0
1
0
1
0
X+Y+Z'
0
1
0
1
0
0
X+Y'+Z
0
1
1
1
1
1
1
0
0
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
(X+Y+Z)(X+Y+Z')(X+Y'+Z)
2

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

Class XII Computer Science


14

[Type text]

Cambridge School

1
1

1
1

0
1

1
0

1
1

1
1

0
1

0
1

Shorthand Maxterm Notation


Every Maxterm of a Boolean expression can be represented as a number using short hand
notation. To get the shorthand notation
Substitute 1s for complemented literal and 0s for direct literal
Express it to its decimal equivalent
For example the canonical SOP equation (A'+B)(A+B')(A+B) can be represented as
A'+B - 10 = 2
A+B' - 01 = 1
AB - 00 = 0
Now the canonical POS equation can now be written as (0,,1,2)
Note: The shorthand notation of 2 variable can have the values in the range of 0-3, 3
variable can be in the range of 0-7 and the 4 variables can be in the range of 0-15
Simplification of Boolean Expression using Karnaugh Map
Karnaugh Map developed by Maurice Karnaugh is a very popular technique used for
simplification of canonical Boolean expression.. It is drawn in form of a rectangle which
is made up of squares. The number of square (cell) in the table corresponds to the number
of variables used in the expression i.e 2n where n corresponds to number of variables.
Which means for a 2 variable case the number of squares will be equal to 4, for a 3
variable case the number of squares will be equal to 8 and for a 4 variable case the number
of squares will be equal to 16.
Each cell of a K-map represents a Minterm (or Maxterm) for a canonical SOP (or POS)
expression. In every cell the shorthand notation denoting a minterm or maxterm is written.
For example in a 4 variable SOP expression the cell representing WXYZ will have the
number 8 (equivalent of 1000). Similarly the cell denoting W+X+Y+Z of a k map
representing a 4 variable POS expression will have the number 0 and W+X+Y+Z will
have the number 8.
NOTE: To simplify the expression using K-map, the boolean expression should be in
canonical SOP or POS expression.
Simplification of canonical equation using K-map
Simplification of canonical equation using K-map involves 2 steps
Plotting of expression in the K-map
Plotting refers to representing the expression in the map. it is done by writing 1 in the
corresponding cell of each minterm of a SOP expression . For a POS expression 0 is
written for each cell representing each maxterm appearing in the canonical POS
expression.
Simplifing Plotted k-maps using grouping
Consecutive cells on the k-map either vertically or horizontally can be grouped to
form logical neighbors. Logical neighbor can not be formed considering cells
diagonally. Each logical neighbor can have 2n cells i.e. either one or a pair (2) or
quads(4 ) or octet (8 ones)
In the plotted k-map, try to make the groups of maximum numbers as logical
neighbors. Grouping is done by using a method called Map Rolling
Class XII Computer Science
15

[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

Class XII Computer Science


17

[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.

In the above given K-map, the simplified solution is


From quad1 (1,3,5,7)
AD
Pair1 (0,8) BCD
Pair2 ( 10,11) ABC
So the simplified solution is :
AD+BCD+ABC
Simplification of POS equation using K-map
When the expression is given in POS form, we fill the Karnaugh Map with 0s and then try
to group the values 0 which are in adjacent cells. As mentioned before in POS expression
the barred literal (complemented) is represented as 1 and the direct literal is represented as
0. So the rules for simplification of Canonical expression in K-map are
Draw the map for give function with 2 n cells where n is no. of variables.
Map the equation by plotting 0 in the corresponding cells for each max term present
in the equation
Group the 0s in the form of pair, quad, octet and single
Remove the redundant group if any and write the reduced expression
F(A,B,C,D)= (0,1,3,5,7,8,10,11)
The Karnaugh Map for the given expression will be drawn and plotted as follows:-

Class XII Computer Science


18

[Type text]

Cambridge School

After grouping we get from


Pair1 (0,8)
B+C+D
Quad1 (1,5,3,7)
A+D
Pair2(10,11)
A+B+C
So the simplified expression is : (B+C+D) (A+D)( A+B+C)
Converting canonical SOP to POS (canonical POS to SOP)
To convert a canonical SOP to equivalent POS, the steps are
Take the equivalent shorthand notation of each minterm (maxterm)
Form the equivalent SOP ( or POS) by considering the missing terms
Example:
Convert the canonical SOP expression to its equivalent POS expression
XYZ+XYZ+XYZ
Solution:
For the above expression, considering the shorthand notation
F(X,Y,Z) = (0,2,5)
Now considering all the missing terms, the equivalent POS will be
F(X,Y,Z)
= (1,3,4,6,7)
= (X+Y+Z) (X+Y+Z) (X+Y+Z)(X+Y+Z)(X+Y+Z)
More Logic gates

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

Class XII Computer Science


19

[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

Class XII Computer Science


20

[Type text]

Cambridge School

Implementation of Basic Gates using Universal gates


As the NAND, NOR can be easily implemented as AND , OR , NAND and NOR are also known as
Universal gate

Implementation of NAND gate


NAND as NOT gate
If f =A
NOT f =A
A

NAND as AND gate


F = ((A.B))
A
B

(AB)
y =(( AB))

NAND as OR gate
f=((X+Y))=(X.Y)

(Using De morgan law)


A

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

NOR as AND gate


If f=A.B=((A.B))=(A+B)
A

A.B

B
Class XII Computer Science
21

[Type text]

Cambridge School

Representation of Boolean expression in the form of NAND gate


To represent any expression in the form of NAND gate
Derive equivalent simplified SOP expression
Double complement the expression
Apply De Morgans law
Representation of Boolean expression in the form of NOR gate
To represent any expression in the form of NOR gate
Derive equivalent simplified POS expression
Double complement the expression
Apply De Morgans law
Example : Draw the circuit diagram for the given expression using NAND gate only
P = AB+BC+CD
Ans:

Complementing the expression twice , we get


((AB).(BC).(CD))

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

Class XII Computer Science


22

[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)

Reduce the following Boolean expression using K Map


F (A, B, C, D) = (0,2,3,4,6,7,8,10,12)

Ans:
AB
CD

AB
1

AB

AB
1

12

CD
1

CD
CD

1
1

13

15

11

14

10

Class XII Computer Science


23

[Type text]

Cambridge School

F= C.D + A.C + B.D


Q 2 a. Write the equivalent Canonical Sum of Product expression for the following
Product of Sum Expression
F(X,Y,Z) = (1,3,6,7)
Ans:
F(X,Y,Z) = (0,2,4,5)
= X.Y.Z + X.Y.Z + X.Y.Z + X.Y.Z
(b). Write the equivalent Boolean Expression for the following Logic Circuit.
W
X
F
Y
Z
Ans:
W.X

W.X +Y.Z

F
Y
Z

Y.Z
F = W.X + Y.Z

(c)

Reduce the following Boolean expression using K Map


F (U,V,W,Z) = (0,1,2,3,4,10,11)

Ans:
UV UV
WZ

WZ

WZ

WZ

UV

UV

12

13

15

14

1
1

11
10

F= U.V + W.V + U.W.Z


Q 3 a Write the POS form of a Boolean function G, which is represented in a truth table as
follows:
U
V
W
G
0
0
0
1
0
0
1
1
Class XII Computer Science
24

[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

Give the complement of the following expression: (B+D)(A+C)


((B+D)(A+C))
=(B+D)+(A+C)
=BD+AC
=BD+AC

Q 4 a Verify X.Y+YZ=X.Y.Z+X.YZ+X.Y.Z algebraically


Ans LHS
=X.Y+YZ
=X.Y(Z+Z)+(X+X)Y.Z
=XY Z+XYZ+XYZ+XYZ
= XYZ+XYZ+XYZ
= RHS
b
Prove algebraically X.Y+X.Z+Y.Z=X.Y+X.Z
Ans LHS =XY+XZ+YZ
=XY+XZ+1.YZ
=XY+XZ+(X+X)YZ
=XY+XZ+XYZ+XYZ
=XY+XYZ+XZ+XYZ
=XY(1+Z)+XZ(1+Y)
=XY+XZ
=RHS

Class XII Computer Science


25

Vous aimerez peut-être aussi