03 Boolean Algebra and Logic Circuits
03 Boolean Algebra and Logic Circuits
ALGEBRA AND
LOGIC CIRCUITS
1. AND operation
2. OR operation
3. NOT operation
Z=X·Y
Z = XY
Z = 0 if X = 0 or if Y = 0, or if both X = 0 and Y = 0.
Z = 1 if X = 1 OR if Y = 1, or if both X = 1 and Y = 1.
ഥ
ZZ ==XX
Z ==X'X′
OR NOT
inputs output input output
X Y X+Y X ഥ
X
0 0 0 0 1
0 1 1 1 0
1 0 1
1 1 1
ZZ = ഥC
= AA ++BC
B
Z=A+B ഥC
= 0 + 0ത 0
= 0 + 10
=0+0
=0
• As another example, if A = 0, B = 0, and C = 1, then:
Z=A+B ഥC
ത
= 0 + 01
= 0 + 11
=0+1
=1
Inputs Output
A B C ഥ
B ഥC
B ZZ = ഥC
= A ++BC
B
• To make the evaluation 0 0 0 1 0 0
of the Boolean function 0 0 1 1 1 1
easier, the truth table 0 1 0 0 0 0
may contain extra 0 1 1 0 0 0
columns to hold
1 0 0 1 0 1
evaluations of subparts
of the expression. 1 0 1 1 1 1
1 1 0 0 0 1
1 1 1 0 0 1
Z = (A+B)AC
Inputs Output
A B C A+B AC AC Z = (A+B)AC
0 0 0 0 0 1 0
0 0 1 0 0 1 0
0 1 0 1 0 1 1
0 1 1 1 0 1 1
1 0 0 1 0 1 1
1 0 1 1 1 0 0
1 1 0 1 0 1 1
1 1 1 1 1 0 0
Inputs Output
A B C BC A + BC
0 0 0 0 0
0 0 1 0 0
0 1 0 0 0
0 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Inputs Output
A B C A+B A+C (A+B)(A+C)
0 0 0 0 0 0
0 0 1 0 1 0 Since F1 and F2 have
identical truth tables
0 1 0 1 0 0 (the output is the
0 1 1 1 1 1 same for each
1
combination of input
1 0 0 1 1 values), then F1 = F2.
1 0 1 1 1 1
1 1 0 1 1 1
1 1 1 1 1 1
If the lid of the washing machine is open or the water is below the minimum level
or the washing machine has been overloaded the appropriate sensor generates a
certain voltage (which represents an output of 1).
If any problem is indicated by any of the sensors, a circuit sends a signal (a logic 0)
to the washing machine to prevent it from turning on.
Let:
Variable A represent the output of the sensor for the washing machine lid.
(0 = lid is close, 1 = lid is open)
Variable B represent the output of the sensor for the water level.
(0 = water is above minimum, 1 = water is below minimum)
Variable C represent weight of the clothes.
(0 = weight is below maximum, 1 = weight is over the maximum)
Z = (A + B + C)
If Z = 0, the washing machine will not turn on while if Z = 1, the machine will be
allowed to operate.
Inputs Output
A B C A+B+C (A+B+C)
0 0 0 0 1
Truth table for the washing 0 0 1 1 0
machine function: 0 1 0 1 0
0 1 1 1 0
Z = (A + B + C) 1 0 0 1 0
1 0 1 1 0
1 1 0 1 0
1 1 1 1 0
Electronic Circuit
for AND Gate
X X
Z = XY Z=X+Y
Y Y
AND Gate OR Gate
X Z=X
NOT Gate
• Example:
• Example: Diagram of the logic circuit for the washing machine example.
Z = (A + B + C)
Sensor for
Washing Machine
Lid
A To Washing
Sensor for
Water Level
B Z Machine Control
C Circuitry
Sensor for
Weight of Clothes
Z = A + BC
A
Z
• Example:
A
Z
B T1
Expressions:
T2
C
T1 = B
T2 = CT1
Z = A + T2
• Example:
T1 T4
A T5
Z
B T2
Expressions:
T3
T1 = A
C
T2 = B
T3 = CT2
T4 = T 1 + T 3
T5 = T 4
Z = T3 + T5
A
B
Z
C
• NAND Gate
NAND
inputs output
X
Z X Y Z
Y
0 0 1
0 1 1
Z = XY 1 0 1
1 1 0
• NOR Gate
NOR
inputs output
X
Z X Y Z
Y
0 0 1
0 1 0
Z=X+Y 1 0 0
1 1 0
• XOR Gate
XOR
inputs output
X
Z X Y Z
Y
0 0 0
0 1 1
Z=XY 1 0 1
1 1 10
• Example:
T1
A T2
Expressions:
Z
B T4 T1 = A
T2 = B + T1
T3 = BC
C T3 T 4 = T 2 T3
Z = T1 + T4
A
B
A B C
A B C D
1. Z = A(CD + B) + BC
2. Z = A(B D) + C
3. Z = ABC + ABC + AB
4. Z = AB + AB + BC
• Boolean Identities
Identity Name AND Form OR Form
Identity Law 1X = X 0+X=X
Null Law 0X = 0 1+X=1
Idempotent Law XX = X X+X=X
Inverse Law XX = 0 X+X=1
Commutative Law XY = YX X+Y=Y+X
Associative Law (XY)Z = X(YZ) (X+Y)+Z = X+(Y+Z)
Distributive Law X+YZ = (X+Y)(X+Z) X(Y+Z) = XY+XZ
Absorption Law X(X + Y) = X X + XY = X
De Morgan’s Law XY = X + Y X+Y=XY
Double Complement Law X=X
• Duality Principle
Example:
Example:
1X = X is the dual of 0 + X = X
Z = ABC + ABC + AC
Solution:
Z = AB(C
(C + C) + AC (distributive)
= AB·1
·1 ++ AC
AC (inverse)
(inverse)
= AB + AC (identity)
(identity)
Z = (A + B)(A + B)
Solution:
Z = AA + AB + BA + BB (distributive)
= A + AB + AB + BB BB (idempotent
(idempotentand andcommutative)
commutative)
= A(1
(1 + B) + AB + BB (distributive)
= A·1
·1 + AB + 0 (null and(nullinverse)
and inverse)
= A + AB (identity) (identity)
= A (1 ++ B)
A(1 B) (distributive)
(distributive)
= A·1
·1 (null) (null)
= A (identity) (identity)
Z = (A + B)(A(B + A))
Solution:
Z= (A + B)(AB
(AB + AA) (distributive)
= (A + B)(AB
(AB + 0) (inverse)
= (A + B)(AB) (identity)
(identity)
= AAB + ABB (distributive)
= AB + AB (idempotent)
= AB (idempotent)
Z = AB + AC + BC
Solution:
Z = AB + AC + BC·1·1 (identity)
(identity)
= AB + AC + BC (A + A) (inverse)
(inverse)
= AB + AC + BCA + BCA (distributive)
(distributive)
= AB + AC + ABC + ABC (commutative)
(commutative)
= AB + ABC + AC + ABC (commutative)
(commutative)
= AB (1 + C) + AC (1
(1 ++ B)
B) (distributive)
(distributive)
= AB·1
·1 + AC·1
AC·1 (null)
(null)
= AB + AC (identity)
(identity)
1. Z = (A + C)(AD + AD) + AC + C
2. Z = ABC + AB + ABC
3. Z = ABC + AC
4. Z = (A + B + C)(A + C)
• Adjacent Terms
– Adjacency Examples:
Solution:
Z = ABC + ABC
Solution:
Z = ABC + ABC
= (ABC)(ABC)
(ABC)(ABC)
= (A + B + C)(A + B + C)
= (A + B + C)(A + B + C)
Z = A(BC + BC)
Solution:
Z = A(BC + BC)
= A + (BC + BC)
= A + (BC)(BC)
= A + (B + C)(B + C)
= A + (B + C)(B + C)
2. Z = (A + C) (A + C)(A + B + CD)
Z
Z
The second expression resulted in a simpler circuit. However, a careful analysis of the two
expressions will show that both expressions are logically equivalent (they have the same truth
tables).
And yet the second expression is seen to be a more desirable way of writing the expression in
terms of implementing logic circuits.
This led to the development of canonical and standard forms of writing expressions that
dictate how a Boolean function is expressed algebraically.
• The canonical and standard forms contain product terms and sum
terms.
• If there are only two variables (A and B), the following are
the possible minterms:
• If there are only three variables (A, B, and C), the following
are the possible minterms:
For example:
minterm AB = 1 if A = 1 and B = 1.
minterm AB = 1 if A = 1 and B = 0.
• An algebraic expression for the function can be derived from the table by finding
a logical sum of minterms for which the function assumes the binary value 1.
Example:
Inputs Output
A B C Z The expression can now be written in the
sum of minterms (SOM) form:
0 0 0 0
0 0 1 1 m1 ABC Z = m1 + m4 + m5 + m6 + m7
0 1 0 0
Z = ABC + ABC + ABC + ABC + ABC
0 1 1 0
In compact form:
1 0 0 1 m4 ABC
1 0 1 1 m5 ABC Z = m(1, 4, 5, 6, 7)
1 1 0 1 m6 ABC
1 1 1 1 m7 ABC
A B C
Boolean Algebra
Boolean Algebra and Logic Circuits
STANDARD SUM OF PRODUCTS (SOP) FORM
ABC + AB + ABCD
ABC + A
(A + B)(A + B + C) + AB
Z = BC + A
A B C
• Derive the simplified logic expression and draw the logic circuit
for the following truth tables using the SOP Method.
INPUTS OUTPUT
A B C D Z
0 0 0 0 0
0 0 0 1 0
INPUTS OUTPUT 0 0 1 0 1
A B C Z 0 0 1 1 1
0 0 0 0 0 1 0 0 1
0 0 1 1 0 1 0 1 0
0 1 0 0 0 1 1 0 1
0 1 1 1 0 1 1 1 1
1 0 0 1 1 0 0 0 1
1 0 1 0 1 0 0 1 1
1 1 0 1 1 0 1 0 1
1 1 1 1 1 0 1 1 1
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
A + B, A + B, A + B, and A + B
Boolean Algebra and Logic Circuits
MAXTERMS
For example:
• An algebraic expression for the function can be derived from the table by finding a logical
product of maxterms for which the function assumes the binary value 0.
Example:
Inputs Output
A B C Z
0 0 0 0 M0 A+B+C The expression can now be written in the
product of maxterms (POM)
0 0 1 1
Z = M0 M2 M3
0 1 0 0 M2 A+B+C
0 1 1 0 M3 A+B+C Z = (A+B+C)(A+B+C)(A+B+C)
1 0 0 1 Compact form:
1 0 1 1
Z = M(0, 2, 3)
1 1 0 1
1 1 1 1
A B C
Z = (A+B+C)(A+B+C)(A+B+C)
Z
• Derive the logic expression and draw the logic circuit for the
following truth tables using the product-of-sums method.
INPUTS OUTPUT
A B C D Z
0 0 0 0 0
0 0 0 1 0
INPUTS OUTPUT 0 0 1 0 1
A B C Z 0 0 1 1 1
0 0 0 0 0 1 0 0 1
0 0 1 1 0 1 0 1 0
0 1 0 0 0 1 1 0 1
0 1 1 1 0 1 1 1 1
1 0 0 1 1 0 0 0 1
1 0 1 0 1 0 0 1 1
1 1 0 1 1 0 1 0 1
1 1 1 1 1 0 1 1 1
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
• Summary:
1. Canonical Forms
– Sum of Minterms (SOM) – each product term will
have all variables present.
– Product of Maxterms (POM) – each sum term will
have all variables present
2. Standard Forms
– Standard Sum of Products (SOP) – some variables
are not present in some or all of the product terms.
– Standard Product of Sums (POS) – some variables
are not present in some or all of the sum terms.
Z = ABC + ABC + AB
= ABC + ABC + AB (C + C)
= ABC + ABC + ABC + ABC
Boolean Algebra and Logic Circuits
STANDARD TO CANONICAL FORM (POS)
Z = (A+B+C)(A+B)
= (A+B+C)(A+B+CC)
= (A+B+C)(A+B+C)(A+B+C)
Boolean Algebra and Logic Circuits