Chapter 3 Logic Circuits & Boolean Algebra Laws and Rules DeMorgan’s Theorem Universal Gates Combinational Logic Circuits
Boolean Algebra • Boolean Algebra is the mathematics of digital systems. • A variable is a symbol used to represent a logical quantity that have a value of 1 or 0. • A, B Example • The complement is the inverse of a variable and is indicated by a bar over the variable. Example
• A, B
• Three laws of Boolean Algebra are: Commutative
10/9/2012
Distributive
RA/Sept2012-Jan2013
Associative
2
Commutative Laws
Description
• This law states that the order in which the variables are ORed/ANDed makes no difference.
Example
• A+B=B+A • AB = BA
10/9/2012
RA/Sept2012-Jan2013
3
Associative Laws
Description
• This law states that when ORing/ANDing more than two variables, the result is the same regardless of the grouping of the variables.
Example
• A + (B + C) = (A + B) + C • A (BC) = (AB) C
10/9/2012
RA/Sept2012-Jan2013
4
Distributive Laws
Description
• This law states that ORing two or more variables and then ANDing the result with a single variable is equivalent to ANDing the single variable with each of the two or more variables and then ORing the products. • It also expresses the process of factoring in which the common variable A is factored out of the product terms.
Example
• A (B + C) = AB + AC • AB + AC = A(B + C)
10/9/2012
RA/Sept2012-Jan2013
5
Rules of Boolean Algebra Rule 1
• A.0 = 0 • Examples: AB.0 = 0 • (A+B)(C+D).0 = 0
Rule 2
• A.1 = A • Examples: AB.1 = AB • (A+B)(C+D).1 = (A+B)(C+D)
Rule 3
•A + 0 = A • Examples: AB + 0 = AB • A + B + 0 = A + B
Rule 4
•A + 1 = 1 • Examples: AB + 1 = 1 • A+B+C +1 = 1 • (A+B)(C+D) + 1 = 1
10/9/2012
RA/Sept2012-Jan2013
6
Rules of Boolean Algebra
Rule 5
• A.A=A • Examples: (AB).(AB) = AB • (A+B)(A+B) = A+B • A.B.A = A.B
Rule 6
• A+A=A • Examples: AB + AB = AB • A+A+B+C = A+B+C
A. A 0 • Examples: AB. AB 0 A.B. A 0.B 0 ( A B)( A B) 0 •
Rule 7
A A 1 • Examples: AB AB 1 A B A 1 B 1 • ( A B) ( A B) 1 •
Rule 8 10/9/2012
RA/Sept2012-Jan2013
7
Rules of Boolean Algebra A A • Examples: AB AB •
Rule 9
( A B) A B
(A BC) (A B)(A C)
Rule 10
• Examples: A BCD ( A B)( A CD)
( A B)( A C )( A D)
Rule 11
10/9/2012
(A AB) A • Examples: A AB A(1 B) A.1 A
RA/Sept2012-Jan2013
8
Simplifying Expressions using Boolean Algebra Example 1
Simplify Solution:
Y A ABC Y A ABC (A A)(A BC)
Rule 10
1(A BC) A BC Example 2
Simplify Solution:
10/9/2012
Y A A.B A.B.C Y A A.B A.B.C A A.B(1 C)
Rule 11
A A.B AB
Rule 10
RA/Sept2012-Jan2013
9
Simplifying Expressions using Boolean Algebra Example 3
Prove that Solution:
A.B.C A.B.C A.B.C A.B B.C A.B.C A.B.C A.B.C A.B(C C) A.B.C
Factorise A B
Distributive Law
A.B(1) A.B.C A.B A.B.C B.(A AC) B(A A)(A C)
* A BC (A B)(A C)
Rule 10
B(A C) A.B B.C
10/9/2012
RA/Sept2012-Jan2013
10
SOP = POS Example
Prove that the SOP and POS expressions for an OR gate are equivalent. SOP, Y AB AB AB POS, Y = A + B Solution:
Y A.B A.B AB A.B A(B B)
Distributive Law
A.B A (A A)(A B) AB
10/9/2012
Rule 10
RA/Sept2012-Jan2013
11
DeMorgan’s Theorem
Theorem 1
Theorem 2
10/9/2012
•The complement of two or more variables ANDed is equivalent to the OR of the complements of the individual variables. •AB = A + B • The complement of two or more variables ORed is equivalent to the AND of the complements of the individual variables. •A + B = A B
RA/Sept2012-Jan2013
12
DeMorgan’s Theorem Example 1
Example 2
Prove that AB.B AB Solution: AB.B
Prove that AB.B C BC Solution: AB.B C
(A B)B
(A B) BC
AB BB
A B C BBC
AB 0
A B C BC
AB
B C(A 1) BC
Example 3
Prove that Solution
AB.C D. AB A B C D
AB.C D. AB A.B.C D AB Break the outer most bar AB C D A B A B C D
10/9/2012
RA/Sept2012-Jan2013
13
Universality of NAND and NOR gates • NAND and NOR gates are universal gates. • It can represent basic gates which are NOT, AND and OR. • The expression Y A.A A is equivalent to a NOT gate. A
=
Y
• The expression Y AB AB is equivalent to an AND gate. A B
=
Y
• The expression is Y A.B A B A B equivalent to the OR gate. A B
10/9/2012
Y
=
RA/Sept2012-Jan2013
14
Universality of NAND and NOR gates Example 1
Draw Y AB CD using only NAND gates.
1
Double invert the expression .
Y AB CD
2
Keep the top inversion bar. Apply DeMorgan’s Theorem 2 to the bottom inversion bar to eliminate the OR operation.
Y AB CD
3
Draw the circuit using only NAND gates. A B Y C D
10/9/2012
RA/Sept2012-Jan2013
15
Universality of NAND and NOR gates Example 2
Draw Y (A B)(C D) using only NOR gates.
1
Double invert the expression .
Y (A B)(C D)
2
Keep the top inversion bar. Apply DeMorgan’s Theorem 1 to the bottom inversion bar to eliminate the AND operation.
Y (A B) (C D)
3
Draw the circuit using only NOR gates. A B Y C D
10/9/2012
RA/Sept2012-Jan2013
16
Sum-of-Product (SOP) Description
•SOP expression is the sum of all product terms when the output is a logic 1. •Product Term is formed by ANDing the complemented or uncomplemented input variables.
Example
• Given the OR gate truth table with 2 inputs. Derive the SOP expression. A
B
Y
SOP
0
0
0
0
1
1
AB
1
0
1
AB
1
1
1
AB
Product term
Therefore, Y = A B + A B + A B 10/9/2012
RA/Sept2012-Jan2013
17
Product-of-Sum (POS) Description
•POS expression is the product of all sum terms when the output is a logic 0. •Sum term is formed by ORing the complemented or uncomplemented input variables.
Example
• Given an AND gate truth table with 2 inputs. Derive the POS expression. A
B
Y
POS
0
0
0
A+B
0
1
0
A+B
1
0
0
A+B
1
1
1
Sum terms
Therefore, Y = (A+B) ( A+B) (A+B)
10/9/2012
RA/Sept2012-Jan2013
18
Combinational Logic Circuits • Combinational logic circuits are constructed by connecting together logic gates. • Four steps involve in designing combinational logic circuits are:-
1
Derive the truth table
10/9/2012
2
Identify the Boolean expression
3
RA/Sept2012-Jan2013
Simplify the Boolean expression
4
Draw the logic circuit
19
Designing Combinational Logic Circuits Example
• The diagram shown below is a water filtering system. A water quality sensing detector will generate a quality scale from 0 – 7. From this scale, selected filter will function as follows to produce clean water. Filter
Water flow
A B
Water quality sensing detector
Clean water
C
Water Condition The cleanest
Logic circuit
Scale 0 - 7
The dirtiest
Scale 0 1 2 3 4 5 6 7
Filters needed No filters are activated A A, B and C B A A and B A and C A, B and C
Design the logic circuit. Your solution should include: a) Truth table. b) Simplified expression. c) Based on the simplified expression in (b), draw the logic circuit. 10/9/2012
RA/Sept2012-Jan2013
20
Designing Combinational Logic Circuits Solution:
1
Derive the truth table
2
Identify the Boolean expression (SOP)
A B C
FA
FB
FC
FA ABC ABC ABC ABC ABC ABC
0 0 0
0
0
0
FB ABC ABC ABC ABC
0 0
1
1
0
0
FC ABC ABC ABC
0
0
1
1
1
1
0
1
1
0
1
0
1
0 0
1
0
0
1
0
1
1
1
0
1
1
0
1
0
1
1
1
1
1
1
1
Water Condition The cleanest
The dirtiest
10/9/2012
RA/Sept2012-Jan2013
Scale
Filters needed
0
No filters are activated A A, B and C B A A and B A and C A, B and C
1 2 3 4 5 6 7
21
Designing Combinational Logic Circuits Solution:
3
Simplify the Boolean expression using Boolean Algebra
FA ABC ABC ABC ABC ABC ABC
ABC ABC AB(C C) AB(C C) ABC ABC A(B B) Distributive Law A(BC BC) A Rule 10 (A A)(A (BC BC)) A BC BC
Distributive Law Rule 8
FB ABC ABC ABC ABC
AB(C C) AC(B B) AB AC
10/9/2012
Distributive Law
Rule 8
FC ABC ABC ABC BC(A A) ABC Distributive Law B(C AC) Rule 8 B(C A)(C C) Rule 10 RA/Sept2012-Jan2013 BC AB
22
Designing Combinational Logic Circuits Solution:
4
Draw the logic circuit based on the simplified Boolean expression
A
B
C
Filter A
Filter B
Filter C
10/9/2012
RA/Sept2012-Jan2013
23