Professional Documents
Culture Documents
BINARY DECISION
Any decision which results into a YES (TRUE) or NO (FALSE) is called
a binary decision.
YES
NO
TRUE
FALSE
For example:
13 2 = 11.
LOGICAL OPERATIONS
Logical function or Compound statement
Algebraic variables like a, b, c, x, y etc. are combined
with help of mathematical operators like +,-,x,/.
Similarly, logical statements or truth functions are
combined with help of logical operators to form a logical
function. For example
He prefers tea not coffee.
He plays piano and she plays sitar.
On Sundays, I watch TV or go for swimming.
The AND, OR, NOT are the logical operators.
Logical operators
TRUTH TABLE
A truth table is a table which represents all the possible values
of logical variables along with all possible results of given
combinations of values.
For example,
I want to have tea
T represents TRUE
F represents FALSE
X
1
1
0
0
Y
1
0
1
0
R
1
0
0
0
TRUTH TABLE
1 represents TRUE
0 represents FALSE
OPERATORS
NOT
OR
AND
NOT Operator
It operates on one input and gives the opposite of that as output.
If the input is 0, output will be 1
If the input is 1, output will be 0
Since, it operates on one input it is called a unary operator.
This is known as complementation.
It is represented by an inverted coma ( ) or a bar over the
variable.
For example
Complement of X will be represented as X or X.
0=1
1=0
Truth table for NOT operation isX
0
1
X
1
0
OR Operator
It represents the operation called logical addition.
The symbol used for OR operator is +.
So, X+Y can be read as X OR Y.
0+0=0
0+1=1
1+0=1
1+1=1
Y
0
1
0
1
X+Y
0
1
1
1
Y
0
0
1
1
0
0
Z
0
1
0
1
0
1
X+Y+Z
0
1
1
1
1
1
1
1
1
1
AND Operator
0
1
1
1
Y
0
1
0
1
X.Y
0
0
0
1
For three input operators, first apply AND operation on two operands
and then apply operation on the result and third operand. Truth table
for 3 inputs isX
0
0
0
0
1
1
Y
0
0
1
1
0
0
Z
0
1
0
1
0
1
X.Y.Z
0
0
0
0
0
0
1
1
1
1
0
1
0
1
BOOLEAN EXPRESSIONS
Logical variables are combined by means of logical operators to
form Boolean expression.
For exampleo X+Y
o X + YZ + Z
o Y + Z
Boolean expressions are evaluated by constructing the truth
table.
Consider the expression- X + (Y.Z)
To study this expression, first consider all the combinations of X,
Y and Z. total number of combinations for 3 variables is 23 = 8.
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
Calculate Y.Z
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
Y.Z
0
0
0
1
0
0
0
1
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
Y.Z
0
0
0
1
0
0
0
1
(Y.Z)
1
1
1
0
1
1
1
0
Y.Z
(Y.Z)
X + (Y.Z)
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
1
PRIORI
TY
AND
OR
Y
0
1
0
XY
0
0
0
X+XY
0
0
1
Y
0
1
0
1
X
1
1
0
0
Y
1
0
1
0
X+Y
0
1
1
1
(X+Y)
1
0
0
0
XY
1
0
0
0
Exercise:
Prepare truth table for expression: XY + XY and verify that it is
equal to X
Prepare truth table for expression: XYZ + XY
Principle of duality
o Change each OR (+) to AND (.)
o Change each AND (.) to OR (+)
o Replace each 0 by 1 and 1 by 0
For 0+X
0
0
0
X
0
1
0+X
0
1
X
0
0.X
0
For 1.X
0
0
Indempotence law
o X+X=X
o X.X=X
Proof
For X + X = X
X
0
1
X
0
1
X+X
0
1
X
0
1
X.X
0
1
For X . X = X
X
0
1
Involution law
(X) = X
Proof
X
0
1
X
1
0
(X)
0
1
X
1
0
X+X
1
1
Complementary law
o X + X = 1
o X . X = 0
Proof
For X + X = 1
X
0
1
For X . X = 0
X
0
1
X
1
0
X.X
0
0
Commutative law
o X+Y=Y+X
o X.Y=Y.X
Proof
For X + Y = Y + X
X
0
0
1
1
Y
0
1
0
1
X+Y
0
1
1
1
Y+X
0
1
1
1
X.Y
0
0
0
Y.X
0
0
0
For X . Y = Y . X
X
0
0
1
Y
0
1
0
Associative law
o X+(Y+Z)=(X+Y)+Z
o X.(Y.Z)=(X.Y).Z
Proof
For X + ( Y + Z ) = ( X + Y ) + Z
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
Y+Z
0
1
1
1
0
1
1
1
X+Y
0
0
1
1
1
1
1
1
X+(Y+Z) (X+Y)+Z
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
X.Y
0
0
X.(Y.Z)
0
0
o For X . ( Y . Z ) = ( X . Y ) . Z
X
0
0
Y
0
0
Z
0
1
Y.Z
0
0
(X.Y).Z
0
0
0
0
1
1
1
1
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
0
1
1
0
0
0
0
0
1
0
0
0
0
0
1
Distributive law
o X(Y + Z) = XY + XZ
o X + YZ = (X + Y)(X + Z)
Proof
For X(Y + Z) = XY + XZ
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
Y+Z
0
1
1
1
0
1
1
1
X.Y
0
0
0
0
0
0
1
1
X.Z
0
0
0
0
0
1
0
1
X.(Y+Z) X.Y+X.Z
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
For X + YZ = (X + Y)(X + Z)
Here is an algebraic proof of this rule
R.H.S. = (X + Y)(X + Z)
= XX + XZ + YX + YZ
= X + XZ + YX + YZ
(Indempotence law)
= X(1+Z) + YX + YZ
(taking X common)
= X.1 + YX + YZ
= X + YX + YZ
= (1+Y)X +YZ
(taking X common)
= 1.X + YZ
= X + YZ
= L.H.S.
Hence proved
Absorption law
o
o
X + XY = X
X (X + Y) = X
Proof
For X + XY = X
X
0
0
1
1
Y
0
1
0
1
X.Y
0
0
0
1
X+XY
0
0
1
1
X+Y
0
1
1
1
X(X+Y)
0
0
1
1
For X (X + Y) = X
X
0
0
1
1
Y
0
1
0
1