EKT124-03 - UniMAP Portal

advertisement
CHAPTER 1
INTRODUCTION TO
DIGITAL LOGIC
De Morgan’s
Theorem
Theorems of Boolean Algebra (1)
1) A + 0 = A
2) A + 1 = 1
3) A • 0 = 0
4) A • 1 = A
5) A + A = A
6) A + A = 1
7) A • A = A
8) A • A = 0
Theorems of Boolean Algebra (2)
9) A = A
10) A + AB = A
11) A + AB = A + B
12) (A + B)(A + C) = A + BC
13) Commutative : A + B = B + A
AB = BA
14) Associative : A+(B+C) =(A+B) + C
A(BC) = (AB)C
15) Distributive : A(B+C) = AB +AC
(A+B)(C+D)=AC + AD + BC + BD
De Morgan’s Theorems
 Two most important theorems of Boolean
Algebra were contributed by De Morgan.
 Extremely useful in simplifying expression in
which product or sum of variables is inverted.
 The TWO theorems are :
16) (X+Y) = X . Y
17) (X.Y) = X + Y
Implications of De Morgan’s Theorem
(a)
(b)
Input
Output
X
Y
X+Y XY
0
0
1
1
0
1
0
0
1
0
0
0
1
1
0
0
(c)
(a) Equivalent circuit implied by theorem (16)
(b) Negative- AND
(c) Truth table that illustrates DeMorgan’s Theorem
Implications of De Morgan’s Theorem
(a)
(b)
Input
Output
X
Y
XY X+Y
0
0
1
1
0
1
1
1
1
0
1
1
1
1
0
0
(c)
(a) Equivalent circuit implied by theorem (17)
(b) Negative-OR
(c) Truth table that illustrates DeMorgan’s Theorem
De Morgan’s Theorem Conversion (1)
Step 1: Change all ORs to ANDs and all ANDs to Ors
Step 2: Complement each individual variable
(short overbar)
Step 3: Complement the entire function (long overbars)
Step 4: Eliminate all groups of double overbars
Example :
A.B
= A+B
= A+B
= A+B
= A+B
A .B. C
= A+B+C
= A+B+C
= A+ B+ C
De Morgan’s Theorem Conversion (2)
=
=
=
=
ABC + ABC
(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)D
= (A.B.C)+D
= (A.B.C)+D
= (A.B.C)+D
= (A.B.C)+D
Example: Analyze the circuit below
Y
1. Y=???
2. Simplify the Boolean expression found in 1
Example: Analyze the circuit below (CONT.)
 Follow the steps list below (constructing
truth table)
 List all the input variable combinations of 1 and
0 in binary sequentially
 Place the output logic for each combination of
input
 Base on the result found write out the boolean
expression.
Exercises:
Simplify the following Boolean expressions
1. (AB(C + BD) + AB)C
2. ABC + ABC + ABC + ABC + ABC
 Write the Boolean expression of the following circuit.

Standard Forms of Boolean Expressions (1)
 Sum of Products (SOP)
 Products of Sum (POS)
Notes:
 SOP and POS expression cannot have more than
one variable combined in a term with an inversion bar
 There’s no parentheses in the expression
Standard Forms of Boolean Expressions (2)
 Converting SOP to Truth Table
 Examine each of the products to determine where
the product is equal to a 1.
 Set the remaining row outputs to 0.
Standard Forms of Boolean Expressions (3)
 Converting POS to Truth Table
 Opposite process from the SOP expressions.
 Each sum term results in a 0.
 Set the remaining row outputs to 1.
Standard Forms of Boolean Expressions (4)
 The standard SOP Expression
 All variables appear in each product term.
 Each of the product term in the expression is called
as minterm.
 Example: f ( A, B, C )  ABC  ABC  ABC
 In compact form, f(A,B,C) may be written as
f ( A, B, C )  m2  m3  m6
f ( A, B, C )  m(2,3,6)
Standard Forms of Boolean Expressions (5)
 The standard POS Expression
 All variables appear in each product term.
 Each of the product term in the expression is called as
