Professional Documents
Culture Documents
Aziz Qaroush
Presentation Outline
Boolean Function Minimization
Don't Cares
Multiple Outputs
Boolean Function Minimization
Complexity of a Boolean function is directly related to the
complexity of the algebraic expression
1 m2 m3 1 x y' xy
Copy the function values from the truth table into the K-map
Make sure to copy each value into the proper K-map square
K-map
𝑓 = 𝑚0 + 𝑚2 + 𝑚3
y 0 1
x
𝑓 = 𝑥′𝑦′ + 𝑥𝑦′ + 𝑥𝑦 (6 literals)
0 1 0
𝑚2 + 𝑚3 = 𝑥𝑦′ + 𝑥𝑦 = 𝑥(𝑦′ + 𝑦) = 𝑥
x y F Minterm m0 m1
0 0 0 0 m0 xy
m2 m3
1 0 1 1 m1 xy
2 1 0 1 m2 x y
3 1 1 1 m3 xy y
y
x 0 1
y
0 xy xy
x 0 1 F xy xy xy
0 1 xy xy
( x x) y x ( y y)
1
1 1 1 F yx
Three-Variable Karnaugh Map
Have eight squares (for the 8 minterms), numbered 0 to 7
The last two columns are not in numeric order: 11, 10
Remember the numbering of the squares in the K-map
Each square is adjacent to three other squares
Minterms in adjacent squares can always be combined
This is the key idea that makes the K-map work
Labeling of rows and columns is also useful
𝑦𝑧 𝑦𝑧 𝒚′ 𝒚
𝑥
00 01 11 10 𝑥 00 01 11 10
0 𝑚0 𝑚1 𝑚3 𝑚2 𝒙′ 0 𝑥 ′𝑦 ′𝑧′ 𝑥 ′𝑦 ′𝑧 𝑥 ′𝑦𝑧 𝑥 ′𝑦𝑧′
𝒛′ 𝒛 𝒛′
Three-variable Map Minimization – Example 1
Simplify the Boolean function: 𝑓(𝑥, 𝑦, 𝑧) = (3, 4, 5, 7)
𝒛′ 𝒛 𝒛′
Therefore, 𝑓 = 𝑥𝑦′ + 𝑦𝑧 (4 literals)
Three-variable Map Minimization – Example 2
Here is a second example: 𝑓(𝑥, 𝑦, 𝑧) = (3, 4, 6, 7)
𝒛′ 𝒛 𝒛′
Therefore, 𝑓 = 𝑥𝑧 ′ + 𝑦𝑧 (4 literals)
Combining Squares on a 3-Variable K-Map
By combining squares, we reduce number of literals
in a product term, thereby reducing the cost
On a 3-variable K-Map:
Solution: 𝑦𝑧 𝒚′ 𝒚
𝑥 00 01 11 10
Red block: term = 𝑧′ 𝒙′ 0 1 1 0 1
xyz z
7 1 1 1 0 m7
F z xy
Three-variable Map Minimization – Example 10
Let the Boolean Function
00 01 11 10
1
Four-Variable Karnaugh Map
4 variables 16 squares
Notice the order of Rows 11 and 10
Remember the numbering of and the order of columns 11 and 10
the squares in the K-map
𝑦𝑧 𝒚′ 𝒚
Each square is adjacent to 𝑤𝑥 00 01 11 10
four other squares 00 𝑚0 𝑚1 𝑚3 𝑚2 𝒙′
′ ′ ′ ′ ′ ′ ′
𝒘′
𝑚00 = 𝑤 𝑥 𝑦 𝑧 𝑚10 = 𝑤 𝑥 𝑦 𝑧
𝑚20 = 𝑤 ′ 𝑥 ′ 𝑦 𝑧 ′ 𝑚30 = 𝑤 ′ 𝑥 ′ 𝑦 𝑧
01 𝑚4 𝑚5 𝑚7 𝑚6
𝑚40 = 𝑤 ′ 𝑥 𝑦′𝑧 ′ 𝑚50 = 𝑤 ′ 𝑥 𝑦′𝑧 𝒙
𝑚60 = 𝑤 ′ 𝑥 𝑦 𝑧 ′ 𝑚70 = 𝑤 ′ 𝑥 𝑦 𝑧 11 𝑚12 𝑚13 𝑚15 𝑚14
𝑚80 = 𝑤 𝑥 ′ 𝑦 ′ 𝑧 ′ 𝑚90 = 𝑤 𝑥 ′ 𝑦 ′ 𝑧 𝒘
𝑚10 = 𝑤 𝑥 ′ 𝑦𝑧 ′ 𝑚11 = 𝑤 𝑥 ′ 𝑦 𝑧 10 𝑚8 𝑚9 𝑚11 𝑚10 𝒙′
𝑚12 = 𝑤 𝑥 𝑦′𝑧 ′ 𝑚13 = 𝑤 𝑥 𝑦′𝑧
𝑚14 = 𝑤 𝑥 𝑦 𝑧 ′ 𝑚15 = 𝑤 𝑥 𝑦 𝑧 𝒛′ 𝒛 𝒛′
Combining Squares on a 4-Variable K-Map
On a 4-variable K-Map:
𝑦𝑧 𝒚′ 𝒚 Term = 𝑦
𝑤𝑥 00 01 11 10
Term = 𝑤′ 00 𝑚0 𝑚1 𝑚3 𝑚2 𝒙′
𝒘′
01 𝑚4 𝑚5 𝑚7 𝑚6
𝒙
11 𝑚12 𝑚13 𝑚15 𝑚14
𝒘
10 𝑚8 𝑚9 𝑚11 𝑚10 𝒙′
𝒛′ 𝒛 𝒛′
Term = 𝑧′
Combining Four Squares
𝑦𝑧 𝒚′ 𝒚
𝑤𝑥 00 01 11 10
00 𝑚0 𝑚1 𝑚3 𝑚2 𝒙′
𝒘′
Term = 𝑥𝑦′ 01 𝑚4 𝑚5 𝑚7 𝑚6
𝒙
11 𝑚12 𝑚13 𝑚15 𝑚14 Term = 𝑤𝑦
𝒘
10 𝑚8 𝑚9 𝑚11 𝑚10 𝒙′
𝒛′ 𝒛 𝒛′
Term = 𝑥 ′ 𝑧′
Combining Two Squares
𝑦𝑧 𝒚′ 𝒚 Term = 𝑤′𝑦𝑧
𝑤𝑥 00 01 11 10
00 𝑚0 𝑚1 𝑚3 𝑚2 𝒙′
𝒘′
Term = 𝑤 ′ 𝑥𝑦′ 01 𝑚4 𝑚5 𝑚7 𝑚6
𝒙
11 𝑚12 𝑚13 𝑚15 𝑚14
𝒘
10 𝑚8 𝑚9 𝑚11 𝑚10 𝒙′
𝒛′ 𝒛 𝒛′
Term = 𝑤𝑥 ′𝑧′
Term = 𝑤𝑦 ′𝑧
Four-variable Map Minimization – Example 1
Given 𝑓(𝑤, 𝑥, 𝑦, 𝑧) = (0, 2, 4, 5, 6, 7, 8, 12)
Minimize 𝑓 as sum-of-products 𝑦𝑧 𝒚′ 𝒚
𝑤𝑥 00 01 11 10
Solution:
00 1 0 0 1 𝒙′
𝑓 = 𝑤′𝑥 + 𝑦′𝑧′ + 𝑤′𝑧′ 𝒘′
01 1 1 1 1
𝒙
Term = 𝑤 ′ 𝑥
11 1 0 0 0
𝒘
Term = 𝑦 ′ 𝑧′ 10 1 0 0 0 𝒙′
𝒛′ 𝒛 𝒛′
Four-variable Map Minimization – Example 2
yz
wx 00 01 11 10
w x y z F Minterm
m0 wxy z
00 w xyz w x yz w x yz w x yz
0 0 0 0 0 1
1 0 0 0 1 1 m1 wxy z 01 w xyz w xyz w xyz w xyz
2 0 0 1 0 1 m2 wxyz
11 wxyz wxyz wxyz wxyz
3 0 0 1 1 0 m3 wxyz
4 0 1 0 0 1 m4 wxy z 10 wx yz wx y z wxyz wx yz
5 0 1 0 1 1 m5 wxyz
6 0 1 1 0 1 m6 wxyz
y
7 0 1 1 1 0 m7 wxyz 1 1 0 1
8 1 0 0 0 1 m8 wxyz
9 1 0 0 1 1 m9 wxyz
1 1 0 1
x
10 1 0 1 0 0 m10 wxyz 1 1 0 1
11 1 0 1 1 0 m11 wxyz w
1 1 0 0
12 1 1 0 0 1 m12 wxyz
13 1 1 0 1 1 m13 wxy z z
14
15
1
1
1
1
1
1
0
1
1
0
m14
m15
wxyz
wxyz F y wz xz
Four-variable Map Minimization – Example 3
Example
Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’
C
1 1 1
1
B
A
1 1 1
D
F BDBC ACD
Next . . .
Boolean Function Minimization
Don't Cares
Multiple Outputs
Prime Implicants
Prime Implicant: a product term obtained by combining the
maximum number of adjacent squares in the K-map
K-Map
𝑐𝑑
𝑎𝑏 00 01 11 10 Six Prime Implicants
′
𝑏′𝑑′ 00 1 1 1 𝑏𝑐
𝑏𝑑, 𝑏′𝑑′, 𝑎𝑏′, 𝑎𝑑, 𝑐𝑑, 𝑏′𝑐
01
𝑏𝑑 1 1 𝑐𝑑
11 1 1
Only Two Prime
10 1 1 1 1
Implicants are essential
𝑎𝑏′
𝑎𝑑 𝑏𝑑 and 𝑏′ 𝑑′
Prime Implicant – Example 2
Find all prime implicants for
F(A, B, C, D) = ∑ (0,2,3,8,9,10,11,12,13,14,15)
BD
C
3 prime implicants: 0 1 3 2
1 1 1 BC
A, B C, B D 4 5 7 6
All 3 prime 12 13 15 14 B
1 1 1 1
implicants are A
8 9 11 10
essential A 1 1 1 1
D
Simplification Procedure Using the K-Map
1. Find all the essential prime implicants
Covering maximum number (power of 2) of 1's in the K-map
Make sure to cover all 1's not covered by the essential prime implicants
10 1 1 1 10 1
𝑓 = 𝑎𝑑 + 𝑎𝑐 + 𝑏′𝑑 + 𝑏′𝑐 𝑓 ′ = 𝑐 ′𝑑 ′ + 𝑎 ′𝑏
Minimal Sum-of-Products = 8 literals 𝑓 = (𝑐 + 𝑑)(𝑎 + 𝑏′ )
Product-of-Sums Simplification Procedure
1. Draw the K-map for the function 𝑓
2. Draw the K-map for 𝑓′, replacing the 0's of 𝑓 with 1's in 𝑓′
Don't Cares
Multiple Outputs
Don't Cares
Sometimes, a function table may contain entries for which:
Make sure to cover all 1's not covered by the essential prime implicants
You need not cover all the don't cares (some can remain uncovered)
𝑔 = 𝑑(𝑎 ′ + 𝑐) (3 literals) 00 X 0 0 X
01 1 X 0 1
The minimal sum-of-products 11 1 1 0 1
expression for 𝑔 had 4 literals 10 1 1 0 1
Next . . .
Boolean Function Minimization
Don't Cares
Multiple Outputs
Five-Variable Karnaugh Map
Consists of 25 = 32 squares, numbered 0 to 31
Remember the numbering of squares in the K-map
00 1 1 00 1 1
𝑐′𝑑′
01 01 1 1 𝑎𝑏 ′ 𝑐𝑑
11 11
10 1 1 10 1 1
Five-Variable K-Map – Example 3
𝑔(𝑎, 𝑏, 𝑐, 𝑑, 𝑒) = 𝑚(3, 6, 7, 11, 24, 25, 27, 28, 29) + 𝑑 (2, 8, 9, 12, 13, 26)
Draw the 5-Variable K-Map
Obtain a minimal Sum-of-Products expression for 𝑔
Solution: 𝑔 = 𝑏𝑑 ′ + 𝑎 ′𝑏′ 𝑑 + 𝑏𝑐 ′𝑒 (8 literals)
5-Variable K-Map
𝑎=0 𝑎=1
𝑑𝑒 𝑑𝑒
00 01 11 10 00 01 11 10 All prime
𝑏𝑐 𝑏𝑐
implicants
00 1 X 00
𝑎′𝑏′𝑑 are essential
01 1 1 01
𝑏𝑑′
11 X X 11 1 1 𝑏𝑐′ 𝑒
10 X X 1 10 1 1 1 X Not covered
Six-Variable Karnaugh Map
Consists of 26 = 64 squares, numbered 0 to 63
Can be visualized as four layers of 16 squares each
Four layers: 𝑎𝑏 = 00, 01, 11, 10 (Notice that layer 11 comes before 10)
00 𝑚0 𝑚1 𝑚3 𝑚2 𝑚16 𝑚17 𝑚19 𝑚18 𝑚48 𝑚49 𝑚51 𝑚50 𝑚32 𝑚33 𝑚35 𝑚34
01 𝑚4 𝑚5 𝑚7 𝑚6 𝑚20 𝑚21 𝑚23 𝑚22 𝑚52 𝑚53 𝑚55 𝑚54 𝑚36 𝑚37 𝑚39 𝑚38
11 𝑚12 𝑚13 𝑚15 𝑚14 𝑚28 𝑚29 𝑚31 𝑚30 𝑚60 𝑚61 𝑚63 𝑚62 𝑚44 𝑚45 𝑚47 𝑚46
10 𝑚8 𝑚9 𝑚11 𝑚10 𝑚24 𝑚25 𝑚27 𝑚26 𝑚56 𝑚57 𝑚59 𝑚58 𝑚40 𝑚41 𝑚43 𝑚42
6- Variable K-Maps – Example 1
CD
CD EF 00 01 11 10
EF 00 01 11 10 00 1
AB=00
00
AB=00 0 4 12 8 01
01 11
1 5 13 9
11
3 7 15 11 10 1 1
10 2 6 14 10
CD
CD EF 00 01 11 10
EF 00 01 11 10 AB=01 00 1
AB =01 00 16 20 28 24 01
01 11
17 21 29 25
11
ƒ(A,B,C,D,E,F) =
19 23 31 27 10 1 1
10
18 22 30 26
m(2,8,10,18,24, EF
CD
00 01 11 10
EF
CD
00 01 11 10
26,34,37,42,45,50, 00
AB=11
AB =11
00 53,58,61)
48 52 60 56 01 1 1
01
49 53 61 57 = 11
11 10
51 55 63 59 1 1
10
50 54 62 58
CD
CD EF 00 01 11 10
EF 00 01 11 10 00
AB=10
00
AB =10 32 36 44 40 01 1 1
01 33 37 45 41 11
11 10
35 39 47 43 1 1
10 34 38 46 42
6- Variable K-Maps – Example 1
CD
CD EF 00 01 11 10
EF 00 01 11 10 00 1
AB=00
00
AB=00 0 4 12 8 01
01 11
1 5 13 9
11
3 7 15 11 10 1 1
10 2 6 14 10
CD
CD EF 00 01 11 10
EF 00 01 11 10 AB=01 00 1
AB =01 00 16 20 28 24 01
01 11
17 21 29 25
11
ƒ(A,B,C,D,E,F) =
19 23 31 27 10 1 1
10
18 22 30 26
m(2,8,10,18,24, EF
CD
00 01 11 10
EF
CD
00 01 11 10
26,34,37,42,45,50, 00
AB=11
AB =11
00 53,58,61)
48 52 60 56 01 1 1
01
49 53 61 57 = D' E F' + A D E' F 11
11
51 55 63 59 + A' C D' F' 10 1 1
10
50 54 62 58
CD
CD EF 00 01 11 10
EF 00 01 11 10 00
AB=10
00
AB =10 32 36 44 40 01 1 1
01 33 37 45 41 11
11 10
35 39 47 43 1 1
10 34 38 46 42
6 Variable K-Maps – Example 2
ℎ(𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓) = (2, 10, 11, 18, 21, 23, 29, 31, 34, 41, 50, 53, 55, 61, 63)
Draw the 6-Variable K-Map
Obtain a minimal Sum-of-Products expression for ℎ
Solution: ℎ = 𝑐 ′𝑑 ′𝑒𝑓 ′ + 𝑏 𝑑 𝑓 + 𝑎 ′ 𝑏′ 𝑐 𝑑 ′𝑒 + 𝑎 𝑏 𝑐 𝑑 ′ 𝑒 ′𝑓 (18 literals)
𝑎𝑏 = 00 𝑎𝑏 = 01 𝑎𝑏 = 11 𝑎𝑏 = 10
𝑒𝑓
𝑐𝑑 00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
00 𝑐′𝑑′𝑒𝑓′ 1 1 1 1
01 𝑏𝑑𝑓 1 1 1 1
11 1 1 1 1
10 1 1 𝑎′𝑏 ′𝑐 𝑑 ′𝑒 𝑎 𝑏 𝑐 𝑑 ′𝑒 ′𝑓 1
Next . . .
Boolean Function Minimization
Don't Cares
Multiple Outputs
Multiple Outputs
Suppose we have two functions: 𝑓(𝑎, 𝑏, 𝑐) and 𝑔(𝑎, 𝑏, 𝑐)
Same inputs: 𝑎, 𝑏, 𝑐, but two outputs: 𝑓 and 𝑔
We can minimize each function separately, or
Minimize 𝑓 and 𝑔 as one circuit with two outputs
The idea is to share terms (gates) among 𝑓 and 𝑔
𝑎
𝑏 𝑓
𝑐 𝑎 𝑓
𝑏
𝑎 𝑐 𝑔
𝑏 𝑔
𝑐 One circuit with
Two separate circuits Two Outputs
Multiple Outputs: Example 1
Given: 𝑓 𝑎, 𝑏, 𝑐 = (0, 2, 6, 7) and 𝑔 𝑎, 𝑏, 𝑐 = (1, 3, 6, 7)
Minimize each function separately 𝑎′
𝑐′
Minimize both functions as one circuit 𝑓
per function
𝑎
One circuit
𝑏
K-Map of 𝒇
𝑏𝑐 𝑎′
𝑎 00 01 11 10
𝑐
0 1 0 0 1 𝑔
𝑎
𝑓 = 𝑎′𝑐′ + 𝑎𝑏 𝑏
1 0 0 1 1
𝑎′
two Outputs
𝑏𝑐 𝑐′
Term = 𝑎𝑏 𝑓
𝑎 00 01 11 10 𝑎
𝑏
0 0 1 1 0 𝑔
𝑔 = 𝑎′𝑐 + 𝑎𝑏 𝑎′
1 0 0 1 1 𝑐
Multiple Outputs: Example 2
𝑓 𝑎, 𝑏, 𝑐, 𝑑 = (3, 5, 7, 10, 11, 14, 15), 𝑔 𝑎, 𝑏, 𝑐, 𝑑 = (1, 3, 5, 7, 10, 14)
Draw the K-map and write minimal SOP expressions of 𝑓 and 𝑔
𝑓 = 𝑎′𝑏𝑑 + 𝑎𝑐 + 𝑐𝑑 𝑔 = 𝑎′𝑑 + 𝑎𝑐𝑑′
Extract the common terms of 𝑓 and 𝑔
K-Map of 𝒇 K-Map of 𝒈
𝑐𝑑 𝑐𝑑 Common Terms
𝑎𝑏 00 01 11 10 𝑎𝑏 00 01 11 10
𝑇1 = 𝑎′𝑑 and 𝑇2 = 𝑎𝑐
00 1 00 1 1
01 1 1 01 1 1
Minimal 𝑓 and 𝑔
11 1 1 11 1 𝑓 = 𝑇1𝑏 + 𝑇2 + 𝑐𝑑
10 1 1 10 1 𝑔 = 𝑇1 + 𝑇2𝑑′
Common Terms Shared Gates
Minimal 𝑓 = 𝑎′𝑏𝑑 + 𝑎𝑐 + 𝑐𝑑 Minimal 𝑔 = 𝑎′𝑑 + 𝑎𝑐𝑑′
Let 𝑇1 = 𝑎′𝑑 and 𝑇2 = 𝑎𝑐 (shared by 𝑓 and 𝑔)
Minimal 𝑓 = 𝑇1𝑏 + 𝑇2 + 𝑐𝑑, Minimal 𝑔 = 𝑇1 + 𝑇2𝑑′
𝑐
𝑑 𝑐
𝑎′ 𝑑
𝑏 𝑓
𝑑 𝑏
𝑎 𝑎′ 𝑓
𝑐 𝑑
𝑎′ 𝑎
𝑑 𝑐 𝑔
𝑎 𝑔 𝑑′
𝑐
𝑑′ One Circuit
NO Shared Gates Two Shared Gates
Quine-McCluskey Method
The Karnaugh map method described in Unit 5 is an effective
way to simplify switching functions which have a small
number of variables
A systematic solution to K-Map when more complex function
with more literals is given
In principle, can be applied to an arbitrary large number of
inputs
One can translate Quine-McCluskey method into a computer
program to perform minimization
Quine-McCluskey Method
F(A, B, C, D, E) (0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
A B C D E
(6,7) 0 0 1 1 -
(10,11) 0 1 0 1 -
(12,13) 0 1 1 0 -
(18,19) 1 0 0 1 -
(13,29) - 1 1 0 1
(14,30) - 1 1 1 0
(0,2,16,18) - 0 0 – 0
(0,2,4,6 0 - - - 0
8,10,12,14)
A B C D E
(6,7) 0 0 1 1 - ABCD
(10,11) 0 1 0 1 - ABCD
(12,13) 0 1 1 0 - ABCD
(18,19) 1 0 0 1 - ABCD
(13,29) - 1 1 0 1 BCDE
(14,30) - 1 1 1 0 BCDE
(0,2,16,18) - 0 0 – 0 BCE
(0,2,4,6 0 - - - 0 AE
8,10,12,14)
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
Q-M Method (IV)
Locate the essential row from the table
These are essential prime implicants
The row consists of minterms covered by a single “”
Mark all minterms covered by the essential prime implicants
Find non-essential prime implicants to cover the rest of
minterms
Form the SOP function with the prime implicants selected,
which is the minimal representation
Q-M Method
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
Q-M Method
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
• Select (0,2,4,6,8,10,12,14)
Q-M Method
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
• Select (0,2,4,6,8,10,12,14)
Q-M Method
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
0 2 4 6 7 8 10 11 12 13 14 16 18 19 29 30
(6,7) X X
(10,11) X X
(12,13) X X
(18,19) X X
(13,29) X X
(14,30) X X
(0,2,16,18) X X X X
(0,2,4,6,8,10,12,14) X X X X X X X X
F(A, B, C, D, E) m(0, 2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 16, 18, 19, 29, 30)
(6,7) (10,11) (18,19) (13,29) (14,30) (0,2,16,18 )
(0,2,4,6,8 ,10,12,14)
A BCD ABCD A BCD BC DE BCD E BCE A E
Q-M Method Example 2
Quine-McCluskey 11 1 0 0 X
1 1 0 1
method can guarantee 10
an optimal answer
Grouping minterms
F m(0, 1, 4, 6, 8, 9, 10, 12) d(5,7,14)
A B C D A B C D
(0,1) 0 0 0 - (0,1,4,5) 0 - 0 -
A B C D (0,4) 0 - 0 0 (0,1,8,9) - 0 0 –
(0) 0 0 0 0 (0,8) - 0 0 0 (0,4,8,12) - - 0 0
(1) 0 0 0 1
(1,5) 0 - 0 1 (4,5,6,7) 0 1 - -
(4) 0 1 0 0 (1,9) - 0 0 1 (4,6,12,14) - 1 - 0
(8) 1 0 0 0 (4,5) 0 1 0 – (8,10,12,14) 1 - - 0
(5) 0 1 0 1 (4,6) 0 1 – 0
(6) 0 1 1 0 (4,12) – 1 0 0
(9) 1 0 0 1 (8,9) 1 0 0 –
(10) 1 0 1 0 (8,10) 1 0 – 0
(12) 1 1 0 0 (8,12) 1 – 0 0
(7) 0 1 1 1 (5,7) 0 1 - 1
(14) 1 1 1 0 (6,7) 0 1 1 -
(6,14) - 1 1 0
(10,14) 1 – 1 0
(12,14) 1 1 - 0
Prime Implicants
A B C D
(0,1,4,5) 0 - 0 - F m(0, 1, 4, 6, 8, 9, 10, 12) d(5,7,14)
(0,1,8,9) - 0 0 –
(0,4,8,12) - - 0 0 BC AD AB
(4,5,6,7) 0 1 - -
(4,6,12,14) - 1 - 0
(8,10,12,14) 1 - - 0 Don’t Care
0 1 4 6 8 9 10 12 5 7 14
(0,1,4,5) X X X X
(0,1,8,9) X X X X
(0,4,8,12) X X X X
(4,5,6,7) X X X X
(4,6,12,14) X X X X
(8,10,12,14) X X X X
Yet Another Q-M Method Solution
A B C D
(0,1,4,5) 0 - 0 - F m(0, 1, 4, 6, 8, 9, 10, 12) d(5,7,14)
(0,1,8,9) - 0 0 –
(0,4,8,12) - - 0 0 BC AD BD
(4,5,6,7) 0 1 - -
(4,6,12,14) - 1 - 0
(8,10,12,14) 1 - - 0
Don’t Care
0 1 4 6 8 9 10 12 5 7 14
(0,1,4,5) X X X X
(0,1,8,9) X X X X
(0,4,8,12) X X X X
(4,5,6,7) X X X X
(4,6,12,14) X X X X
(8,10,12,14) X X X X
To Get the Same Answer w/ K-Map
CD CD
AB 00 01 11 10 00 01 11 10
AB
00 1 1 0 0 1 1 0 0
00
01 1 X X 1 1 X X 1
01
11 1 0 0 X 1 0 0 X
11
10 1 1 0 1 1 1 0 1
10
BC AD AB BC AD BD
Universal Gates
NAND and NOR gates are said to be universal gate because any
logic circuit can be implemented with it.
Digital circuits are frequently constructed with NAND or NOR gates rather
than with AND and OR gates.
NAND and NOR gates are easier to fabricate with electronic
components and are the basic gates used in all IC digital logic
families.
Because of the prominence of NAND and NOR gates in the
design of digital circuits, rules and procedures have been
developed for the conversion from Boolean functions given in
terms of AND, OR, and NOT into equivalent NAND and NOR
logic diagrams
Universal Gates
NAND Gate
NOT: A F=A
A
AND: B F=A•B
OR: DeMorgan’s
A
F=A+B
B
NAND Gate Symbol
Two equivalent graphic symbols for the NAND gate
The AND-invert symbol has been defined previously and
consists of an AND graphic symbol followed by a small
circle negation indicator referred to as a bubble.
Alternatively, it is possible to represent a NAND gate by an
OR graphic symbol that is preceded by a bubble in each
input.
Two-Level NAND Implementation
A convenient way to implement a Boolean function with
NAND gates is to obtain the simplified Boolean function in
terms of Boolean operators and then convert the function to
NAND logic.
The implementation of Boolean functions with NAND gates
requires that the functions be in sum-of-products form.
Procedure:
Draw a NAND gate for each product term of the expression that has at
least two literals. The inputs to each NAND gate are the literals of the
term. This procedure produces a group of first-level gates.
Draw a single gate using the AND-invert or the invert-OR graphic symbol
in the second level, with inputs coming from outputs of first-level gates.
A term with a single literal requires an inverter in the first level. However, if
the single literal is complemented, it can be connected directly to an input
of the second level NAND gate.
Two-Level NAND Implementation
Boolean function with NAND gates
Implement the following Boolean function with NAND gates:
F (x, y, z) = (1, 2, 3, 4, 5, 7)
Multilevel NAND Implementation
General Procedure for converting a multilevel AND–
OR diagram into an all-NAND diagram using mixed
notation is as follows:
Convert all AND gates to NAND gates with AND-invert
graphic symbols.
Convert all OR gates to NAND gates with invert-OR
graphic symbols.
Check all the bubbles in the diagram. For every bubble
that is not compensated by another small circle along the
same line, insert an inverter (a one-input NAND gate) or
complement the input literal.
Multilevel NAND Implementation
Multilevel NAND Implementation
NOR Gates
The NOR operation is the dual of the NAND operation. Therefore, all
procedures and rules for NOR logic are the duals of the corresponding
procedures and rules developed for NAND logic.
NOT: A F=A
OR: A F=A+B
B
AND:
DeMorgan’s
A
F=A•B
B
NOR Gate Symbol
The two graphic symbols for the mixed notation.
The OR-invert symbol defines the NOR operation as an
OR followed by a complement.
The invert-AND symbol complements each input and then
performs an AND operation.
Two-Level NOR Implementation
Rules for 2-Level NOR Implementations
Simplify the function and express it in product of sums form
Draw a NOR gate (using OR-NOT symbol) for each sum term (with 2
literals or more)
Draw a single NOR gate (using NOT-AND symbol) the 2nd level (in
place of the AND gate)
A term with single literal requires a NOT
Two-Level NOR Implementation
Rules for Multi-Level NOR Implementations
NOTE: the function is NOT in the standard form – WHY?
Steps:
Draw a NOR (OR-NOT) gate for each OR gate
Draw a NOR (NOT-AND) gate for each AND gate
Check paths – add inverters to make even number of bubbles
Multilevel NOR Implementation
Multilevel NOR Implementation
OTHER TWO-LEVEL IMPLEMENTATIONS
Note: any two forms listed on the same line are duals of each other.
OTHER TWO-LEVEL IMPLEMENTATIONS
OR–AND–INVERT: Product-of-
sums form by combining 1’s in the
map and then complementing.
Exclusive OR / Exclusive NOR
Exclusive OR (XOR) is an important Boolean operation used
extensively in logic circuits
x y XOR x y XNOR
0 0 0 0 0 1
0 1 1 0 1 0 XNOR is also known
1 0 1 1 0 0 as equivalence
1 1 0 1 1 1
𝑥 𝑥
𝑥⨁𝑦 (𝑥 ⨁ 𝑦)′
𝑦 𝑦
XOR gate XNOR gate
XOR / XNOR Functions
The XOR function is: 𝑥 ⨁ 𝑦 = 𝑥𝑦′ + 𝑥′𝑦
The XNOR function is: (𝑥 ⨁ 𝑦)′ = 𝑥𝑦 + 𝑥′𝑦′
XOR and XNOR gates are complex
Can be implemented as a true gate, or by
Interconnecting other gate types
XOR and XNOR gates do not exist for more than two inputs
For 3 inputs, use two XOR gates
The cost of a 3-input XOR gate is greater than the cost of two XOR gates
NAND only
implementation
for XOR:
XOR and XNOR Properties
𝑥⨁0= 𝑥 𝑥 ⨁ 1 = 𝑥′
𝑥⨁𝑥=0 𝑥 ⨁ 𝑥′ = 1
𝑥⨁𝑦 =𝑦⨁𝑥
𝑥′ ⨁ 𝑦′ = 𝑥 ⨁ 𝑦
′
𝑥⨁𝑦 = 𝑥 ′ ⨁ 𝑦 = 𝑥 ⨁ 𝑦′
′ ′ ′
𝑥⨁𝑦 ⨁𝑧 = 𝑥 ⨁ (𝑦 ⨁ 𝑧)′ =𝑥⨁𝑦⨁𝑧
Odd Function
Output is 1 if the number of 1's is odd in the inputs
Output is the XOR operation on all input variables