0% found this document useful (0 votes)
2 views

Boolean Logic

Boolean Logic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Boolean Logic

Boolean Logic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

BOOLEAN LOGIC

DEVELOPMENT OF BOOLEAN LOGIC


• George Boole wrote a revolutionary paper “An investigation of the laws of the thought”, published in 1854,
which led to the development of a new system – algebra of logic, BOOLEAN ALGEBRA or BOOLEAN
LOGIC
• Logic problems are binary decisions and Boolean logic effectively deals with these binary values, it is also
called SWITCHING ALGEBRA

BINARY VALUED QUANTITIES


• Binary Decision – A decision which results in either a Yes (TRUE) or No (FALSE) response
• Binary decision can also be applied to formal logic
• Statements or sentences which can be determined to be either True or False are called truth functions or
logical statements and the results – TRUE and FALSE are called truth values, represented by logical
constants TRUE and FALSE or 1 and 0

Logical Function / Compound Statement


• Algebraic variables combined with mathematical operations form algebraic expressions. e.g.
2a + 3b – 6c = 10z / 2y
• Similarly, logic statements or truth functions combine with Logical Operators (AND, OR, NOT) to form a
Logical Function or Compound Statement.
Logical variables and logical constants combined with logical operators form logical expressions.

Truth Table
• A table representing all possible values of logical variables / statements along with all possible results of the
given combination of values. e.g. consider the logical statements
• Statement 1 = I want to have tea (X)
Statement 2 = Tea is readily available (Y)
Result = I’ll have tea (R)

• Tautology – If the result of any logical statement or expression is always TRUE or 1, for all input
combinations
• Fallacy - If the result of any logical statement or expression is always FALSE or 0, for all input
combinations
LOGICAL OPERATORS

• NOT Operator
◦ Operates on a single variable (singular or unary operation)
◦ Operation performed by the NOT operator is called complementation
◦ Symbol used is ( ¯ ) or ~ (read as negation of ..) or ’ (read as complement of ..)

• OR Operator
◦ Denotes an operation called logical addition
◦ Symbol used is (+) and does not have the normal meaning.
◦ It is read as X OR Y

• AND Operator
◦ Performs a logical multiplication operation
◦ Symbol used is (.) and is read as X AND Y.
Evaluation of Boolean Expressions using Truth Tables
• Logical variables are combined by means of logical operators (AND, OR, NOT) to form a boolean
expression. e.g. X + (Y . Z )' + Z '
• A truth table of n input variables will have 2n combinations (2n rows)
• When evaluating a boolean expression, an order of precedence should always be followed – NOT, AND,
OR.
• If there are parentheses, expression in parenthesis is evaluated first.

BASIC LOGIC GATES


• A logic gate is a basic electronic circuit which operates on one or more signals to produce an output signal
• Gates are digital (two-state) circuits because 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 boolean logic
• There are three types of logic gates :
◦ NOT gate
◦ OR gate
◦ AND gate

• NOT Gate (Inverter)


◦ A gate with only one input signal and one output signal
◦ The output state is always the opposite of the input state.
◦ The output is sometimes called the complement (opposite) of the input.
◦ A low input (i.e. 0) produces a high output (i.e. 1) and vice-versa

• OR Gate
◦ A gate which has two or more input signals but only one output signal.
◦ If all inputs are 0, then output is 0. If any of the input signals is high (1), then the output signal is high
(1)
◦ One or more high inputs (1), produce a high output (1)
• AND Gate
◦ This gate can have two or more input signals and produce an output signal.
◦ Only when all inputs are high (1), the output produced is 1, otherwise the output is 0.

BASIC POSTULATES OF BOOLEAN LOGIC


• Some fundamental laws are used to build a workable, cohesive framework based on the theorems of boolean
algebra
• I. If X ≠ 0 then X = 1 ; and If X ≠ 1 then X = 0
• II. OR Relations (Logical Addition)
0+0=0
0+1=1
1+0=1
1+1=1
• III. AND Relations (Logical Multiplication)
0.0=0
0.1=0
1.0=0
1.1=1
• IV. Complement Rules
0’ = 1
1’ = 0

PRINCIPLE OF DUALITY
• Starting with a boolean relation, another boolean relation can be derived by :
◦ Changing each OR sign (+) to an AND sign (.)
◦ Changing each AND sign (.) to an OR sign (+)
◦ Replacing each 0 by 1 and each 1 by 0
• The derived relation using duality principle is called dual of original expression
• This duality principle can be applied in the theorems of boolean algebra
• IF AN EXPRESSION HOLDS TRUE, ITS DUAL IS ALSO TRUE, AND VICE-VERSA
BASIC THEOREMS OF BOOLEAN ALGEBRA