maxterm.
 Example: f ( A, B, C )  ( A  B  C )  ( A  B  C )  ( A  B  C )
 In compact form, f(A,B,C) may be written as
f ( A, B, C )  M1M 4 M 5
f ( A, B, C )  M (1,4,5)
Standard Forms of Boolean Expressions (6)
 Example:
Convert the following SOP expression to an equivalent
POS expression:
f ( A, B, C )  ABC  ABC  ABC  ABC
 Example:
Develop a truth table for the expression:
f ( A, B, C )  ( A  B  C )  ( A  B  C )  ( A  B  C )  ( A  B  C )
The Karnaugh-MAP
(K-Map)
K-Map (1)
 Karnaugh Mapping is used to minimize the
number of logic gates that are required in a
digital circuit.
 This will replace Boolean reduction when the
circuit is large.
 Write the Boolean equation in a SOP form first
and then place each term on a map.
K-Map (2)
 The map is made up of a table of every possible
SOP using the number of variables that are being
used.
 If 2 variables are used then a 2X2 map is used
 If 3 variables are used then a 4X2 map is used
 If 4 variables are used then a 4X4 map is used
 If 5 Variables are used then a 8X4 map is used
K-Map SOP Minimization
2 Variables K-Map (1)
B
A
A
B
0
1
2
3
Notice that the map is going false to
true, left to right and top to bottom
B
The upper right hand cell is A B if
X= A B then put an X in that cell
A
B
1
A
This show the expression true when A = 0 and B = 0
2 Variables K-Map (2)
B
If X=AB + AB then
put an X in both of
these cells
A
1
A
1
B
From Boolean reduction we know that A B + A B = B
B
From the Karnaugh map we
can circle adjacent cell and
find that X = B
A
A
1
1
B
3 Variables K-Map (1)
Gray Code
0
1
C
C
00
AB
0
1
01
AB
2
3
11
AB
6
7
10
AB
4
5
3 Variables K-Map (2)
X=ABC+ABC+ABC+ABC
Gray Code
00
AB
01
AB
11
AB
10
AB
0
1
C
C
1
1
1
1
Each 3 variable
term is one cell
on a 4 X 2
Karnaugh map
3 Variables K-Map (3)
X=ABC+ABC+ABC+ABC
Gray Code
00
AB
01
AB
11
AB
10
AB
0
1
C
C
1
1
One
simplification
could be
X=AB+AB
1
1
3 Variables K-Map (4)
X=ABC+ABC+ABC+ABC
Gray Code
0
C
1
1
C
1
Another
simplification
could be
00
AB
01
AB
X=BC+BC
11
AB
10
AB
A Karnaugh
Map does wrap
around
1
1
3 Variables K-Map (4)
X=ABC+ABC+ABC+ABC
Gray Code
0
1
00
AB
C
1
C
1
01
AB
The Best
simplification
would be
11
AB
X =B
10
AB
1
1
On a 3 Variables K-Map
 One cell requires 3 Variables
 Two adjacent cells require 2 variables
 Four adjacent cells require 1 variable
 Eight adjacent cells is a 1
4 Variables K-Map
Gray Code 0 0
01
CD
CD
11
10
CD CD
00
AB
0
1
3
2
01
AB
4
5
7
6
11
AB
12
13
15
14
10
AB
8
9
11
10
Simplify:
X=ABCD+ABCD+ABCD+ABCD+ABCD+ABCD
Gray Code
00
01
11
CD
CD
CD CD
00
AB
1
01
AB
1
11
AB
10
AB
1
10
1
Now try it
with Boolean
reductions
1
1
X = ABD + ABC + CD
On a 4 Variables K-Map
 One Cell requires 4 variables
 Two adjacent cells require 3 variables
 Four adjacent cells require 2 variables
 Eight adjacent cells require 1 variable
 Sixteen adjacent cells give a 1 or true
