Two Level Circuit Optimiztion An easier way to generate a minimal sum of products expression. 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne.

Download Report

Transcript Two Level Circuit Optimiztion An easier way to generate a minimal sum of products expression. 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne.

Two Level Circuit
Optimiztion
An easier way to generate a minimal sum of
products expression.
9/15/09 - L7 Two Level Circuit
Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
1
Class 7 outline



Cost Functions
Map Structures
Maps




Two Variable
Three Variable
Four Variable
Material from section 2-4 of text
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
2
Intro and Cost Function

The complexity of the gates to physically
implement a Boolean function is typically a
1-to-1 relationship with the Boolean
expression of the function.


If the expression has 3 terms ANDed together, the
implementation has a 3-input AND gate.
If the expression has 4 AND terms Ored together
for the final output the implementation has a
4-input OR gate
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
3
Function representations

Truth Tables

Any Boolean function can be represented by a Truth
Table



Truth Tables have 1 line for each of the 2n possible input
combinations
Are a full specification of the function
Sum-of-Products


There is just one maximal sum-of-products representation
This is a representation where each term contain each
literal of the function, i.e., specifies each line of the Truth
Table where the value of the function is 1.
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
4
Illustration of this

Consider two function
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
5
Cost Functions


A cost function is a metric to place a value on
the ‘cost’ to implement a logic function.
The lowest cost will be the



minimal sum-of-products or
minimal product-of-sums representation.
These representation of the function with have
the fewest number of terms with the fewest
number of literals in each term.
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
6
Different cost factors


Literal cost – the sum of the number of literals
required for expression of the function.
Gate inputs – the number of inputs to gates in
the implementation


This is a cost function that is sometimes used
today.
CAD tools that automatically generate the
implementation have proprietary cost functions
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
7
Manual minimization






Usually done with Karnaugh maps
K-maps are an extension of Venn Diagrams
Consider a function of 2 inputs F(A, B)
Have 4 regions
A B AB and A’B’
Note adjacencies


A adjacent to AB and A’B’
AB adjacent to A and B
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
8
K-map for 2 variables

Karnaugh map for two variables

Note adjacencies
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
9
For three variables

3 variables – 8 Truth Table entries –
8 variable K-map
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
10
4 variable K-map

The 4 variable Karnaugh map
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
11
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
12
Minimizing functions using maps


Form the largest power of 2 group of adjacent
1 that you can. 1s on K-maps can be used
multiple times.
Example: 3 variable map




Simplify
F(A,B,C)=∑m(0,1,2,3,4,5)
Note minterm positions
Step 1 – enter 1s onto map
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
13
Minimizing

Step 2 find larges power of 2 groupings

Make sure all 1s are included (covered)
F(X,Y,Z)=X’ + Y’

9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
14
2 variable map examples

Easy to simplify if you can.
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
15
4 variable examples




Consider the map
What power
of 2 groups
exist?
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
16
First two

Is there a third?

Wraparound
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
17
Adjaceny

What cells are adjacent?
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
18
Another

Adjacency and wraparound

Top 00 cells are
adjacent to
bottom 10 cells


minimal is F=A’C + B’C’
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
19
In general


Map all 1s of the function to the K-map
Choose the largest power of 2 groups until all the 1 of the
function are covered






For a 4 variable function
Group 8 1s – will have 1 literal
Group 4 1s – will have 2 literals
Group 2 1s – will have 3 literals
No group – a lone 1 – term will have all 4 literals
Sometimes will have a choice on how to cover that last 1.
Make the choice that results in a term with the fewest
literals. Sometimes either of 2 answers are equal.
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
20
Simplifying functions


Simplify XY+X’Z+YZ
Expand to generate minterms
= XY(Z+Z’) + X’Z(Y+Y’) + (X+X’)YZ
= XYZ+XYZ’ + X’YZ + X’Y’Z + XYZ+X’YZ
= m7 + m6 + m3 + m1 + repeat + repeat




.
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
21
Class 7 summary assignment


Covered section 2-4
Problems for hand in


2-17
Problems for practice


2-16
2-15
Reading for next class: section 2-5
9/15/09 - L7 Two Level
Circuit Optimization
Copyright 2009 - Joanne DeGroat, ECE, OSU
22