• Properties of 0 and 1
◦ 0+X=X

0 X 0+X
0 0 0
0 1 1

◦ 1 + X = 1 (Tautology)

1 X 1+X
1 0 1
1 1 1

◦ 0 . X = 0 (Fallacy)

0 X 0.X
0 0 0
0 1 0

◦ 1.X=X

1 X 1.X
1 0 0
1 1 1

• Idempotence Law
◦ X+X=X

X X X+X
0 0 0
1 1 1

◦ X.X=X

X X X.X
0 0 0
1 1 1

◦ Both statements are duals of each other


• Involution
◦ (X’)’ = X

X X’ (X’)’
0 1 0
1 0 1

• Complementarity Law
◦ X + X’ = 1

X X’ X + X’
0 1 1
1 0 1

◦ X . X’ = 0

X X X . X’
0 1 0
1 0 0

• Commutative Law
◦ X+Y=Y+X

X Y X+Y Y+X
0 0 0 0
0 1 1 1
1 0 1 1
1 1 1 1

◦ X.Y=Y.X

X Y X.Y Y.X
0 0 0 0
0 1 0 0
1 0 0 0
1 1 1 1
• Associative Law
◦ X + (Y + Z) = (X + Y) + Z

X Y Z Y + Z X + (Y + Z) X + Y (X + Y) + Z
0 0 0 0 0 0 0
0 0 1 1 1 0 1
0 1 0 1 1 1 1
0 1 1 1 1 1 1
1 0 0 0 1 1 1
1 0 1 1 1 1 1
1 1 0 1 1 1 1
1 1 1 1 1 1 1

◦ X . (Y . Z) = (X . Y) . Z

X Y Z Y.Z X . (Y . Z) X.Y (X . Y) . 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 0 1 0
1 1 1 1 1 1 1

• Absorption Law
◦ X + XY = X

X Y XY X + XY
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
◦ X . (X + Y) = X

X Y X + Y X . (X + Y)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1

• Distributive Law
◦ X . (Y + Z) = X . Y + X . Z

X Y Z Y + Z X . (Y + Z) X . Y X . Z X . Y + X . Z
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 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1

◦ X + Y . Z = (X + Y)(X + Z)

X Y Z Y . Z X + (Y . Z) X + Y X + Z (X + Y) . (X + Z)
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1

◦ X + YZ is a sum of two product-terms (X . 1) and (Y . Z). (X + Y)(X + Z) is a product of sum-terms X +


Y and X + Z. So this law is a useful one to convert a sum-of-product type expression to product-of-sum
type expression and vice-versa.
• Third Distributive Law
◦ X + X’ . Y = X + Y

X Y X’ X’ . Y X + X’ . Y X+Y
0 0 1 0 0 0
0 1 1 1 1 1
1 0 0 0 1 1
1 1 0 0 1 1

THEOREMS OF BOOLEAN ALGEBRA / BOOLEAN LOGIC

1. Properties of 0 0+X=X; 0.X=0


2. Properties of 1 1+X=X; 1.X=X
3. Idempotence Law X+X=X; XX = X
4. Involution (X’)’ = X
5. Complementarity Law X + X’ = 1 ; XX’ = 0
6. Commutative Law X+Y=Y+X; XY = YX
7. Associative Law X + (Y + Z) = (X + Y) + Z ; X (YZ) = (XY) Z
8. Distributive Law X (Y + Z) = XY + XZ ; X + YZ = (X + Y)(X + Z)
9. Absorption Law X + XY = X ; X (X + Y) = X
10. 3rd Distributive Law X + X’Y = X + Y

DEMORGAN’S THEOREMS
• DeMorgan’s First Theorem
◦ The complement of the sum of two logical inputs is equal to the product of its complements.
◦ (X + Y)’ = X’ Y’

X Y X’ Y’ X + Y (X + Y)’ X’ . Y’
0 0 1 1 0 1 1
0 1 1 0 1 0 0
1 0 0 1 1 0 0
1 1 0 0 1 0 0

Algebraic Proof :

According to Complementarity Law, P + P’ = 1 and P . P’ = 0


