Digital Logic Design Lecture 15 Announcements • HW5 due today • Upcoming: Midterm on Tuesday, 10/28. – Will post list of topics and review problems. Agenda • Last time: – Quine-McClusky (4.8) – Table Reductions (4.10) • This time: – Multiple Output Simplification Problem (4.12, 4.13) The Multiple-Output Simplification Problem • General combinational networks can have several output terminals. • The output behavior of the network is described by a set of functions π1 , π2 , … , ππ , one for each output terminal, each involving the same input variables, π₯1 , π₯2 , … , π₯π . • The set of functions is represented by a truth table with π + π columns. • Objective is to design a multiple-output network of minimal cost. • Formally: A set of normal expressions that has associated with it a minimal cost as given by some cost criteria. • Cost criteria: number of gates or number of gate inputs in the realization. Pitfalls of Naïve Approach • Multiple-output minimization problem is normally more difficult than sharing common terms in independently obtained minimal expressions. • Consider: π1 π₯, π¦, π§ = ∑π 1,3,5 π2 π₯, π¦, π§ = ∑π(3,6,7) π1 π₯, π¦, π§ = π¦π§ + π₯π§ π2 π₯, π¦, π§ = π¦π§ + π₯π¦ Pitfalls of Naïve Approach Naïve Approach: π¦ π§ π¦ π§ π1 π2 π₯ π₯ π§ π¦ Better Approach: π¦ π§ π₯ π¦ π§ π₯ π¦ π1 π2 Multiple Output Prime Implicants • A multiple-output prime implicant for a set of Boolean functions π1 , π2 , … , ππ , is a product term that: – Is a prime implicant of one of the individual functions – Is a prime implicant of one of the product functions Ππ∈π ππ , π ⊆ {1, . . , π} Examples of Multiple Output Prime Implicants π π π ππ ππ 0 0 0 1 0 0 0 1 0 1 0 1 0 1 1 0 1 1 0 0 1 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 π¦π§ is a prime implicant of π1 Examples of Multiple Output Prime Implicants π π π ππ ππ ππ ⋅ ππ 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 0 1 0 π₯π¦π§ is a prime implicant of π1 ⋅ π2 Multiple Output Prime Implicants Theorem: Formulas that achieve the multipleoutput minimal sum consist only of sums of multiple-output prime implicants such that all the terms in the expression for ππ or of a product function involving ππ Tagged Product Terms • Term consists of two parts: a kernel and a tag. – Kernel: product term involving the variables of the function – Tag: Appended to denote which functions are implied by its kernel. Tagged Product Term Example π π π ππ ππ 0 0 0 1 0 Algebraic Form Binary Form 0 0 1 1 1 π₯ π¦ π§π1 − 000π1 − 0 1 0 0 1 π₯ π¦π§π1 π2 001π1 π2 0 1 1 0 0 π₯π¦π§π1 π2 010π1 π2 1 0 0 0 0 π₯π¦π§ − π2 011 − π2 1 0 1 1 -- π₯π¦π§π1 π2 101π1 π2 1 1 0 0 0 π₯π¦π§π1 π2 111π1 π2 1 1 1 1 1 Quine-McClusky for tagged multipleoutput prime implicants 0 0 0 0 π1 − (0,1) 0 0 − π1 − (1,3,5,7) − − 1 − π2 1 0 0 1 π1 π2 (0,2) 0 − 0 π1 − (1,5,3,7) − − 1 − π2 2 0 1 0 π1 π2 (1,3) 0 − 1 − π2 3 0 1 1 − π2 (1,5) − 0 1 π1 π2 5 1 0 1 π1 π2 (2,3) 0 1 − − π2 7 1 1 1 π1 π2 (3,7) − 1 1 − π2 (5,7) 1 − 1 π1 π2 Why doesn’t (0,1,2,3) appear? • The tag of a generated term has ππ iff ππ appears in both the tags of the generating terms. • A generating term is checked only if its tag is identical to the tag of the generated term. Minimal Sums Using Petrick’s Method Multiple Outputs Prime Implicant Tables ππ ππ ππ ππ ππ ππ ππ ππ ππ π1 B π₯π¦ X π1 C π₯π§ X π2 A π§ π2 E π₯π§ π1 ⋅ π2 D π¦π§ π1 ⋅ π2 F π₯π§ π1 ⋅ π2 G π₯π¦π§ X X X X X X X X X X X X X X X Multiple Outputs Prime Implicant Tables ππ ππ ππ ππ ππ ππ ππ ππ ππ π1 B π₯π¦ X π1 C π₯π§ X π2 A π§ π2 E π₯π§ π1 ⋅ π2 D π¦π§ π1 ⋅ π2 F π₯π§ π1 ⋅ π2 G π₯π¦π§ X X X X X X X X X X X X X X X When writing down p-expression, must make a distinction between primes associated with different functions. Multiple Outputs Prime Implicant Tables ππ ππ ππ ππ ππ ππ ππ ππ ππ π1 B π₯π¦ X π1 C π₯π§ X π2 A π§ π2 E π₯π§ π1 ⋅ π2 D π¦π§ π1 ⋅ π2 F π₯π§ π1 ⋅ π2 G π₯π¦π§ X X X X X X X X X X X X X X X P-expression: (π΅1 + πΆ1 )(π΅1 + π·1 )(πΆ1 + πΊ1 )(π·1 + πΉ1 )(π΄2 + π·2 )(πΈ2 + πΊ2 )(π΄2 + πΈ2 )(π΄2 + πΉ2 ) Manipulating P-expression into sum of product form π = π΅1 + πΆ1 π΅1 + π·1 πΆ1 + πΊ1 π·1 + πΉ1 πΉ1 (π΄2 Calculating Cost of Product Terms • The term π΄2 π΅1 πΉ1 πΊ1 πΊ2 yields – π1 π₯, π¦, π§ = π₯ π¦ + π₯π§ + π₯π¦ π§ – π2 π₯, π¦, π§ = π§ + π₯π¦π§ • The term πΆ1 π·1 π·2 πΈ2 πΉ1 πΉ2 yields – π1 π₯, π¦, π§ = π₯ π§ + π¦π§ + π₯π§ – π2 π₯, π¦, π§ = π¦π§ + π₯π¦ + π₯π§ Calculating Cost of multiple output combinational network π1 , … , ππ π π πΌπ + π=1 π½π π=1 Where π‘1 , … , π‘π is the set of distinct terms, π½π is equal to the number of literals in π‘π , unless the term consists of a single literal, in which case π½π = 0. Let πΌπ be the number of terms in ππ unless there is only a single term, in which case πΌπ = 0. Calculating Cost of Product Terms • The term π΄2 π΅1 πΉ1 πΊ1 πΊ2 yields – π1 π₯, π¦, π§ = π₯ π¦ + π₯π§ + π₯π¦ π§ – π2 π₯, π¦, π§ = π§ + π₯π¦π§ Distinct terms: π₯ π¦, π₯π§, π₯π¦ π§, z Beta costs: 2 + 2 + 3 + 0 = 7 Alpha costs = 3 + 2 = 5 Total cost: 12 • The term πΆ1 π·1 π·2 πΈ2 πΉ1 πΉ2 yields – π1 π₯, π¦, π§ = π₯ π§ + π¦π§ + π₯π§ – π2 π₯, π¦, π§ = π¦π§ + π₯π¦ + π₯π§ Distinct terms: π₯ π§, π¦π§, π₯π§, π₯π¦ Beta costs: 2+2+2+2 = 8 Alpha costs = 3 +3 = 6 Total cost: 14 Minimal Sums using Table Reduction Table Reduction ππ ππ ππ ππ ππ ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X A π§ E π₯π§ D π¦π§ F π₯π§ G π₯π¦π§ X 3 X 3 X X X X X X X X X 1 3 X 3,4 X X X 3,4 4,5 Table Reduction ππ ππ ππ ππ ππ ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X A π§ E π₯π§ D π¦π§ F π₯π§ G π₯π¦π§ X 3 X 3 X X X X X X X X X 1 3 X 3,4 X X X 3,4 4,5 Essential prime implicant for π1 . Table Reduction ππ ππ ππ ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X A π§ E π₯π§ D π¦π§ X 3 X 3 X X X X π₯π¦π§ X 3,4 X X 1 3 X *1 F π₯π§ G X X π1 = π₯π§ + β― π2 = β― 1 4,5 π7 column cannot be removed from π2 part since π₯π§ is not essential for π2 . Table Reduction ππ ππ ππ ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X A π§ E π₯π§ D π¦π§ X 3 X 3 X X X X π₯π¦π§ X 3,4 X X 1 3 X *1 F π₯π§ G X X π1 = π₯π§ + β― π2 = β― 1 4,5 Dominated Rows Table Reduction ππ ππ ππ ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X A π§ E π₯π§ D π¦π§ X 3 X 3 X X X X π₯π¦π§ X 3,4 X X 1 3 X *1 F π₯π§ G X X π1 = π₯π§ + β― π2 = β― 1 4,5 Dominated Rows Row A dominates Row F Cost for Row A is not greater than cost for Row F. Table Reduction ππ ππ ππ ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X A π§ E π₯π§ D π¦π§ G π₯π¦π§ X 3 X 3 X X X X X X X X 1 3 3,4 X π1 = π₯π§ + β― π2 = β― 4,5 Table Reduction ππ ππ ππ ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X A π§ E π₯π§ D π¦π§ G π₯π¦π§ X 3 X 3 X X X X X X X X 1 3 3,4 X π1 = π₯π§ + β― π2 = β― 4,5 Only row that covers π7 Table Reduction ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X *2 A π§ E π₯π§ D π¦π§ G π₯π¦π§ X 3 X 3 1 X X 3 3,4 X X 4,5 π1 = π₯π§ + β― π2 = π§ + β― Delete π1 , π3 , π7 Table Reduction ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X E π₯π§ D π¦π§ G π₯π¦π§ X 3 X 3 X X 3 3 X X 4,5 π1 = π₯π§ + β― π2 = π§ + β― Delete row A Table Reduction ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X E π₯π§ D π¦π§ G π₯π¦π§ X 3 X 3 X X 3 3 X X 4,5 π1 = π₯π§ + β― π2 = π§ + β― Row D is dominated by Row B. Table Reduction ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X E π₯π§ D π¦π§ G π₯π¦π§ X 3 X 3 X X 3 3 X X 4,5 π1 = π₯π§ + β― π2 = π§ + β― Row D is dominated by Row B. Table Reduction ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X E π₯π§ G π₯π¦π§ X 3 X X 3 X 3 X 4,5 π1 = π₯π§ + β― π2 = π§ + β― Row D is dominated by Row B. Table Reduction ππ ππ ππ ππ Cost B π₯π¦ X C π₯π§ X E π₯π§ G π₯π¦π§ X 3 X X 3 X 3 X 4,5 π1 = π₯π§ + β― π2 = π§ + β― Row B is the only row covering π1 Table Reduction ππ ππ ππ ππ Cost *1 B π₯ π¦ X C π₯π§ X E π₯π§ G π₯π¦π§ X 3 X X 3 X 3 X 4,5 π1 = π₯π§ + π₯ π¦ + β― π2 = π§ + β― Row B is the only row covering π1 Table Reduction ππ ππ Cost *1 B π₯ π¦ C π₯π§ E π₯π§ G π₯π¦π§ 3 X X 3 X 3 X 4,5 π1 = π₯π§ + π₯ π¦ + β― π2 = π§ + β― Delete columns π0 , π1 Table Reduction ππ ππ Cost C π₯π§ E π₯π§ G π₯π¦π§ X X 3 X 3 X 4,5 π1 = π₯π§ + π₯ π¦ + β― π2 = π§ + β― Delete columns π0 , π1 Table Reduction ππ ππ Cost C π₯π§ E π₯π§ G π₯π¦π§ X X 3 X 3 X 4,5 π1 = π₯π§ + π₯ π¦ + β― π2 = π§ + β― Cannot delete dominated rows since their cost is lower. **Table is cyclic** Table Reduction ππ ππ Cost C π₯π§ E π₯π§ G π₯π¦π§ X X 3 X 3 X 4,5 π1 = π₯π§ + π₯ π¦ + π₯π¦π§ π2 = π§ + π₯π¦π§ Cannot delete dominated rows since their cost is lower. **Table is cyclic**