Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 352 Digital System Fundamentals

Similar presentations


Presentation on theme: "ECE 352 Digital System Fundamentals"— Presentation transcript:

1 ECE 352 Digital System Fundamentals
Standard Forms Multi-Level Optimization In this presentation, we will discuss standard forms of Boolean functions, as well as multi-level circuit optimization.

2 Topics Standard Forms Multi-Level Optimization
Sum of Products, Product of Sums Minterms and Maxterms Multi-Level Optimization First, we’ll discuss common standard forms, which are used to express logic as a two-level function or circuit.

3 Two-Level Circuit Optimization
A circuit is “n-level” if the longest path from any input to output goes through n gates Assume complements of inputs are “freely” available Two-level optimization Attempt to find the optimal 2-level implementation(s) of a Boolean function Optimal defined in terms of literal count or gate count, etc. Sum of Products: ANDOR Product of Sums: ORAND So, what is a “level”? We say that a logic circuit is N levels deep if the longest path from any input to the output goes through N logic gates. Note that only the longest path determines the number of levels of the circuit. We assume that the complements of all circuit inputs are available for free, so a complemented input literal does not increase the number of levels. The techniques we will primarily study and apply in this class will be used to find an optimal 2-level circuit implementation of a given Boolean function. Of course, we will have to decide exactly what “optimal” means. There are two standard forms of a 2-level circuit. In the sum of products (or SoP) form, there is a single OR gate that drives the output. The OR gate inputs are driven by AND gates, or directly from circuit inputs. In this example, the equation shows a set of product terms that are ORed together—which looks like an arithmetic “sum of products” even though we actually AND instead of multiply, and OR instead of add. In the corresponding circuit, the OR gate that drives the output receives the outputs of two AND gates and directly receives one circuit input. The other 2-level standard form is the Product of Sums (or PoS). In this type of circuit, there is a single AND gate that drives the output. The AND gate inputs are driven by OR gates, or directly from the circuit inputs. In this example, the equation shows a set of OR terms that are ANDed together, which looks like a product of sums. In the corresponding circuit, the AND gate drives the output, and it is fed by one circuit input and two OR gates. F = AB + BC + D G = W(X + Y)(Y + Z)

4 Minterms A minterm is a product term (an AND) containing all variables or their complements For n-variable function, are 2n possible minterms A minterm evaluates to 1 for just one input set, so a minterm’s truth table contains only a single 1 A minterm is simply a product term (a set of literals ANDed together) that contains all function variables or their complements. So, if a function has N variables, there are 2^N possible minterms, representing all of the combinations of literals in their original and complemented forms. Note that each minterm evaluates to 1 for just a single input set – for all other input possibilities it evaluates to 0. In other words, it represents a single row of the truth table. The table on the left shows all of the possible minterms for a function of three variables X, Y, and Z. Note that not all minterms will be present in every function – only the minterms for the rows of the truth table that have an output of 1. The table at right is a combined truth table showing the input combination that makes each minterm true. We sometimes represent a minterm using a shorthand notation of lowercase m and the minterm’s index. The index of the minterm corresponds to the binary value of the inputs that will cause that minterm to evaluate to 1. Note that you must be given the order of the inputs for the minterm index to make any sense. For example, minterm m4 is X AND /Y and /Z, which will only evaluate to 1 when X=1, Y=0, and Z=0. Since the variable order is given as XYZ, that means it will evaluate to 1 when the inputs are 100—the binary number equal to 4. To determine a minterm’s index, replace a literal with a 1 and a complemented literal with a 0, and find the decimal value of the resulting binary number, like we just did. You can find the term from the index by doing the opposite. As you’ll see throughout the course, we try to label things in a way that makes sense...

