9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level...

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

Transcript of 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level...

Page 1: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 1

Two Level Circuit OptimiztionAn easier way to generate a minimal sum of products expression.

Page 2: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 2

Class 7 outline Cost Functions Map Structures Maps

Two Variable Three Variable Four Variable

Material from section 2-4 of text

Page 3: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 4: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 5: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

Illustration of this Consider two function

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 5

Page 6: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 7: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 8: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 9: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 10: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 11: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

4 variable K-map The 4 variable Karnaugh map

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 11

Page 12: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 12

Page 13: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 14: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 15: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 16: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 17: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

First two Is there a third?

Wraparound

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 17

Page 18: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

Adjaceny What cells are adjacent?

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 18

Page 19: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 20: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 21: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

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

Page 22: 9/15/09 - L7 Two Level Circuit Optimization Copyright 2009 - Joanne DeGroat, ECE, OSU1 Two Level Circuit Optimiztion An easier way to generate a minimal.

Class 7 summary assignment Covered section 2-4 Problems for hand in

2-16 2-17 Problems for practice

2-15

Reading for next class: section 2-5

9/15/09 - L7 Two Level Circuit Optimization

Copyright 2009 - Joanne DeGroat, ECE, OSU 22