Module 4b Logic Simplification (Student)
Module 4b Logic Simplification (Student)
• Simplification:
– To reduce an expression to its simplest form
– To change a form to a more convenient one for
efficient implementation
• We use:-
– basic laws, rules, theorems of Boolean algebra
1
FACULTY OF COMPUTER SCIENCE & INFORMATION SYSTEM
2
Example:
Ex
tr
a
1 A+0=A
2 A+1=1
Exercise 4b.1: According the the example given before, draw
3 A 0=0 the logic circuit for the original expression and
4
5
A 1=A
A+A=A
the last expression simplified.
6 A+A=1
7 A A=A AB + A(B+C) + B(B+C)
8 A A=0
9 A=A
10 A + AB = A
11 A + AB = A + B
12 (A + B)(A + C) = A + BC
3 4
Example: Example:
Ex
1 A+0=A
2 A+1=1
3 A 0=0 tr
4 A 1=A a
5 A+A=A
6 A+A=1
7 A A=A Exercise 4b.2:
8 A A=0
5 6
2012/2013-1 @m 1
10/23/12
A =1
Forms of Boolean
expressions
SOP POS
(Sum-of-Products) (Product-of-Sum)
7 8
Ex Ex
tr tr
a a
(Refer to module page 120)
10
9 10
Ex
tr
a The Sum-of-Product (SOP) form
Exercise 4b.5:
A Boolean expression is written in PI notation as • SOP = when 2 or more product terms are
X= ∏ (7, 4, 3). Determine the logic level (binary value) for summed
ABC
each sum term and write whole expression. . • e.g ABP1 + ABCP2
ABCP1 + CDEP2 + BCDP3
• SOP can also contain a single variable term
ABC þ ABC ý
11
11 12
2012/2013-1 @m 2
10/23/12
Ex
tr
a
13 14
Conversions to
Standard Forms
• A standard SOP /
POS form is when
ALL the variables
SOP POS
appear in each
product term /
sum term of the Rule 6: Rule 8:
Rule 12: Rule 6: (A + Ā)=1
expression. A + A =1 A• A = 0
(A + BC) = (A + B)(A + C)
15 16
Rule 6: (A + Ā)=1
Example:
Term 1: ABC = ABC ( D + D) = ABCD + ABC D
• Convert this Boolean expression to standard SOP
form: Term 2 : AB = ABC + ABC
ABC + AB + ABC D
= ABC ( D + D) + ABC ( D + D) = ABCD + ABC D + ABC D + ABC D
Solution:
• Variables = A, B, C, D.
• What is missing? • Now we have
– Term 1: missing D or D’
– Term 2: missing (C/C’) and (D/D’)
ABC + AB + ABC D
• Complete these terms by applying Boolean rule 6
= ABCD + ABC D + ABCD + ABC D + ABC D + ABC D + ABC D
continue...
17 18
2012/2013-1 @m 3
10/23/12
Ex
tr
Rule 6: (A + Ā)=1 a
Binary representation of a
Standard product term
Exercise 4b.7: Define the variables of SOP expression in
• A product = 1 only if ALL variables
in the term is equal to 1.
Exercise 4b.6(iii) and convert the expression ABC + ABC = 1
– Remember:
to standard SOP form.
product = multiplication è 1.1 = 1
AC + BC
• A sum = 1 when ONE
or ALL of the variables SOP
SOP
in the term is equal to 1.
– Remember:
sum = addition è Product1 Product2 Product3
1 + 0 = 1;
0 + 1 = 1; Var1 Var1 Var1
1+1=1
19 20
Example:
1 From the standard SOP
it is easy to generate
the truth table.
1111
1001
0000
continue...
21 22
• POS = when 2 or more sum terms are • Implementation of the POS expression
multiplied. (A + B)(B + C + D)(A + C)
– (A + B)S1(A + B + C)S2
– (A + B + C)S1(C + D + E)S2(B + C + D)S3
A
A+ B+C þ A+ B+C ý C
23 24
2012/2013-1 @m 4
10/23/12
Example:
• Standard POS form = where all the variables appear
in each sum term in the expression. • Convert this Boolean expression to standard POS
form
• To convert product terms to standard POS ( A + B + C )( B + C + D)( A + B + C + D)
– Multiply each of the nonstandard term with the missing
term using Boolean algebra rule
Rule8:8: (A . Ā) = 0
Solution:
• Variables = A, B, C, D.
– Apply rule
Rule1212:
: A (A
+ BC = (A=+(A
+ BC) B)(A + C) + C)
+ B)(A
• What is missing?
– Term 1: missing D or D’
– Repeat until all variables appear in each sum term.
– Term 2: missing A or A’
continue...
25 26
Ex
tr
a
Term 1 : A + B + C = A + B + C + D D = ( A + B + C + D)( A + B + C + D)
Term 2 : B + C + D = B + C + D + A A
= ( A + B + C + D)( A + B + C + D)
• Now we have
( A + B + C )( B + C + D)( A + B + C + D)
= ( A + B + C + D)( A + B + C + D)( A + B + C + D)( A + B + C + D)( A + B + C + D)
27
28
Binary representation of a
Standard Sum term
• A product = 0 only if ONE or MORE Example: Determine the binary value for which following
of the sum term is equal to 0.
standard POS expression is equal to 0
– Remember:
product = multiplication è 1.1 = 1
(A + B + C + D) (A + B + C + D) (A + B + C + D)
(A + B + C)(A + B + C) = 0
• A sum = 1 when ONE or Solution:
ALL of the variables in (A + B + C + D) = (0 + 0 + 0 + 0) = 0; A=0, B=0, C=0, D=0
POS
POS
the term is equal to 1.
(A + B + C + D) = (0 + 1 + 1 + 0) = 0; A=0, B=1, C=1, D=0
– Remember:
sum = addition è Sum1 Sum2 Sum3 (A + B + C + D) = (1 + 1 + 1 + 1) = 0; A=1, B=1, C=1, D=1
1 + 0 = 1;
0 + 1 = 1; The POS expression equal 0 when ALL of the terms are 0.
Var1 Var1 Var1
1+1=1 continue...
29 30
2012/2013-1 @m 5
10/23/12
1 1 1 1 31 continue...
32
A B C + A B C + A BC + AB C + A B C
• Step 1: Evaluate each product term in the SOP
expression è i.e. determine the binary numbers A B C
of the product terms. Solution:
• Variables = (A, B, C) = 3. So, 23 = 8
• Step 2: Determine all the binary numbers not possible combinations.
included in Step 1.
A B C + A B C + A BC + A B C + A B C
000 010 011 101 111
• Step 3: Write equivalent sum term for each
binary number from Step 2 and express in POS
form.
2012/2013-1 @m 6
10/23/12
• Step 1: determine variables and combinations of Example • Develop a truth table for the standard SOP
binary values è input expression
ABC + ABC + ABC
• Step 2: convert expression to Standard SOP/POS.
Solution • Domain = A, B, C. combinations = 23 = 8
• Step 3: find the binary values that make the • What binary value makes the product term = 1?
product = 1(SOP)
Product=1 (SOP) or sum = 0 (POS)
Sum=0 ABC INPUTS OUTPUT PRODUCT
001 =111=1 TERM
A B C X
• Step 4: the remaining combination will be ABC 0 0 0 0
– Equal to 0 (SOP) 0 0 1 1 ABC
100 =111=1
0 1 0 0
– Equal to 1 (POS) ABC 0 1 1 0
ABC
111 =111=1 1
1
0
0
0
1
1
0
• Fill in the truth table 1 1 0 0
• Fill the truth table 1 1 1 1 ABC
37 38
SOP POS
1010 ABCD 1001 A+B+C+D
ABCD = 1 0 1 0 A+B+C+D= 1+0+0+1
=1111=1 =0+0+0+0=0
41 42
2012/2013-1 @m 7
10/23/12
Ex
tr
a Karnaugh Map (K-Map)
Exercise 4b.11: INPUT OUTPUT • K-Map is similar to the truth table, but it presents all of the
A B C X possible values of input and output.
0 0 0 0 • This is shown in an array of cells.
From the truth table,
0 0 1 0 • K-Maps can be used for expressions with 2,3,4 or 5
determine the:
0 1 0 0 variables.
0 1 1 1
(i) standard SOP • The number of cells in a K-Map = total number of possible
1 0 0 1
expression; and input variable combinations è 3 = 23 = 8
1 0 1 0
(ii) equivalent standard • Physically, cells that share their walls are adjacent
1 1 0 1
POS expression • In a K-map with 4-variable or more, the top-most &
1 1 1 1
bottom-most cells of a column (and row) are adjacent.
continue...
43 44
Example: ABC + ABC + ABC + ABC ABCD + ABCD + ABCD + ABCD + ABCD + ABCD + ABCD
01 1
11 1 ABCD
11 1 1 1
10 1 ABCD 10 1 ABCD
ABCD ABCD
47 48
2012/2013-1 @m 8
10/23/12
K-Map simplification of
SOP expression
• To use K-Maps, expressions must be in standard form.
• For expressions that are not standard, it must be converted • There are 3 steps to obtain a minimum SOP
to a standard form. expression from a K-Map.
• Recall: AB + ABC SOP / Rule 6: (A + Ā)=1
– AB(C/C’) 11(1/0) ABC + ABC’ 1. Grouping the 1s
C
– So: ABC + ABC’ + ABC 0 1
AB
• Map the following expression on a K-Map:
00 1 1
2. Determine product term for each group
A + AB + ABC
01 1 1
000 100 110
11 1
3. Summing the resulting product terms
001 101
010
10 1 1
011
49 50
Grouping the 1s
51 52
10
1 1 11
10 1 1
11 1 1 11 1
AC'
10 10 1 1
• When the minimum product terms are derived,
AB
sum them to form the minimum SOP
continue... ABC + BC + AB AC + B + AC continue...
53 54
2012/2013-1 @m 9
10/23/12
Ex
tr
a
Mapping directly K-Map
Exercise 4b.12: Use a Karnaugh map to minimize the from a truth table
following standard SOP. X = ABC + ABC + ABC + ABC
00 1
0 0 0 1
0 0 1 0 01
0 1 0 0 11 1 1
0 1 1 0
10 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
57 58
• Sometime there are certain combinations of input variable • “don’t care” terms can be used with K-maps to produce
that is not allowed. better results
– Eg. 6 invalid combinations in BCD code (1010, 1011, – Used as part of a group è the larger the group, the
1100, 1101, 1110, 1111)
simpler the resulting term will be
– When grouping 1s, the Xs can be treated as 1 to make the
• These states will never occur in an application using BCD
group larger
code, hence they can be treated as “don’t care” terms.
– the Xs is treated as 0s if they cannot be used to
• “don’t care” terms may be assigned either a 1 or a 0; it advantage.
does’nt matter as it will never occur.
continue...
59 60
2012/2013-1 @m 10
10/23/12
Ex
tr
a
Invalid
input for
BCD
61 62
01 0
• To map a Standard POS expression: 11 0
– Step 1: Determine the binary value of each
sum term (i.e. that makes the sum term = 10 0
0)
– Step 2: Check result and place a 0 on the (The methods are similar to SOP minimization,
corresponding cell in K-map except 00 is used for POS)
continue...
63 64
K-Map simplification of
POS expression
Example: Try mapping the following Standard POS expression
into the K-Map: • The process is basically the same as with SOP
(A + B + C + D)(A + B + C + D)(A + B + C + D)(A + B + C + D)(A + B + C + D) expressions:
1100 1011 0010 1111 0011 – Group 0s instead of 1s
(A + B + C + D) – The rules of grouping 0s are the same as
CD
00 01 11 10 those for 1s
AB
00 0 0 (A + B + C + D) – Expression must be in Standard POS form
01
(A + B + C + D)
11 0 0 (A + B + C + D)
10 0
(A + B + C + D)
65 66
2012/2013-1 @m 11
10/23/12
continue...
67 68
continue...
71 72
2012/2013-1 @m 12
10/23/12
X = (ABC)C + ABC + D
continue...
73 74
continue...
75 76
77
2012/2013-1 @m 13