5 Functions of Minterms Can specify function as sum of minterms Example:
Use full minterms, or minterm indices Example: F = X Y Z + X Y Z + X Y Z F(X,Y,Z) = m1 + m3 + m7 = Σm(1,3,7) A function’s complement includes only the minterms not included in the original F(X,Y,Z) = m1 + m3 + m7 F(X,Y,Z) = m0 + m2 + m4 + m5 + m6 = X Y Z + X Y Z + X Y Z + X Y Z + X Y Z Remember that a truth table uniquely defines a Boolean function, and that a truth table is simply a list of all possible combinations of input values and the corresponding output value. So, we can directly implement a truth table as a sum of minterms by including all the minterms corresponding to the lines of the truth table where the output is a 1. By ORing the minterm AND gates together, the circuit will produce a 1 for all input combinations corresponding to the included minterms, and a 0 for all other input combinations representing minterms that were not included. Note that we can also represent this implementation by an even shorter notation using the summation operator. Since the complement of a function must produce the opposite output, we can implement that by simply including all of the minterms that were NOT included in the original function, and excluding the ones that were.

6 Maxterms A maxterm is a sum term (an OR) containing all variables or their complements For n-variable function, are 2n possible maxterms A maxterm evaluates to 0 for just one input set, so a maxterm’s truth table contains only a single 0 A maxterm is a sum term (an OR) that contains all function variables or their complements. If a function has N variables, there are 2^N possible maxterms. Note that each maxterm evaluates to 0 for just a single input set—one row of the truth table. For all other input possibilities it evaluates to 1. Think about the different identities for the AND function and the OR function to see why maxterms and minterms behave differently. The table on the left shows all of the possible maxterms for a function of three variables X, Y, and Z. We can also represent a maxterm using a shorthand notation of uppercase M and the maxterm’s index. Remember: a “max”term has a bigger M than a “min”term. For maxterms, the index corresponds to the combination of inputs that will cause it to evaluate to 0. For example, maxterm M4 must evaluate to 0 when the inputs are 100. The logic required to do this is /X OR Y OR Z. Like a minterm index, the maxterm index is the row of the truth table where that maxterm is “important”—but in this case, the translation between the index and the algebraic term is slightly different. If you look at the M4 column of the truth table the minimized solution for this truth table will be the term given in the table at left. Note the difference in which literals are complemented in maxterm M4 compared to minterm m4!

7 Functions of Maxterms Can specify function as product of maxterms
Use full maxterms, or maxterm indices Example: F = ( X + Y + Z)( X + Y + Z)(X + Y + Z) F(X,Y,Z) = M6 · M4 · M0 = ΠM(0,4,6) A function’s complement includes only the maxterms not included in the original F(X,Y,Z) = M6 · M4 · M0 F(X,Y,Z) = M7 · M5 · M3 · M2 · M = ( X + Y + Z )∙( X +Y+ Z )∙(X+ Y + Z )∙(X+ Y +Z)∙(X+Y+ Z ) We can also directly implement a function as a product of maxterms. Since a maxterm evaluates to 0 for only a single input set, we include all maxterms corresponding to rows of the truth table where the output is 0. Since the maxterms are ANDed together, if any one of them produces a 0, then function output will be 0. If none of them produce a 0, the output will be a 1. We can also denote the product of maxterms using the product operator and a set of indices. A function’s complement is formed by including all maxterms that were not in the original function, and excluding the ones that were.

8 Convert Between Forms Functions can be converted between minterm and maxterm forms by using the “other” indices F(X,Y,Z) = ∑m(7,6,3,2) = ∏M(5,4,1,0) XYZ + XY Z + X YZ + X Y Z = X +Y+ Z ∙ X +Y+Z ∙(X+Y+ Z )∙(X+Y+Z) Conversion between minterm and maxterm forms is straightforward. The sum of minterms form includes all indices corresponding to truth table rows where the output is 1, and the product of maxterms form includes all indices corresponding to truth table rows where the output is 0. So, to convert from one to the other you simply use only indices that were not used in the other form. This is much easier than converting the function algebraically!

