variables sum

advertisement
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 )
Download