Chapter 4 - Portal UniMAP
Download
Report
Transcript Chapter 4 - Portal UniMAP
DKT 122 / 3
DIGITAL SYSTEMS 1
CHAPTER 4 :
BOOLEAN ALGEBRA AND LOGIC
SIMPLIFICATION
[email protected]
[email protected]
4.0 BOOLEAN ALGEBRA
Boolean Operations & expression
Laws & rules of Boolean algebra
DeMorgan’s Theorems
Boolean analysis of logic circuits
Simplification using Boolean Algebra
Standard forms of Boolean Expressions
Boolean Expressions & truth tables
The Karnaugh Map
Karnaugh Map SOP minimization
Karnaugh Map POS minimization
5 Variable K-Map
Programmable Logic
•Boolean Operations & expression
Expression :
Variable – a symbol used to represent logical
quantities (1 or 0)
ex : A, B,..used as variable
Complement – inverse of variable and is indicated by
bar over variable
ex : Ā
Operation :
Boolean Addition – equivalent to the OR operation
X=A+B
A
X
B
-
Boolean Multiplication – equivalent to the AND operation
X = A ∙B
A
B
X
Laws & rules of Boolean
algebra
Commutative law of addition
Commutative law of addition,
A+B = B+A
the order of ORing does not matter.
Commutative law of Multiplication
Commutative law of Multiplication
AB = BA
the order of ANDing does not matter.
Associative law of addition
Associative law of addition
A + (B + C) = (A + B) + C
The grouping of ORed variables does not
matter
Associative law of multiplication
Associative law of multiplication
A(BC) = (AB)C
The grouping of ANDed variables does not
matter
Distributive Law
A(B + C) = AB + AC
(A+B)(C+D) = AC + AD + BC + BD
Boolean Rules
1) A + 0 = A
In math if you add 0 you have changed nothing
In Boolean Algebra ORing with 0 changes nothing
Boolean Rules
2) A + 1 = 1
ORing with 1 must give a 1 since if any input
is 1 an OR gate will give a 1
Boolean Rules
3) A • 0 = 0
In math if 0 is multiplied with anything you
get 0. If you AND anything with 0 you get 0
Boolean Rules
4) A • 1 = A
ANDing anything with 1 will yield the anything
Boolean Rules
5) A + A = A
ORing with itself will give the same result
Boolean Rules
6) A + A = 1
Either A or A must be 1 so A + A =1
Boolean Rules
7) A • A = A
ANDing with itself will give the same result
Boolean Rules
8) A • A = 0
In digital Logic 1 =0 and 0 =1, so AA=0 since one of
the inputs must be 0.
Boolean Rules
9) A = A
If you not something twice you are back to the
beginning
Boolean Rules
10) A + AB = A
Proof:
A + AB = A(1 +B) DISTRIBUTIVE LAW
= A∙1
RULE 2: (1+B)=1
=A
RULE 4: A∙1 = A
Boolean Rules
11) A + AB = A + B
If A is 1 the output is 1 , If A is 0 the output is B
Proof:
A + AB = (A + AB) + AB
RULE 10
= (AA +AB) + AB
RULE 7
= AA + AB + AA +AB
RULE 8
= (A + A)(A + B)
FACTORING
= 1∙(A + B)
RULE 6
=A+B
RULE 4
Boolean Rules
12) (A + B)(A + C) = A + BC
PROOF
(A + B)(A +C) = AA + AC +AB +BC
DISTRIBUTIVE LAW
= A + AC + AB + BC
RULE 7
= A(1 + C) +AB + BC
FACTORING
= A.1 + AB + BC
RULE 2
= A(1 + B) + BC
FACTORING
= A.1 + BC
RULE 2
= A + BC
RULE 4
De Morgan’s Theorem,
Theorems of Boolean Algebra
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
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) Alternative symbol for the NOR function
(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) Alternative symbol for the NAND function
(c) Truth table that illustrates DeMorgan’s Theorem
De Morgan’s Theorem Conversion
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
=
=
=
=
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
Examples: Analyze the circuit below
Y
1. Y=???
2. Simplify the Boolean expression found in 1
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.
Standard Forms of Boolean Expressions
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
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
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
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
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
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 K-MAP
Karnaugh Map (K-Map)
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.
Karnaugh Map (K-Map)
• 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 Karnaugh Map
B
B
A
0
1
A
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 Karnaugh Map
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 Karnaugh Map
Gray Code
0
1
C
C
00
AB
0
1
01
AB
2
3
11
AB
6
7
10
AB
4
5
3 Variables Karnaugh Map (cont’d)
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 Karnaugh Map (cont’d)
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 Karnaugh Map (cont’d)
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 Karnaugh 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 Karnaugh 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 Karnaugh 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 using Karnaugh map
First, we need to change the circuit to an SOP expression
Simplify using Karnaugh map (cont’d)
comfirm back (the right answer)
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 Karnaugh map (cont’d)
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 Karnaugh Map
Gray Code
C 0
AB
0
00
1
1
01
2
3
11
6
7
4
5
10
3 Variables Karnaugh Map (cont’d)
4 Variables Karnaugh Map
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 Karnaugh Map (cont’d)
4 Variables Karnaugh Map (cont’d)
Karnaugh Map - Example
Mapping a Standard SOP expression
Example:
Y ABC D ABC D ABCD ABCD ABC D ABC D
Answer:
Y B D ACD
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
Example :
Input
Output
3 variables with output “don’t care (X)”
K-Map with “Don’t Care” Conditions (cont’d)
4 variables with output “don’t care (X)”
K-Map with “Don’t Care” Conditions (cont’d)
“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
F(A, B, C, D) M(0,2,6,8,9,10) D(5,12,13, 14,15)
Solution :
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
14
0
10
Minimum SOP expression is
F ( A, B, C , D) CD BC AD
AD
CD
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 De
Morgen’s theorem to get F.
F’(ABCD)= BD’+CD+AB
F(ABCD)= (B’+D)(C’+D’)(A’+B’)