Techniques for Techniques for Combinational Logic Combinational Logic Optimization Optimization
Mar 26, 2015
Techniques for Combinational Techniques for Combinational Logic OptimizationLogic Optimization
Minimizing CircuitsMinimizing Circuits
Karnaugh Maps
Goals of Circuit MinimizationGoals of Circuit Minimization
(1) Minimize the number of primitive Boolean logic gates needed to implement the circuit.Ultimately, this also roughly minimizes the number of transistors, the
chip area, and the cost.Also roughly minimizes the energy expenditure
among traditional irreversible circuits.
This will be our focus.
(2) It is also often useful to minimize the number of combinational stages or logical depth of the circuit.This roughly minimizes the delay or latency through the circuit, the time
between input and output.
Note: Goals (1) and (2) are often conflicting!In the real world, a designer may have to analyze and optimize some
complex trade-off between logic complexity and latency.
Minimizing ExpressionsMinimizing Expressions
We would like to find the smallest sum-of-products expression that is equivalent to a given function.This will yield a fairly small circuit.
Simplification of Switching Functions
Karnaugh Maps (K-Map)
A K-Map is a graphical representation of a logic function’s truth table
Relationship to Venn Diagrams
0m
1m
2m
3mb
a
Relationship to Venn Diagrams
0
1
2
3b
a
Relationship to Venn Diagrams
0 1
0
1
ab
0
1
2
3
Two-Variable K-Map
0 1
0
1
ab
Three-Variable K-Map
abc 00 01 11 10
0
1
0m
1m
2m
3m
6m
7m
4m
5m
Note: The bit sequences must alwaysbe ordered using a Gray code!
Three-Variable K-Map
abc 00 01 11 10
0
1
Note: The bit sequences must always be ordered using a Gray code!
Four-variable K-Map
abcd 00 01 11 10
00
01
11
10
0m
1m
2m
3m
6m
7m
4m
5m
12m
13m
14m
15m
10m
11m
8m
9m
Note: The bit sequences must be ordered using a Gray code!
Not
e: T
he b
it s
eque
nces
mus
t be
orde
red
usin
g a
Gra
y co
de!
Four-variable K-Mapab
cd 00 01 11 10
00
01
11
10
Plotting Functions on the K-map
SOP Form
Canonical SOP Form
Three Variable Example
F ABC ABC ABC ABC
using shorthand notation
6 3 1 5F m m m m
, , 1,3,5,6F A B C m
Three-Variable K-Map Example
abc 00 01 11 10
0
1
, , 1,3,5,6F a b c m
Plot 1’s (minterms) of switching function
1 1 1
1
Three-Variable K-Map Example
abc 00 01 11 10
0
1
, ,F a b c ab bc
Plot 1’s (minterms) of switching function
1 1 1
1 abbc
Four-variable K-Map Exampleab
cd 00 01 11 10
00
01
11
10
, , , 0, 2,9,12,14F a b c d m
1
1
1
1
1
Karnaugh Maps (K-Map)
Simplification of Switching Functionsusing K-MAPS
Or, logically adjacent terms can be combined
Terminology/Definition Literal
A variable or its complement Logically adjacent terms
Two minterms are logically adjacent if they differ in only one variable position
Ex:
abc abcand
m6 and m2 are logically adjacent
Note: abc abc a a bc bc
Terminology/Definition
Implicant Product term that could be used to cover
minterms of a function Prime Implicant
An implicant that is not part of another implicant
Essential Prime Implicant A prime implicant that covers at least one
minterm that is not contained in another prime implicant
Cover A minterm that has been used in at least one
group
Guidelines for Simplifying Functions
Each square on a K-map of n variables has n logically adjacent squares. (i.e. differing in exactly one variable)
When combing squares, always group in powers of 2m , where m=0,1,2,….
In general, grouping 2m variables eliminates m variables.
Guidelines for Simplifying Functions
Group as many squares as possible. This eliminates the most variables.
Make as few groups as possible. Each group represents a separate product term.
You must cover each minterm at least once. However, it may be covered more than once.
K-map Simplification Procedure
Plot the K-map Circle all prime implicants on the K-
map Identify and select all essential
prime implicants for the cover. Select a minimum subset of the
remaining prime implicants to complete the cover.
Read the K-map
Example
Use a K-Map to simplify the following Boolean expression
, , 1, 2,3,5,6F a b c m
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 1: Plot the K-map
1 1 1
1
, , 1, 2,3,5,6F a b c m
1
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 2: Circle ALL Prime Implicants
1 1 1
1
, , 1, 2,3,5,6F a b c m
1
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 3: Identify Essential Prime Implicants
1 1 1
1
, , 1, 2,3,5,6F a b c m
1
EPI
EPI
PI
PI
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 4: Select minimum subset of remaining Prime Implicants to complete the cover.
1 1 1
1
, , 1, 2,3,5,6F a b c m
1
EPIPI
EPI
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 5: Read the map.
1 1 1
1
, , 1, 2,3,5,6F a b c m
1
bcab
bc
Solution
, ,F a b c ab bc bc ab b c
Example
Use a K-Map to simplify the following Boolean expression
, , 2,3,6,7F a b c m
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 1: Plot the K-map
11
11
, , 2, 4,5,7F a b c m
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 2: Circle Prime Implicants
11
11
, , 2,3,6,7F a b c m
Wrong!!We reallyshould drawA circle aroundall four 1’s
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 3: Identify Essential Prime Implicants
EPIEPI
, , 2,3,6,7F a b c m
11
11Wrong!!We reallyshould drawA circle aroundall four 1’s
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 4: Select Remaining Prime Implicants to complete the cover.
EPIEPI
11
11
, , 2,3,6,7F a b c m
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 5: Read the map.
abab
11
11
, , 2,3,6,7F a b c m
Solution
, ,F a b c ab ab b
Since we can still simplify the functionthis means we did not use the largestpossible groupings.
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 2: Circle Prime Implicants
11
11
, , 2,3,6,7F a b c m
Right!
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 3: Identify Essential Prime Implicants
EPI
, , 2,3,6,7F a b c m
11
11
Three-Variable K-Map Example
abc 00 01 11 10
0
1
Step 5: Read the map.
b
11
11
, , 2,3,6,7F a b c m
Solution
, ,F a b c b
Special Cases
Three-Variable K-Map Example
abc 00 01 11 10
0
1 1 1 1
1
, , 1F a b c
11
1
1
Three-Variable K-Map Example
abc 00 01 11 10
0
1
, , 0F a b c
Three-Variable K-Map Example
abc 00 01 11 10
0
1 1
, ,F a b c a b c
1
1
1
Four Variable Examples
Example
Use a K-Map to simplify the following Boolean expression
, , , 0, 2,3,6,8,12,13,15F a b c d m
Four-variable K-Mapab
cd 00 01 11 10
00
01
11
10
, , , 0, 2,3,6,8,12,13,15F a b c d m
1
1
1
1
11
1
1
Four-variable K-Mapab
cd 00 01 11 10
00
01
11
10
0,2,3,6,8,12,13,15F m
1
1
1
1
11
1
1
Four-variable K-Mapab
cd 00 01 11 10
00
01
11
10
F abd abc acd abd acd
1
1
1
1
11
1
1