Demp Session - 1 VP
Demp Session - 1 VP
representations.
Logic Gates:
Symbol set 1 Symbol set 2
(ANSI/IEEE Standard 91-1984)
a a
AND a.b & a.b
b b
a a
OR a+b 1 a+b
b b
NOT a 1 a'
a a'
a a
(a.b)' & (a.b)'
NAND b b
a a
NOR (a+b)' 1 (a+b)'
b b
XOR a a
ab =1 ab
b b
Dr VP-WASE 1
Drawing a logic circuit
When a Boolean expression is provided, we can easily
draw the logic circuit.
Examples:
(i) F1 = xyz' (note the use of a 3-input AND gate)
x
y F1
z z'
y F5
Positive logic:
Active High:
Enable 0: Disabled
1: Enabled
Negative logic:
Active Low:
Enable 0: Enabled
1: Disabled
Dr VP-WASE 3
Basic boolean theorems
• A+1=A ; A+A = A ; A + 0 = A ; A + A’ = 1
• A.1 = A ; A.A = A; A . 0 = 0 ; A . A’ = 0
• A+A’B = A+B ; A’+AB = A’ + B ; A’ + AB’ = A’+B’
• A’’ = A ; A + A.B = A ;
• D’Morgans Theorem:
(a + b ) ‘ = a’ . b’
(a . b) ‘ = a’ + b’
• Duality: Replace AND by OR and 0 by 1.
Eg. A+1=1 = A.0 = 0 ; A.1=A A+0=A ;
Dr VP-WASE 4
Complement of Functions
Given a function, F, the complement of this function, F', is
obtained by interchanging 1 with 0 and 0 with 1 in the
function’s output values.
x y z F1 F1'
0 0 0 0 1
Example: F1 = xyz'
0 0 1 0 1
Complement: 0 1 0 0 1
F1' = (xyz')' 0 1 1 0 1
1 0 0 0 1
= x' + y' + (z')' DeMorgan
1 0 1 0 1
= x' + y' + z Involution 1 1 0 1 0
1 1 1 0 1
Dr VP-WASE 5
Cannonical form
Dr VP-WASE 6
Dr VP-WASE 7
Dr VP-WASE 8
F1 = x’y’z + x’yz’ + x’yz + xyz’
F2 = x’y’z’ + x’y’z + xy’z + xyz
OR
F1 = ∑ m1 + m2 + m3 + m6
F2 = ∑ m0 + m1 + m5 + m7
Dr VP-WASE 9
OR
F1 = ∏ (M0 , M4, M5, m7)
F2 = ∏ ( M2 , M3, M4 , M6)
Dr VP-WASE 10
F = X’YZ + XY’Z + XYZ’ + XYZ
X Y Z F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1 Dr VP-WASE 11
Conversion of Canonical Forms
Sum-of-Minterms Product-of-Maxterms
Rewrite minterm shorthand using maxterm shorthand.
Replace minterm indices with indices not already used.
Eg: F1(A,B,C) = m(3,4,5,6,7) = M(0,1,2)
Product-of-Maxterms Sum-of-Minterms
Rewrite maxterm shorthand using minterm shorthand.
Replace maxterm indices with indices not already used.
Eg: F2(A,B,C) = M(0,3,5,6) = m(1,2,4,7)
Dr VP-WASE 12
Q. Consider the function
Example
f(A,B,C) = S m(0, 2, 5, 6).
a) Write this as a Boolean expression in canonical SOP form.
b) Rewrite the expression in canonical POS form.
Dr VP-WASE 13
Karnaugh Maps
Introduction
3-variable K-maps
4-variable K-maps
Simplification using K-maps
Converting to Minterms Form
Simplest SOP Expressions
Getting POS Expressions
Don’t-care Conditions
Review
Examples
Dr VP-WASE 14
Introduction
Systematic method to obtain simplified sum-of-products
(SOPs) Boolean expressions.
Objective: Fewest possible terms/literals.( Simplified
expression)
Diagrammatic technique based on a special form of Venn
diagram.
Advantage: Easy with visual aid.
Disadvantage: Limited to 5 or 6 variables.
Dr VP-WASE 15
3-variable K-maps
Dr VP-WASE 16
3-variable K-maps
1 m4 m5 m7 m6
Dr VP-WASE 17
Solve it yourself (Exercise 6.1)
1. The K-map of a 3-variable function F is shown below.
What is the sum-of-minterms expression of F?
b
bc
a 00 01 11 10
0 1 0 0 1
a 0 1 0 0
1
Dr VP-WASE 18
4-variable K-maps
y
yz
wx 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
x
m12 m13 m15 m14
11
w
m8 m9 m11 m10
10
z
Dr VP-WASE 19
4-variable K-maps
m4 m5 m7 m6
x
m12 m13 m15 m14
w
m8 m9 m11 m10
Dr VP-WASE 20
Simplification Using K-maps
Based on the Unifying Theorem:
A + A' = 1
In a K-map, each cell containing a ‘1’ corresponds to a
minterm of a given function F.
Each group of adjacent cells containing ‘1’ (group must
have size in powers of twos: 1, 2, 4, 8, …) then corresponds
to a simpler product term of F.
Grouping 2 adjacent squares eliminates 1 variable, grouping 4
squares eliminates 2 variables, grouping 8 squares eliminates 3
variables, and so on. In general, grouping 2n squares eliminates n
variables.
Dr VP-WASE 21
Simplification Using K-maps
Group as many squares as possible.
The larger the group is, the fewer the number of literals in the
resulting product term.
Dr VP-WASE 22
Simplification Using K-maps
Example:
F (w,x,y,z) = w'xy'z' + w'xy'z + wx'yz'
+ wx'yz + wxyz' + wxyz
= S m(4, 5, 10, 11, 14, 15)
y
yz
wx 00 01 11 10
00
01 1 1
x (cells with ‘0’ are not
11 1 1
w
shown for clarity)
1 1
10
z
Dr VP-WASE 23
Simplification Using K-maps
There are 2 groups of minterms: A and B, where:
A = w'xy'z' + w'xy'z
= w'xy'(z' + z)
= w'xy'
z
Dr VP-WASE 24
Simplification Using K-maps
Each product term of a group, w'xy' and wy, represents
the sum of minterms in that group.
Boolean function is therefore the sum of product terms
(SOP) which represent all groups of the minterms of the
function.
F(w,x,y,z) = A + B = w'xy' + wy
Dr VP-WASE 25
Simplification Using K-maps
Larger groups correspond to product terms of fewer literals. In
the case of a 4-variable K-map:
1 cell = 4 literals, e.g.: wxyz, w'xy'z
2 cells = 3 literals, e.g.: wxy, wy'z‘ & group of 2 cells is a
pair
4 cells = 2 literals, e.g.: wx, x'y group of 4 cells is a quad
8 cells = 1 literal, e.g.: w, y', z group of 8 cells is a octet
16 cells = no literal, e.g.: 1
Dr VP-WASE 26
Simplification Using K-maps
Other possible valid groupings of a 4-variable K-map
include:
1 1 1 1 1 1 1 1
1 1 1 1
1 1 1 1 1 1
1
P P P
Dr VP-WASE 27
Simplification Using K-maps
Groups of minterms must be
(1) rectangular, and
(2) have size in powers of 2’s.
Otherwise they are invalid groups. Some examples of
invalid groups:
1 1 1 1
1 1 1 1
1 1 1
1 1 1 1 1
O O
Dr VP-WASE 28
Converting to Minterms Form
The K-map of a function is easily drawn when the
function is given in canonical sum-of-products, or sum-
of-minterms form.
What if the function is not in sum-of-minterms?
Convert it to sum-of-products (SOP) form.
Expand the SOP expression into sum-of-minterms
expression, or fill in the K-map directly based on the SOP
expression.
Dr VP-WASE 29
Converting to Minterms Form
Example:
f(A,B,C,D) = A(C+D)'(B'+D') + C(B+C'+A'D)
= A(C'D')(B'+D') + BC + CC' + A'CD
= AB'C'D' + AC'D' + BC + A'CD
A
AB'C'D' + AC'D' + BC + A'CD AB
CD 00 01 11 10
= AB'C'D' + AC'D'(B+B') + BC + A'CD
00 1 1
= AB'C'D' + ABC'D' + AB'C'D' +
BC(A+A') + A'CD 01
D
= AB'C'D' + ABC'D' + ABC + A'BC + 11 1 1 1
A'CD C
10 1 1
= AB'C'D' + ABC'D' + ABC(D+D') +
A'BC(D+D') + A'CD(B+B') B
= AB'C'D' + ABC'D' + ABCD + ABCD' +
A'BCD + A'BCD' + A'B'CD
Dr VP-WASE 30
Simplest SOP Expressions
To find the simplest possible sum of products (SOP)
expression from a K-map, you need to obtain:
minimum number of literals per product term; and
minimum number of product terms
Dr VP-WASE 31
Simplest SOP Expressions
A prime implicant is a product term obtained by
combining the maximum possible number of minterms
from adjacent squares in the map.
Use bigger groupings (prime implicants) where possible.
1 1 1 1 1 1
1 1 1
O
1 1 1
P
Dr VP-WASE 32
Simplest SOP Expressions
No redundant groups:
1 1 1 1
1
1
1
1
O 1
1
1
1
P
1 1 1 1
Dr VP-WASE 33
Solve it yourself (Exercise 6.2)
Q. Identify the prime implicants and the essential prime
implicants of the two K-maps below.
b
A
bc
a AB
00 01 11 10 CD 00 01 11 10
0 1 1 0 1 00 1 1 1
a 0 1 0 0 01 1 1
1 D
11 1 1 1
c C
10 1 1 1
Dr VP-WASE 34
Simplest SOP Expressions
Algorithm 1 (non optimal):
1. Count the number of adjacencies for each minterm on the K-map.
2. Select an uncovered minterm with the fewest number of
adjacencies. Make an arbitrary choice if more than one choice is
possible.
3. Generate a prime implicant for this minterm and put it in the
cover. If this minterm is covered by more than one prime
implicant, select the one that covers the most uncovered
minterms.
4. Repeat steps 2 and 3 until all the minterms have been covered.
Dr VP-WASE 35
Simplest SOP Expressions
Algorithm 2 (non optimal):
1. Circle all prime implicants on the K-map.
2. Identify and select all essential prime implicants for the cover.
3. Select a minimum subset of the remaining prime implicants to
complete the cover, that is, to cover those minterms not covered
by the essential prime implicants.
Dr VP-WASE 36
Simplest SOP Expressions
Example:
f(A,B,C,D) = m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
00 1 1
All prime implicants
01 1 1
D
11 1 1 1
C
10 1 1
Dr VP-WASE 37
Simplest SOP Expressions
A
AB A
CD 00 01 11 10 AB
00 CD 00 01 11 10
1 1
01
1 1 00 1 1 Essential prime
D
C
11 1 1 1 01 1 1
implicants
10 1 1 D
11 1 1 1
B C
10 1 1
B
A
AB
CD 00 01 11 10
00 1 1 Minimum cover
01 1 1
D
11 1 1 1
C
10 1 1
Dr VP-WASE 38
Simplest SOP Expressions
A
AB
CD 00 01 11 10
A'BC'
00 1 1 AB'D'
01 1 1
D
11 1 1 1
C
10 1 1 BD
B
A'B'C
Dr VP-WASE 39
Getting POS Expressions
Simplified POS expression can be obtained by grouping
the maxterms (i.e. 0s) of given function.
Example:
Given F=m(0,1,2,3,5,7,8,9,10,11), we first draw
the K-map, then group the maxterms together:
A
AB
CD 00 01 11 10
00 1 0 0 1
01 1 1 0 1
D
11 1 1 0 1
C
10 1 0 0 1
Dr VP-WASE 40
Getting POS Expressions
A A
AB AB
CD 00 01 11 10 CD 00 01 11 10
K-map 00 1 0 0 1 00 0 1 1 0 K-map
of F 01 1 1 0 1 01 0 0 1 0 of F'
D D
11 1 1 0 1 11 0 0 1 0
C C
10 1 0 0 1 10 0 1 1 0
B B
Dr VP-WASE 41
Don’t-care Conditions
In certain problems, some outputs No.
0
A
0
B
0
C
0
D
0
P
1
are not specified. 1 0 0 0 1 0
2 0 0 1 0 0
These outputs can be either ‘1’ or 3
4
0
0
0
1
1
0
1
0
1
0
‘0’. 5 0 1 0 1 1
6 0 1 1 0 1
They are called don’t-care 7
8
0
1
1
0
1
0
1
0
0
0
conditions, denoted by X (or 9 1 0 0 1 1
sometimes, d). 10
11
1
1
0
0
1
1
0
1
X
X
Dr VP-WASE 42
Don’t-care Conditions
Don’t-care conditions can be used to help simplify
Boolean expression further in K-maps.
They could be chosen to be either ‘1’ or ‘0’, depending on
which gives the simpler expression.
Dr VP-WASE 43
Don’t-care Conditions
C
For comparison: AB
CD
00 01 11 10
WITHOUT Don’t-cares: 00
1 1
P = A'B'C'D’ + A'B'CD + A'BC'D 01
1 1
B
+ A'BCD' + AB'C'D 11
A
10 1
WITH Don’t-cares: C
CD
AB 00 01 11 10
P = A'B'C'D' + B'CD + BC'D
00 1 1
+ BCD' + AD
01
1 1
B
11 X X X X
A
10 1 X X
Dr VP-WASE 44
Review – The Techniques
Algebraic Simplification.
requires skill but extremely open-ended.
Karnaugh Maps.
can obtain simplified standard forms.
easy for humans (pattern-matching skills).
limited to not more than 6 variables.
Dr VP-WASE 45
Review – K-maps
Characteristics of K-map layouts:
(i) each minterm in one square/cell
(ii) adjacent/neighbouring minterms differ by only 1 literal
(iii) n-literal minterm has n neighbours/adjacent cells
a'b' a'b m0 m1
OR
a ab' ab a m2 m3
Dr VP-WASE 46
Review – K-maps
b b
bc bc
a 00 01 11 10 a 00 01 11 10
0 a'b'c' a'b'c a'bc a'bc' 0 m0 m1 m3 m2
c c
y
yz
wx 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
x
11 m12 m13 m15 m14
w
10 m8 m9 m11 m10
Dr VP-WASE 47
Review – K-maps
Groupings to select product-terms must be:
(i) rectangular in shape
(ii) in powers of twos (1, 2, 4, 8, etc.)
(iii) always select largest possible groupings of minterms
(i.e. prime implicants)
(iv) eliminate redundant groupings
Dr VP-WASE 48
Review – K-maps
Product-of-sums (POS) form obtained by selecting
groupings of maxterms (corresponding to sum terms) and
by applying DeMorgan’s theorem.
Don’t cares, marked by X (or d), can denote either 1 or 0.
They could therefore be selected as 1 or 0 to further
simplify expressions.
Dr VP-WASE 49
Examples
Example #1:
f(A,B,C,D) = m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
00 1 1
Fill in the 1’s.
01 1 1
D
11 1 1 1
C
10 1 1
Dr VP-WASE 50
Examples
Example #1:
f(A,B,C,D) = m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
These are all the
00 1 1 prime implicants; but
01 1 1 do we need them
D
1 1
all?
11 1
C
10 1 1
Dr VP-WASE 51
Examples
Example #1:
f(A,B,C,D) = m(2,3,4,5,7,8,10,13,15)
A
AB
CD 00 01 11 10
00 1 1
Essential prime implicants:
01 1 1
D
11 1 1 1
B.D
C
10 1 1 A'.B.C'
B A.B'.D'
Dr VP-WASE 52
Examples
A
AB A
CD 00 01 11 10 AB
00 CD 00 01 11 10
1 1
01
1 1 00 1 1 Essential prime
D
C
11 1 1 1 01 1 1
implicants
10 1 1 D
11 1 1 1
B C
10 1 1
SUMMARY
A B
AB
CD 00 01 11 10
00 1 1
Minimum cover
01 1 1
D
11 1 1 1
C
10 1 1
f(A,B,C,D) = BD + A'B'C + AB'D' + A'B.C'
B
Dr VP-WASE 53
Examples
Example #2:
f(A,B,C,D) = A.B.C + B'.C.D' + A.D + B'.C'.D'
A
AB
CD 00 01 11 10
00 1 1
Fill in the 1’s.
01 1 1
D
11 1 1
C
10 1 1 1
Dr VP-WASE 54
Examples
Example #2:
f(A,B,C,D) = A.B.C + B'.C.D' + A.D + B'.C'.D'
A
AB
CD 00 01 11 10
00 1 1
Find all PIs:
01 1 1
D
11 1 1 A.D
C
10 1 1 1 A.C
B B'.D'
Are all ‘1’s covered by the PIs? Yes, so the answer is: f(A,B,C,D) =
A.D + A.C + B'.D'
Dr VP-WASE 55
Examples
Example #3 (with don’t cares):
f(A,B,C,D) = m(2,8,10,15) + d(0,1,3,7)
A
AB
CD 00 01 11 10
00 X 1
Fill in the 1’s and X’s.
01 X
D
11 X X 1
C
10 1 1
Dr VP-WASE 56
Examples
Example #3 (with don’t cares):
f(A,B,C,D) = m(2,8,10,15) + d(0,1,3,7)
A
AB
CD 00 01 11 10 Do we need to have an
00 X 1 additional term A'.B' to
01 X cover the 2 remaining x’s?
D
11 X X 1 No, because all the 1’s
C
1 1 (minterms) have been
10
covered.
B
Dr VP-WASE 57
Examples
To find simplest POS expression for example #2:
f(A,B,C,D) = A.B.C + B'.C.D' + A.D + B'.C'.D'
Draw the K-map of the complement of f, f '.
A From K-map,
AB
CD 00 01 11 10
f ' = A'.B + A'.D + B.C'.D'
00 1 1
Using DeMorgan’s theorem,
01 1 1
D
11 1 1 f = (A'.B + A'.D + B.C'.D')'
C
10 1 = (A+B').(A+D').(B'+C+D)
B
Dr VP-WASE 58
Examples
• To find simplest POS expression for example #3:
f(A,B,C,D) = m(2,8,10,15) + d(0,1,3,7)
• Draw the K-map of the complement of f, f '.
f '(A,B,C,D) = m(4,5,6,9,11,12,13,14) + d(0,1,3,7)
A
AB
CD 00 01 11 10
From K-map,
00 X 1 1 f ' = B.C' + B.D' + B'.D
01 X 1 1 1 Using DeMorgan’s theorem,
D
11 X X 1
C f = (B.C' + B.D' + B'.D)'
10 1 1
= (B'+C).(B'+D).(B+D')
B
Dr VP-WASE 59
Example:
Dr VP-WASE 60
Dr VP-WASE 61
EX: Express the following function as a sum of min terms and as a product of max
terms:
F(A,B.C. D) =B'D + A'D + BD
Dr VP-WASE 62