Two Level Networks. Two-Level Networks Slide 2 SOPs A function has, in general many SOPs Functions...
-
Upload
harvey-davis -
Category
Documents
-
view
212 -
download
0
Transcript of Two Level Networks. Two-Level Networks Slide 2 SOPs A function has, in general many SOPs Functions...
Two Level Networks
Two-Level Networks Slide 2
SOPs
• A function has, in general many SOPs• Functions can be simplified using Boolean
algebra
Compare theimplementationof the original to the finalrepresentation
Two-Level Networks Slide 3
Don’t Care Conditions
• In practice there are combinations that will never occur
• we may pick the most convenient assignment• A BCD input is greater than 5
ABCD F
0000 0
0001 0
0010 0
0011 0
0100 0
0101 0
0110 1
0111 1
ABCD F
1000 1
1001 1
1010 -
1011 -
1100 -
1101 -
1110 -
1111 -
F = m(6,7,8,9)+ d(10,11,12,13,14,15)
don’t cares = 0 F= ABC + ABC
don’t cares = 1 F= BC + A
Two-Level Networks Slide 4
Karnaugh MapBC
00 01 11 10
A 0 m0 m1 m3 m2
1 m4 m5 m7 m6ABC F
000 0
001 1
010 0
011 1
100 0
101 1
110 1
111 1
BC
00 01 11 10
A 0 0 1 1 0
1 0 1 1 1
F = C + AB
Adjacent cells are at Hamming distance 1
Two-Level Networks Slide 5
Examples
• F = m(1,4,5)+ d(0)• F = m(0,3,5,6)• F = m(0,2,3,4,5,7)
Two-Level Networks Slide 6
4-variable Karnaugh MapsCD
00 01 11 10
AB
00 m0 m1 m3 m2
01 m4 m5 m7 m6
11 m12 m13 m15 m14
10 m8 m9 m11 m10
•F = m(1,4,5,6,14)+ d(3,7)•F = m(0,4,5,6,9,12,13)•F = m(0,2,5,6,7,8,10,13)
Two-Level Networks Slide 7
Prime Implicants• Given two logic functions f and g, if g(x) = 1 for all x
such that f(x) = 1, then g contains f, denoted f ≤ g.• If a logic function f contains a product c, then c is an
implicant of f. Furthermore, if c is a minterm, then c is a minterm of f.
• A product P is a sub-product of Q, if all the literals in P also appear in Q.
• Let P be an implicant of a logic function f. If no other implicant Q of f is a sub-product of P, then P is a prime implicant (PI) of f.
Two-Level Networks Slide 8
Prime Implicants in K maps
• largest blocks (loops) of 2i 1-cells (may include don’t care cells)
• Show examples
Two-Level Networks Slide 9
Minimum SOP• Consider an SOP that consists of PIs. If any SOP that is
obtained by removing any of the PIs does not represent the original function f, then the original SOP is an irredundant sum-of-product expression (ISOP) of f.
• Among the ISOPs for f, one with the minimum number of products is a minimum sum-of-product expression (MSOP). Among the MSOPs for f, one with the minimum number of literals is a exact minimum sum-of-product expression (exact MSOP) of f.
• Let m be a minterm of a logic function f. If only one PI of f covers m, the m is a distinguished minterm. Among all the PIs of f, if there is only one that covers m, then it is an essential prime implicant.
Two-Level Networks Slide 10
Example
• F = m(2,5,6,7,10,11)
F = ABD + ABC + ACD + BCD + ABC (SOP)
F = ABD + ABC + BCD + ABC (ISOP)
F = ABC + ACD + ABC (MSOP)
Two-Level Networks Slide 11
Quine-McCluskey (Tabular) Minimization
• Two step process utilizing tabular listings to: – Identify prime implicants (implicant tables)– Identify minimal cover (cover tables)
• All work is done in tabular form– Number of variables is not a limitation
• It does affect the size of the table– Basis for many computer implementations
• Proper organization and term identification are key factors for correct results
Two-Level Networks Slide 12
Quine-McCluskey Minimization
• Minterms are initially listed one per line in groups– Each group contains terms with the same number of
true and complemented variables– Terms are listed in numerical order within group
• Terms and implicants are identified using one of three common notations– full variable form– cellular form– 1,0,- form
Two-Level Networks Slide 13
Notation Forms• Full variable form - variables and complements
in algebraic form– hard to identify when adjacency applies– very easy to make mistakes
• Cellular form - terms are identified by their decimal index value– Easy to tell when adjacency applies; indexes must
differ by power of two (one bit)– Implicants identified by term nos. separated by
comma; differing bit pos. in () following terms
Two-Level Networks Slide 14
Notation Forms (cont.)
• 1,0,- form - terms are identified by their binary index value– Easier to translate to/from full variable form– Easy to identify when adjacency applies, one bit is
different– - shows variable(s) dropped when adjacency is
used
• Different forms may be mixed during the minimization
Two-Level Networks Slide 15
Example of Different NotationsF(A, B, C, D) = m(4,5,6,8,10,13)
1 ABCD 4 0100ABCD 8 1000
2 ABCD 5 0101 ABCD 6 0110 ABCD 10 10103 ABCD 13 1101
Full variable Cellular 1,0,-
Two-Level Networks Slide 16
Implication Table
• Quine-McCluskey Method– Tabular method to
systematically find all prime implicants
– ƒ(A,B,C,D) = Σ m(4,5,6,8,9, 10,13) + Σ d(0,7,15)
– Part 1: Find all prime implicants– Step 1: Fill Column 1 with
active-set and DC-set minterm indices. Group by number of true variables.
Implication Table
Column I
0000 0100 1000 0101 0110 1001 1010 0111 1101
1111
NOTE: DCs are included in this step!
Two-Level Networks Slide 17
Minimization - First Pass• Quine-McCluskey Method
– Tabular method to systematically find all prime implicants
– ƒ(A,B,C,D) = Σ m(4,5,6,8,9,10,13) + Σ d(0,7,15)
– Part 1: Find all prime implicants– Step 2: Apply Adjacency - Compare
elements of group with N 1's against those with N+1 1's. One bit difference implies adjacent. Eliminate variable and place in next column.
E.g., 0000 vs. 0100 yields 0-00
0000 vs. 1000 yields -000
When used in a combination, mark with a check. If cannot be combined, mark with a star. These are the prime implicants.
Repeat until nothing left.
Implication Table
Column I
0000 0100 1000 0101 0110 1001 1010 0111 1101
1111
Column II
0-00 -000 010- 01-0 100- 10-0 01-1 -101 011- 1-01
-111 11-1
Two-Level Networks Slide 18
Minimization - Second Pass
Implication Table
Column I
0000 0100 1000 0101 0110 1001 1010 0111 1101
1111
Column II
0-00 * -000 * 010- 01-0 100- * 10-0 * 01-1 -101 011- 1-01 *
-111 11-1
Column III 01-- * -1-1 *
• Quine-McCluskey Method– Step 2 cont.: Apply Adjacency - Compare
elements of group with N 1's against those with N+1 1's. One bit difference implies adjacent. Eliminate variable and place in next column.
E.g., 0000 vs. 0100 yields 0-00
0000 vs. 1000 yields -000
When used in a combination, mark with a check. If cannot be combined, mark with a star. These are the prime implicants.
Repeat until nothing left.
Two-Level Networks Slide 19
Prime ImplicantsPrime Implicants:
D C A 00-0 =
C BA -100 =
D C B 000- =
D BA 0-10 =
D CA 01-1 = D B 1-1- =
B A --01 =
X 1 0 1
0 1 1 1
0 X X 0
0 1 0 1
AB 00 01 11
01
11
10 C
CD
A
D
B
00
10
Two-Level Networks Slide 20
Stage 2: find smallest set of prime implicants that cover the active-set
recall that essential prime implicants must be in final expression
Prime Implicants (cont.)Prime Implicants:
D C A 00-0 =
C BA -100 =
D C B 000- =
D BA 0-10 =
D CA 01-1 = D B 1-1- =
B A --01 =
X 1 0 1
0 1 1 1
0 X X 0
0 1 0 1
AB 00 01 11
01
11
10 C
CD
A
D
B
00
10
Two-Level Networks Slide 21
rows = prime implicantscolumns = ON-set elementsplace an "X" if ON-set element is covered by the prime implicant
Coverage Chart
0,4(0-00)
0,8(-000)
8,9(100-)
8,10(10-0)
9,13(1-01)
4,5,6,7(01--)
5,7,13,15(-1-1)
4X
X
5
X
X
6
X
8
X
X
X
9
X
X
10
X
13
X
X
Coverage Table
Note: Don’t include DCs in coverage table; they don’t have to be covered by the final logic expression!
Two-Level Networks Slide 22
Coverage Table (cont.)
rows = prime implicantscolumns = ON-set elementsplace an "X" if ON-set element is covered by the prime implicant
If column has a single X, than theimplicant associated with the rowis essential. It must appear inminimum cover
0,4(0-00)
0,8(-000)
8,9(100-)
8,10(10-0)
9,13(1-01)
4,5,6,7(01--)
5,7,13,15(-1-1)
4X
X
5
X
X
6
X
8
X
X
X
9
X
X
10
X
13
X
X
0,4(0-00)
0,8(-000)
8,9(100-)
8,10(10-0)
9,13(1-01)
4,5,6,7(01--)
5,7,13,15(-1-1)
4X
X
5
X
X
6
X
8
X
X
X
9
X
X
10
X
13
X
X
Coverage Chart
Two-Level Networks Slide 23
Coverage Table (cont.)
Eliminate all columns covered byessential primes
0,4(0-00)
0,8(-000)
8,9(100-)
8,10(10-0)
9,13(1-01)
4,5,6,7(01--)
5,7,13,15(-1-1)
4X
X
5
X
X
6
X
8
X
X
X
9
X
X
10
X
13
X
X
Two-Level Networks Slide 24
Coverage Table (cont.)
Eliminate all columns covered byessential primes
Find minimum set of rows thatcover the remaining columns
0,4(0-00)
0,8(\000)
8,9(100-)
8,10(10-0)
9,13(1-01)
4,5,6,7(01--)
5,7,13,15(-1-1)
4X
X
5
X
X
6
X
8
X
X
X
9
X
X
10
X
13
X
X
0,4(0-00)
0,8(-000)
8,9(100-)
8,10(10-0)
9,13(1-01)
4,5,6,7(01--)
5,7,13,15(-1-1)
4X
X
5
X
X
6
X
8
X
X
X
9
X
X
10
X
13
X
X
BA DCA DBA F ++= BA DCA DBA F ++=
Two-Level Networks Slide 25
Cover Table Reduction
1. Detection of essential rows
2. Elimination of dominated rows
3. Elimination of dominated columns
4. Detection of Pseudo-essential rows
5. repeat step 2 to 4 while reductions are possible
Two-Level Networks Slide 26
Solution Methods for Cyclic Tables
• Example F = m(0,2,3,4,5,7)• naïve algorithm
1. Assume that a row is in the final solution, reduce the covering, and obtain a minimum cover
2. Assume that a row is not in the final solution, reduce the covering, and obtain a minimum cover
3. select the lower from (1) and (2)
Two-Level Networks Slide 27
Branch and Bound
1. Brancha) Choose one row from the covering table. Let it be A.b) Assume A is in the final solution---find minimal coverc) Assume A is not in the final solution---find minimal
coverd) Select smaller of (b) and (c)
2. Bounda) if the cost of the solution is equal to the lower bound of
the cost of the minimum cover, then stop the search.b) if the solution of the current problems cannot be better
than the best solution found, then stop the search.
Two-Level Networks Slide 28
Algebraic Method for Cyclic Tables
ma mb mc md me
P1 X X X
P2 X X
P3 X X
P4 X X
P5 X X
P6 X X
Let gi = 1 iff Pi is present in the SOP
Two-Level Networks Slide 29
Algebraic Method for Cyclic Tables
QuickTime™ and aTIFF (LZW) decompressor
are needed to see this picture.
QuickTime™ and aTIFF (LZW) decompressor
are needed to see this picture.
QuickTime™ and aTIFF (LZW) decompressor
are needed to see this picture.
P1 + P5 is the MSOP