If P = X + Y, where P, X, Y are boolean variables,
(X + Y) + (X + Y)’ = 1 and (X + Y) . (X + Y)’ = 0
If (X + Y) + X’ Y’ can be shown to be equal to 1 and (X + Y) . X’ Y’ can be shown to be equal to 0 then
DeMorgan’s First Theorem can be proved (in which case (X + Y)’ = X’ Y’)
(X + Y) + X’ Y’ = ((X + Y) + X’) . ((X + Y) + Y’) (from Distributive law (X + YZ = (X + Y)(X + Z))
= (X + X’ + Y) . (Y + Y’ + X)
= (1 + Y) . (1 + X) (from Complementarity Law (X + X’ = 1))
=1.1 (from Properties of 0 and 1 (1 + X = 1))
=1

(X + Y) . X’ Y’ = X’Y’ . (X + Y) (from Associative law (X(YZ) = (XY)Z)


= X’Y’X + X’Y’Y (from Distributive law (X(Y+ Z) = XY + XZ)
= XX’Y’ + X’YY’
= 0 . Y’ + X’ . 0 (from Complementarity Law (X . X’ = 0))
=0+0 (from Properties of 0 and 1 (0 . X = 0))
=0
Hence, (X + Y)’ = X’Y’

• DeMorgan’s Second Theorem


◦ The complement of the product of two inputs is equal to the sum of its complements.
◦ (X . Y)’ = X’ + Y’

X Y X’ Y’ X.Y (X . Y)’ X’ + Y’
0 0 1 1 0 1 1
0 1 1 0 0 1 1
1 0 0 1 0 1 1
1 1 0 0 1 0 0

Algebraic Proof :

According to Complementarity Law, P + P’ = 1 and P . P’ = 0


If P = X . Y, where P, X, Y are boolean variables,
(X . Y) + (X . Y)’ = 1 and (X . Y) . (X . Y)’ = 0
If XY + (X’ + Y’) can be shown to be equal to 1 and XY . (X’ + Y’) can be shown to be equal to 0 then DeMorgan’s
Second Theorem can be proved (in which case (X . Y)’ = X’ + Y’)

XY + (X’ + Y’) = (X’ + Y’) + XY (from Commutative law (X + Y) = (Y + X)


= (X’ + Y’ + X) . (X’ + Y’ + Y) (from Distributive law (X + YZ = (X + Y)(X + Z))
= (X + X’ + Y’) . (X’ + Y + Y’)
= (1 + Y’) . (X’ + 1) (from Complementarity Law (X + X’ = 1))
=1.1 (from Properties of 0 and 1 (1 + X = 1))
=1
XY . (X’ + Y’) = XYX’ + XYY’ (from Distributive law (X(Y+ Z) = XY + XZ)
= XX’Y + XYY’
=0.Y+X.0 (from Complementarity Law (X . X’ = 0))
=0+0 (from Properties of 0 and 1 (0 . X = 0))
=0
Hence, (X . Y)’ = X’ + Y’

• Although the above identities represent DeMorgan’s Theorem, the transformation is more easily performed
following these steps
◦ Complement entire function
◦ Change all AND (.) to OR (+) and vice-versa
◦ Complement each of the individual variables
• This process is called demorganization

SOME ADDITIONAL GATES

• NOR Gate
◦ Has two or more input signals but only one output signal.
◦ It is basically an inverted OR gate
◦ If all inputs are 0 (low) then output signal is 1
(high) and if any of the inputs is 1 (high), the
output will be 0 (low).

• NAND Gate
◦ Has two or more input signals but only one output signal.
◦ It is an inverted AND gate
◦ If all inputs are 1 (high) then output signal is
0 (low) and if any of the inputs is 0 (low), the
output will be 1 (high).
• XOR Gate (Exclusive OR)
◦ Can also have two or more input signals but
only one output signal.
◦ XOR gate produces output 1 only for those
input combinations with odd number of 1’ s
◦ Symbol used is ⊕ and is read as A XOR B

• XNOR Gate (Exclusive NOR)


◦ Logically equivalent to an inverted XOR gate
◦ Produces 1 (high) output when the input
combination has an even number of 1’ s.
◦ Symbol used is ⊙

LOGIC CIRCUITS
• A logic circuit is a circuit that carries out a set of logic actions based on an expression
• To execute a Boolean expression, a logic circuit and input values for variables of the Boolean expression are
required
• A Boolean expression can be represented in the form of a logic circuit, using a combination of logic gates,
so that the output of the Boolean expression can be determined for various combination of input values

• Rules to create a logic circuit :


◦ Break Boolean expression into smaller sub-expressions.
e.g. for AB + BC’D, there are two sub expressions AB and BC’D
◦ For each sub-expression, determine the logic gates that can implement them.
e.g. AB requires AND gate ; BC’D requires NOT and AND gates
◦ Implement the sub-expression using the gates determined in previous steps
◦ Determine the Logic gate for the symbol joining the sub-expressions.
e.g. (+) joins (AB and BC’D)
◦ Using the logic gate for the joining symbol (from step 4), connect sub-expressions’ gate implementation
(from step 3)

You might also like