Objectives: 1. Deriving of logical expression form truth tables. 2. Logical expression simplification methods: a. Algebraic manipulation. b. Karnaugh map (k-map). 1. Deriving of logical expression from truth tables Definitions: Μ ). Literal: Non-complemented or complemented version of a variable (π¨ or π¨ Product term: a series of literals related to one another through the AND Μ β πͺ). operator (Example:π¨ β π© Sum term: A series of literals related to one another through the OR operator Μ ). Μ +πͺ (Example:( π¨ + π© SOP form: (Sum –of-products form): ο The logic-circuit simplification require the logic expression to be in SOP form , for example: Μ + πͺ Μ π« Μ π©πͺ Μ π¨π© + π¨ POS form (product-of-sum form): ο This form sometimes used in logic circuit, example: Μ ) β (π© Μ + πͺ) (π¨ + πͺ) β (πͺ + π« ο The methods of circuit simplification and design that will be used are based on SOP form. Canonical and standard form ο Product terms that consist of the variables of function are called "Canonical product terms" or "Minterms ". Μ is a minterm in a three variable logic function, but will be a ο The term π¨π©πͺ non-minterm in a four variable logic function. ο Sum terms which contain all the variables of a Boolean function are called "Canonical sum terms" or Maxterms". Μ + πͺ is a maxterm in a three variable logic function. Example: π¨ + π© Μ π© Μ , π¨ Μ π©, π¨π© Μ , π¨π© ο for two variables π¨ and π©, there are four combination: π¨ called minterms or standard products π¨ π© Minterm Μ π© Μ 0 0 π¨ Μ π© 0 1 π¨ Μ 1 0 AB 1 1 π¨π© π ο for π variables there are π minterms Example: minterms and maxterms for 3 variables: inputs π¨ π΅ πΆ 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Minterm Designation Maxterm Designation Μ Μ π© Μ πͺ π¨ Μ π© Μ πͺ π¨ Μ Μ π©πͺ π¨ π΄Μ π΅πΆ π΄π΅Μ πΆΜ π΄π΅Μ πΆ Μ π¨π©πͺ π΄π΅πΆ m0 m1 m2 m3 m4 m5 m6 m7 π¨+π©+πͺ Μ π¨+π©+πͺ Μ +πͺ π¨+π© π΄ + π΅Μ + πΆΜ π΄Μ + π΅ + πΆ π΄Μ + π΅ + πΆΜ Μ +π© Μ +πͺ π¨ Μ Μ +π© Μ +πͺ π¨ M0 M1 M2 M3 M4 M5 M6 M7 Two important properties: οΆ Any Boolean function can be expressed as a sum of minterms. οΆ Any Boolean function can be expressed as a product of minterms. Example: Majority function: (for 3 variables) Output is one whenever majority of inputs is 1 inputs π¨ π΅ πΆ 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Output F 0 0 0 1 0 1 1 1 inputs Output F π¨ π΅ πΆ 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 1 1 0 1 1 1 1 1 ο Final expression: Minterms SOP Form ---------------Μ π©πͺ π¨ -----π΄π΅Μ πΆ Μ π¨π©πͺ π¨π©πͺ Maxterms POS Form π¨+π©+πͺ Μ π¨+π©+πͺ Μ +πͺ π¨+π© -----Μ + π©+πͺ π¨ ---------------- ο Four product terms, because, there are 4 rows with a 1 output. ο Final expression: Μ + π¨π©πͺ Μ π©πͺ + π¨π© Μ πͺ + π¨π©πͺ π=π¨ ο Four sum terms, because, there are 4 rows with a 0 output. Μ ) β (π¨ + π© Μ + πͺ) β (π¨ Μ + π© + πͺ) π = (π¨ + π© + πͺ) β (π¨ + π© + πͺ Derivation of logical expression form truth tables Summary οΌ Sum-of-product (SOP) form. οΌ Product-of- sums (POS) form. o SOP form : ο§ Write an AND term for each input combination that produces a 1 output. ο§ Write the variable if its value is 1 , complement otherwise. ο§ OR the AND terms to get the final expression. 2. logical expression simplification methods: Two basic methods: a) Algebraic manipulation: ο Use Boolean laws to simplify the expression: (difficult to use and don’t know if you have the simplified form. b) Karnaugh map (k-map) method: ο Graphical method. ο Ease to use. ο Can be used to simplify logical expressions with a few variables. a) Algebraic manipulation Example 1: Design a logic circuit that has three inputs, π¨, π© and πͺ and whose output will be high only when a majority of the input are high .(complete design procedure). Solution: Step 1: set up the truth table (see previous section) Step 2: write the AND term for each case where the output is a 1 :( see previous section) Step 3: write the sum-of-products expression for the output Μ + π¨π©πͺ Μ π©πͺ + π¨π© Μ πͺ + π¨π©πͺ π=π¨ Step 4: simplify the output expression ο Find the common term(s): π¨π©πͺ -common term. ο Use the common term (π¨π©πͺ) to factor with other terms: Μ + π¨π©πͺ Μ π©πͺ + π¨π©πͺ + π¨π© Μ πͺ + π¨π©πͺ + π¨π©πͺ π=π¨ ο Factoring the appropriate pairs of terms: Μ + πͺ) Μ + π¨) + π¨πͺ(π© + π© Μ ) + π¨π©(πͺ π = π©πͺ(π¨ π = π©πͺ + π¨πͺ + π¨π© Step 5: implement the circuit for the final expression. A B C BC F ο½ BC ο« AC ο« AB AC AB Example 2: simplify the Boolean function. Μ πͺ + π©πͺ π = π¨π© + π¨ Solution: Μ πͺ + π©πͺ. π π = π¨π© + π¨ (Common term) Μ πͺ + π©πͺ(π¨ + π¨ Μ ) = π¨π© + π¨ Μ πͺ + π¨ Μ π©πͺ = π¨π© + π¨π©πͺ + π¨ Μ πͺ(π + π©) = π¨π©(π + πͺ) + π¨ Μ πͺ (The result) = π¨π© + π¨ Example 3: simplify the following Boolean function to a minimum number of literals. Μ + π¨π© + π©πͺπ« πΏ = π©πͺ + π¨πͺ Solution: Μ + π¨π© πΏ = π©πͺ(π + π«) + π¨πͺ Μ + π¨π© = π©πͺ + π¨(πͺ Μ + π©) = π©πͺ + π¨πͺ Example 4: simplify the expression. Μ + π¨π© Μ πͺ Μ πͺ + π¨π©πͺ π = π¨π© Solution: (the expression is in SOP form) Μ + πͺ) + π¨π©πͺ Μ (πͺ π = π¨π© Μ (π) + π¨π©πͺ = π¨π© Μ + π¨π©πͺ = π¨π© Μ + π©πͺ) = π¨(π© Μ + π©)(π© Μ + πͺ) = π¨(π© Μ + πͺ) π = π¨(π© Example 5: simplify the expression. Μ Μ Μ Μ Μ Μ Μ Μ π« Μ πͺ(π¨ Μ π©π«) + π¨ Μ π©πͺ Μ + π¨π© Μ πͺ π=π¨ Solution: οΌ First, use Demorgan’s theorem on the first term: Μ π« Μ πͺ(π¨ ΜΏ+π© Μ +π« Μ ) + π¨ Μ π©πͺ Μ + π¨π© Μ πͺ π=π¨ Μ π« Μ πͺ(π¨ + π© Μ +π« Μ ) + π¨ Μ π©πͺ Μ + π¨π© Μ πͺ π=π¨ οΌ Multiply, we get: Μ π« Μ πͺπ¨ + π¨ Μ πͺπ© Μ +π¨ Μ πͺπ« Μ +π¨ Μ π©πͺ Μ + π¨π© Μ πͺ π=π¨ (π΄Μ π΄ = 0) then Μ π« Μ π© Μ πͺ + π¨ Μ πͺπ« Μ +π¨ Μ π©πͺ Μ + π¨π© Μ πͺ π=π¨ οΌ Check for the largest common factor between any two or more product terms: Μ ) Μ πͺ(π¨ Μ + π¨) + π¨ Μ π« Μ (πͺ + π©πͺ π=π© 1 πͺ+π© οΌ We get: Μ πͺ + π¨ Μ π« Μ (π© + πͺ) π=π© οΌ The result can be obtained with other choices Example 6: Find the complement of the following Boolean function: Μ +π¨ Μ π«)( π¨π© Μ + πͺπ« Μ ) π = (π©πͺ Solution: οΌ Use Demorgan’s theorem : Μ +π¨ Μ = Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ π«)( π¨π© Μ + πͺπ« Μ ) (π©πͺ π Μ +π¨ Μ π«) + Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ + πͺπ« Μ ) (π©πͺ ( π¨π© = Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ β Μ Μ Μ Μ Μ π« + π¨π© Μ β πͺπ« Μ = π©πͺ π¨ ΜΏ ) β (π¨ Μ +π« Μ +πͺ ΜΏ+π« Μ ) + (π¨ Μ +π© ΜΏ )(πͺ ΜΏ) = (π© Μ + π«) Μ + πͺ) β (π¨ + π« Μ ) + (π¨ Μ + π©) β (πͺ = (π© οΌ It’s not in standard form Example 7: Express the following function in a sum of minterms and product of maxterms. π = (π¨π© + πͺ)(π© + π¨πͺ) a) Sum of minterms: οΌ Multiply, we get: π = π¨π©π© + π¨π¨π©πͺ + π©πͺ + π¨πͺπͺ Μ =π π¨+π¨ = π¨π© + π¨π©πͺ + π©πͺ + π¨πͺ Μ ) + π©πͺ(π¨ + π¨ Μ ) + π¨πͺ(π© + π© Μ ) = π¨π©πͺ + π¨π©(πͺ + πͺ Μ + π¨π©πͺ + π¨ Μ π©πͺ + π¨π©πͺ + π¨π© Μ πͺ = π¨π©πͺ + π¨π©πͺ + π¨π©πͺ Μ + π¨π©πͺ + π¨ Μ π©πͺ + π¨π© Μ πͺ π = π¨π©πͺ m6 m7 m3 Μ =π πͺ+πͺ m5 οΌ So, we can write: π(π¨, π©, πͺ) = ∑ π(π, π, π, π) Μ =π π©+π© π¨+π¨=π¨ inputs Minterm π¨ π΅ πΆ 0 0 0 m0 0 0 1 m1 0 1 0 m2 0 1 1 m3 1 0 0 m4 1 0 1 m5 1 1 0 m6 1 1 1 m7 Sum of minterms z 0 0 0 1 0 1 1 1 b) Sum of maxterms οΌ Using distributive law: (π¨ + π©πͺ) = (π¨ + π©)(π¨ + πͺ) οΌ In the π = (π¨π© + πͺ)(π© + π¨πͺ) οΌ We get: = (π¨ + πͺ)(π© + πͺ)(π© + π¨)(π© + πͺ) = (π¨ + π©)(π© + πͺ)(πͺ + π¨) π = (π¨ + π©)(π© + πͺ)(πͺ + π¨) o In o In o In οΌ We can π¨ + π© we need πΆ π© + πͺ we need π¨ πͺ + π¨ we need π© write Μ ) (π¨ + π©) = (π¨ + π© + π) = (π¨ + π© + πͺπͺ Μ ) (π¨ + π©) = (π¨ + π© + πͺ)(π¨ + π© + πͺ Μ ) (π© + πͺ) = ( π© + πͺ + π) = (π© + πͺ + π¨)(π© + πͺ + π¨ Μ ) (πͺ + π¨) = (πͺ + π¨ + π©)(πͺ + π¨ + π© οΌ Substitute all of these term in π ,we get: π = (π¨ + π©)(π© + πͺ)(πͺ + π¨) Μ ) (π© + πͺ + π¨)(π© + πͺ + π¨ Μ ) (πͺ + π¨ = (π¨ + π© + πͺ)(π¨ + π© + πͺ Μ ) + π©)(πͺ + π¨ + π© Μ ) (π© + πͺ + π¨ Μ )(πͺ + π¨ + π© Μ ) π = (π¨ + π© + πͺ)(π¨ + π© + πͺ Μ ) (π¨ Μ + π© + πͺ)(π¨ + π© Μ + πͺ) π = (π¨ + π© + πͺ)(π¨ + π© + πͺ π = π΄π β π΄π β π΄π β π΄π inputs π¨ π΅ πΆ 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 π Maxterm 0 0 0 1 0 1 1 1 M0 M1 M2 M3 M4 M5 M6 M7 Example 8: simplify the logic circuit shown in the following figure. __ A A B B C C ο¦ __ οΆ A B ο§ο§ A C ο·ο· ο¨ οΈ __ AC ο¦ __ οΆ Z ο½ ABC ο« A B ο§ο§ A C ο·ο· ο¨ οΈ Solution: οΌ The output of the circuit is Μ . (π Μ Μ Μ Μ Μ πΜ ) π = πππ + ππ οΌ Using Demorgan’s law and multiply out all terms: Μ (π ΜΏ + πΜΏ) π = πππ + ππ Μ (π + π) π = πππ + ππ Μ π + ππ Μ π π = πππ + ππ Μ π + ππ Μ π π = πππ + ππ Μ + ππ Μ π π = πππ + ππ SOP Form Μ + ππ Μ π π = πππ + ππ Μ ) + ππ Μ π = ππ(π + π Μ = ππ + ππ Μ = π(π + π Μ ) π = ππ. π + ππ __ A B B C B ο« C Z ο½ A( B ο« C )