9 Topics Standard Forms Multi-Level Optimization
Sum of Products, Product of Sums Minterms and Maxterms Multi-Level Optimization SoP and PoS are 2-level forms. A multi-level circuit is simply one that has more than 2 levels of logic. Most of work in this course will centered on creating optimal 2-level circuits, but that approach is not always appropriate. As we’ll see, creating an optimal multi-level circuit can be daunting.

10 Multi-Level Circuit Optimization
A multiple-level (>2) circuit may have a cost (area) advantage over a 2-level version Boolean transformations may allow us to “factor out” common expressions and use fewer/smaller gates Fewer/smaller gates occupy less area But it might also be slower because of a longer path from one or more inputs to the output Depends on our optimization goal… Area, delay, etc. Sometimes, a 2-level implementation may have a lot of redundancy in its terms, and we might want to factor that out. It depends on our optimization goals. Implementing that function as a multi-level circuit may well result in a smaller circuit by reducing the size and/or number of gates. However, it will likely also be slower because of the longer path(s) through the circuit. If one or more inputs to a circuit change value, the output will only be correct after all of those changes propagate through the circuit. This means that a circuit is really only as fast as the delay along its longest path; each gate along that path contributes to the delay. This is why a multi-level circuit is often slower than a 2-level circuit, even if it is smaller. Which do we want? Well, it depends on the situation. Evaluating tradeoffs between area and speed is a common theme in digital circuit design. In this class, you’ll always be told the optimization goal, as well as the size and delay of each gate if you need it…

11 Multi-Level Circuit Optimization
Not necessarily optimal Unfortunately, there is no closed-form algorithmic procedure to identify the optimum circuit “Optimal” could be area, delay, power, etc. Use Boolean algebra to find a ‘good’ implementation Group/identify common logic, factor out common terms… Break function into smaller sub-functions (extraction) Optimize each sub-function and use substitution We can use software tools find near-optimal circuits But you should be able to apply the basic ideas: “Fewer/smaller gates” => less area “More levels to the circuit” => slower Truth is, we cannot have gates with many inputs anyway… Design tools may transform 9-input OR into tree of 3-input ORs Unfortunately, although there are methods to find optimally-small, optimally-fast 2-level implementations for Boolean functions, there is no method or process guaranteed to find an optimal multi-level implementation without comparing all possible solutions, which we generally want to avoid because of how long it takes. (That method, by the way, is called “brute force” due to its lack of sophistication.) Instead, we use Boolean algebra to attempt to find implementations that are good, if not optimal. There are also software tools that can find good solutions for us, but again, not generally guaranteed to be optimal. Even without the tools, though, you should be able to apply Boolean algebra to try to find a faster or smaller circuit. Due to the physics of silicon transistors, it is not always possible to actually create a 2-level implementation of some functions. The size of a gate increases faster than the number of inputs increases, and we can’t build useful gates with more than 4 or 5 inputs anyway. For example, a 9-input OR function would probably need to be implemented using a tree of 3-input OR gates. You will learn more about these issues if you take a course that covers transistor-level digital logic design in more depth.

12 Multi-Level Optimization Example
AD + AE + BCD + BCE Two 2-input AND gates Two 3-input AND gates One 4-input OR gate Two levels (A + BC)(D + E) Two 2-input AND gate Two 2-input OR gates Three levels Let’s look at an example of a logic function implemented in both 2-level and multi-level forms. Here are two logic functions that are functionally equivalent, along with their associated circuit implementations. Notice that the circuits look very different even though they have the same truth table. The structure of the logic function implies the structure of the circuit. We can see by looking at these that the top structure is larger than the bottom one, and counting the gates confirms it. However, the top circuit is likely to be faster, because the longest path goes through two gates, compared to three gates in the bottom circuit. As you can see – it is a tradeoff between area and speed.

13 ECE 352 Digital System Fundamentals
Standard Forms Multi-Level Optimization This concludes this video on standard forms and multi-level optimization.


Download ppt "ECE 352 Digital System Fundamentals"

Similar presentations


Ads by Google