Simplify :
Z=BCD+BCD+CD+BCD+ABC
Gray Code
00
AB
01
AB
11
AB
10
AB
00
01
11
10
CD
CD
CD CD
1
1
1
1
1
1
1
1
1
1
1
1
Z= C +AB + BD
Simplify using K-Map (1)
Firstly, change the circuit to an SOP expression
Simplify using K-Map (2)
Y= A + B + B C + ( A + B ) ( C + D)
Y = AB + B C + AB (C +D)
Y=AB +B C +AB C +A B D
Y=AB+B C+AB CABD
Y = A B + B C + (A + B + C ) ( A + B + D)
Y = A B + B C + A + A B + A D + B + B D + AC + C D
SOP expression
Simplify using K-Map (3)
Gray Code
00
01
11
10
CD
CD
CD CD
1
1
1
1
00
AB
1
01
AB
1
1
1
11
AB
1
1
1
1
10
AB
1
1
1
1
Y=1
K-Map POS Minimization
3 Variables K-Map (1)
Gray Code
C 0
AB
0
00
1
1
01
2
3
11
6
7
4
5
10
3 Variables K-Map (2)
4 Variables K-Map (1)
CD
AB
00
01
1 1
10
00
0
1
3
2
01
4
5
7
6
11
12
13
15
14
10
8
9
11
10
4 Variables K-Map (2)
4 Variables K-Map (3)
K-Map - Examples
Mapping a Standard SOP expression
 Example:
Y  ABC D  ABC D  ABCD  ABCD  ABC D  ABC D
Y  B D  ACD
Answer:
Mapping a Standard POS expression
 Example:
Using K-Map, convert the following standard POS
expression into a minimum SOP expression
Y  A( B  C )
Answer:
Y = AB + AC or standard SOP: Y  ABC  ABC  ABC
K-Map with “Don’t Care” Conditions (1)
Example :
Input
Output
3 variables with output “don’t care (X)”
K-Map with “Don’t Care” Conditions (2)
4 variables with output “don’t care (X)”
K-Map with “Don’t Care” Conditions (3)
“Don’t Care” Conditions
 Example:
Determine the minimal SOP using K-Map:
F(A, B, C, D)  M(0,2,6,8, 9,10) D(5,12,13, 14,15)
Answer:
F ( A, B, C , D)  CD  BC  AD
Solution : F(A, B, C, D)  M(0,2,6,8, 9,10) D(5,12,13, 14,15)
CD
AB
00
BC
00
01
11
10
0
1
1
0
01
1
11
X
10
0
0
4
12
8
X
X
1
5
13
0
9
1
X
1
3
7
15
11
2
0
6
X
AD
14
0
10
Minimum SOP expression is
F ( A, B, C , D)  CD  BC  AD
CD
Exercise
 Minimize this expression with a K-Map
ABCD + ACD + BCD + ABCD
K-map Product of Sums simplification
Example: Simplify the Boolean function F(ABCD)=(0,1,2,5,8,9,10) in
(a) S-of-P
(b) P-of-S
Using the minterms (1’s)
F(ABCD)= B’D’+B’C’+A’C’D
Using the maxterms (0’s) and
complimenting F Grouping as if they
were minterms, then using DeMorgen’s theorem to get F.
F’(ABCD)= BD’+CD+AB
F(ABCD)= (B’+D)(C’+D’)(A’+B’)
5 variable K-map (1)
5 variables -> 32 minterms, hence 32 squares
required
5 variable K-map (2)
 Adjacent squares. E.g. square 15 is adjacent to
7,14,13,31 and its mirror square 11.
 The centre line must be considered as the
centre of a book, each half of the K-map being
a page
 The centre line is like a mirror with each
square being adjacent not only to its 4
immediate neighbouring squares, but also to
its mirror image.
5 variable K-Map (3)
Example: Simplify the Boolean function
F(ABCDE) = (0,2,4,6,11,13,15,17,21,25,27,29,31)
Soln: F(ABCDE) = BE+AD’E+A’B’E’
6 variable K-map
 6 variables -> 64 minterms, hence 64 squares required
Download