Download lecture04-draft

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Canonical Forms and
Logic Miniminization
Today:
• First Hour: Canonical Forms
– Section 2.2.2 of Katz’s Textbook
– In-class Activity #1
• Second Hour: Incomplete Functions,
Introduction to Logic Minimization
– Section 2.2.4 and 2.2.1 of Katz’s Textbook
– In-class Activity #2
1
Canonical Forms
• Truth tables uniquely define Boolean functions
• There are two standard (canonical) forms for
Boolean expressions that derived from the truth
table
– Represent the function’s 1s (on-set)
called Sum of Products (SOP) form
– Represent the function’s 0s (off-set) called
Product of Sums (POS) form
2
SOP Expressions
Sample truth table
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
0
0
0
1
1
1
1
1
F
1
1
1
0
0
0
0
0
F = A' B C + A B' C' + A B' C
+ A B C' + A B C
F' = A' B' C' + A' B' C
+ A' B C'
3
Notion of a minterm
• A minterm is 1 for exactly 1 row of the truth table
• A minterm is a product (AND) of all the literals
for that row
• A truth table function can be represented in
terms of its 1s
• A truth table function can be represented by
summing (ORing) its minterms
4
minterms
#
A
B
C
minterms
0
0
0
0
A' B' C' = m0
1
0
0
1
A' B' C = m1
2
0
1
0
A' B C' = m2
3
0
1
1
A' B C = m3
4
1
0
0
A B' C' = m4
5
1
0
1
A B' C = m5
6
1
1
0
A B C' = m6
7
1
1
1
A B C = m7
Shorthand
notation
for
minterms
of 3
variables
5
SOP Shorthand
Shorthand notation for SOP expressions
F(A,B,C) = A' B C + A B' C' + A B' C + A B C'
+ABC
=  m(3,4,5,6,7)
F(A,B,C)' = A' B' C' + A' B' C + A' B C'
=  m(0,1,2)
6
POS Expressions
Sample truth table
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
0
0
0
1
1
1
1
1
F
1
1
1
0
0
0
0
0
F = (A + B +C) (A + B + C')
• (A + B' + C)
F' = (A + B' +C') (A' + B + C)
• (A' + B + C') (A' + B' + C)
• (A' + B' + C')
7
Notion of a Maxterm
• A Maxterm is 0 for exactly 1 row of the truth table
• A Maxterm is the complement of the
corresponding minterm of that row
• A Maxterm is a sum (OR) of complements of all
the row literals
• A truth table function can be represented by its
0s; that is, by a product (ANDing) of Maxterms
8
Maxterms
#
A
B
C
Maxterms
0
0
0
0 A + B + C = M0
1
0
0
1 A + B + C' = M1
2
0
1
0 A + B' + C = M2
3
0
1
1 A + B' + C' = M3
4
1
0
0 A' + B + C = M4
5
1
0
1 A' + B + C' = M5
6
1
1
0 A' + B' + C = M6
7
1
1
1 A' + B' + C' = M7
Shorthand
notation
for
Maxterms
of 3
variables
9
POS Shorthand
Shorthand notation for POS expressions
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
0
0
0
1
1
1
1
1
F
1
1
1
0
0
0
0
0
F(A.B.C) = (A + B +C)
• (A + B + C') (A + B' + C)
=  M(0,1,2)
F(A,B,C)' = (A + B' +C')
• (A' + B + C) (A' + B +C')
• (A' + B' + C) (A' + B' + C')
=  M(3,4,5,6,7)
10
Canonical Conversions
Complementary relations between minterms & Maxterms
F(A,B,C) =  m(3,4,5,6,7) =  M(0,1,2)
SOP
POS
F'(A,B,C) =  m(0,1,2) =  M(3,4,5,6,7)
11
Do Activity #1 Now
• Reference:
–Section 2.2.2 of Katz’s Textbook
12
Incomplete Functions
• Don’t cares
– Outputs associated with inputs that can be ignored
– These inputs CANNOT happen in a good design
– Assign logic values to these outputs to simplify
circuits
• Example:
– Binary Coded Decimal (BCD)
13
BCD Numbers
Decimal
numbers
Not decimal!
Not a valid input!
Cannot happen!
x
x
x
x
x
x
#
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
D
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
14
Don’t Cares & Canonical Forms
Shorthand Representation
Representation of “D” in BCD
D(A,B,C,D) = m1 + m3 + m5 + m7 + m9
+ d11 + d13 + d15
= [m(1,3,5,7,9) + d(11,13,15) ]
D(A,B,C,D) = M0 • M2 • M4 • M6 • M8
• D10 • D12 • D14
= [M(0,2,4,6,8) • D(10,12,14) ]
15
Logic Minimization
• Minimization is the process of reducing a
complex logic expression or equation into a
simpler form with fewer terms by removing
redundancies and terms having no effect on the
output.
• This is similar to simplifying and reducing
complex algebraic expressions by combining and
collecting like terms.
• As in algebraic reduction, rules must be followed
that guarantee the value of the expression is not
changed by the simplification.
16
Variables & Literals
Used to measure complexity
Variable: each input variable or its complement in an expression
Literal:
each appearance of a variable or its complement in an
expression
Example
Z=ABC +AB +ABC +BC
Variables = A, B, C
Literals = 3 + 2 + 3 + 2 = 10
17
Rationale for Logic Minimization
Reduce complexity of the gate level implementation
• reduce number of literals (gate inputs)
• reduce number of gates
• reduce number of levels of gates
• fewer inputs implies faster gates in some technologies
• fan-ins (number of gate inputs) are limited in some technologies
• fewer levels of gates implies reduced signal propagation delays
• minimum delay configuration typically requires more gates
• number of gates (or gate packages) influences manufacturing costs
18
Tradeoffs
• Time and Space Trade-Offs
•Traditional methods:
•reduce delay at expense of adding gates
•New methods:
•trade off between increased circuit delay and
reduced gate count
• Power Savings
19
Alternative Gate Realizations
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
Z
0
1
0
1
0
1
1
0
0 1 0 1 0 1
A
B
C
0
Two-Level Realization
(inverters don't count)
Z1
0
Z2
Multi-Level Realization
Advantage: Reduced Gate
Fan-ins
0
Z3
Complex Gate: XOR
Advantage: Fewest Gates
20
Minimization Example
Apply the laws and theorems to simplify Boolean equations
Example: full adder's carry out function
Cout = A' B Cin + A B' Cin + A B Cin' + A B Cin
Simplify by minimizing the number terms
Apply: Laws & Theorems 3 and 9, or 1D, 3, 5 and 8
21
Simplifying Equations
Example: full adder's carry out function
Cout = A' B Cin + A B' Cin + A B Cin' + A B Cin
Alternative
[9]
= A' B Cin + A B' Cin + A B Cin' + A B Cin + A B Cin
= (A' + A) B Cin + A B' Cin + A B Cin' + A B Cin
[8]
= (1) B Cin + A B' Cin + A B Cin' + A B Cin
[5]
= B Cin + A B' Cin + A B Cin' + A B Cin + A B Cin
[9]
[3]
[1D]
= B Cin + A (B' + B) Cin + A B Cin' + A B Cin
[8]
= B Cin + A (1) Cin + A B Cin' + A B Cin
[5]
= B Cin + A Cin + A B (Cin' + Cin)
[9]
= B Cin + A Cin + A B (1)
= B Cin + A Cin + A B
[1D]
[3]
[8]
[5]
[1D]
NOTE: Minimization is just an exercise in applying laws of Boolean Algebra
learnt earlier!
22
Do Activity #2 Now
Due: End of Class Today
RETAIN THE LAST PAGE (#3)!!
For Next Class:
• Bring Randy Katz Textbook
• Required Reading:
– Sec 2.2.1 & 2.3 (omit 2.3.6) of Katz
• This reading is necessary for getting points in
the Studio Activity!
23
Related documents