CS251 - Computer Organization
Gate Propagation Delays
Each logic gate takes some amount of time to calculate its output from its input.
So if an input to a gate changes the output will not change until some amount of time has passed.
This amount of time is called the Gate Propagation Delay.
The Gate Propagation delay varies from gate to gate.
It will also differ between different versions of the same gate.
Generally, faster gates cost more money!
Typical Gate Propagation Delays:
We will be using the following Gate Propagation Delays for our hand calculations:
When gates are combined into circuits the circuit will have a propagation delay.
The propagation delay of the circuit is the worst case time required for the output(s) to become correct after a change in the input(s).
So asking about the propagation delay is essentially asking how long it is necessary to wait after a change has occurred to be sure the answer is correct.
What is the propagation delay of the following circuit?
To answer this we must consider all possible changes that can occur and find the worst case. Then if we always wait that long we will be sure to have the correct answer regardless of what has happened.
The First Row:
The Second Row:
The Third Row:
So, while the final output is the same as it was at the start it flipped values during the computation. Thus, the answer was not known to be correct until 7.5 ns + 6.5 ns = 14.0 ns.
So if we wait 14.5 ns after any change before looking at the answer
Then, we know for sure that no matter what the change was the answer will be correct.
What is the propagation delay for the following circuit?
Looking at all combinations is not the best way to do this.
That is kind of tedious...
Besides we are only really concerned with the worst case...
The following process acheives the same result.
In the worst case the OR gate will require 7.0 ns to compute D.
The NOT bubble at the input to the AND gate requires 4.5 ns in the worst case.
Thus, in the worst case the inputs to the AND gate arrive at 4.5 ns.
The AND gate requires 7.5 ns to compute its output making C available after 12.0 ns (4.5 + 7.5)... in the worst case!
Thus, the inputs to the NOR gate arrive at MAX(7.0, 12.0) = 12.0 ns.
The MAX operation accounts for the worst case!
In the worst cast, the NOR gate requires an additional 5.0 ns to compute Z.
Thus, the total propagation delay is 17.0 ns (12.0 + 5.0).
The following diagram illustrates this timing:
Motivation for Logic Simplification:
Consider an Odd Number Detector (Similar to the even number detector from last class...)
How would you build a circuit to compute this function?
Using the methods from the last class:
Express the function as a truth table.
Express the truth table as an SOP expression.
Create a circuit from the SOP expression.
What does the truth table for a 3 bit Odd Number Detector Look Like?
As follows:
What is the straight forward SOP expression that we can generate from this truth table?
As follows:
What does the circuit implementation of this expression look like?
As follows:
How long will it take to compute E using this circuit?
4.5ns + 7.5ns + 7.0ns = 19.0ns.
4.5ns for the NOT gates.
7.5ns for the AND gates.
7.0ns for the OR gate.
Is there an easier way to express E?
Yes, E = C
What does this circuit look like?
It is trivial... Just a wire!
Which way would you want to build the circuit?
The second way, I hope!
Why?
It uses less gates!
Using less gates has several possible advantages:
Cheaper - Less gates cost less money.
Smaller - Uses less space on a chip.
More reliable - Less gates means less opportunities for failure.
Faster??? Maybe but not always.
This gives us several ways to evaluate our circuits:
Size/Cost: Measured by number of gates.
Speed: Time measured using the gate propagation delays.
Using a SOP expression does not necessarily give us the best implementation.
Sometimes you can have a flash of inspiration and see a simpler expression...
Sometimes you can't!
This is where Boolean Algebra comes in...
Boolean Algebra Identities:
To get started let's prove some of these laws:
Identity and Null should be pretty obvious.
Idempotent:
We can see from the truth table that A = A*A and A = A+A this proves the Idempotent identity.
Inverse:
Again, the truth table verifies the Inverse law.
Distributive OR:
Since the A(B+C) and AB + AC columns agree in all possible cases the identity must be true.
We could repeat this for every one of these identities but it could get tricky.
It would get pretty tedious.
Instead we'll do some direct proofs using the identities.
Absorption +:
Absorption AND:
So to prove that two expressions are equivalent we have several techniques:
Exhaustive: Build truth tables.
Direct Proof: Use already proven identities to prove others.
Combination:
Use identites to simplify the expressions
Build a truth table for the simpler expressions.
Logic Simplification:
Consider the Even Number Detector from earlier:
Which verifies our flash of inspiration!
If you have such an flash of inspiration in the project you should always verify it formally!
Simplification Example #1:
Note: Terms such as !(AB) or !(A+B) will require the use of DeMorgan's laws to simplify.
Simplification Example #2:
How many gates will it require to compute Z?
3 - 2 AND and 1 OR.
Can we do better?
Sure, continue the simplification one step further:
This implementation only requires 2 gates.
The moral of the story is that SOP gives and easy implementation but it is not always the best.
MinTerm Form:
MinTerm form is another (more compact) way of expressing a boolean function.
To get the MinTerm form list the rows of the truth table that contain 1's.
What if you don't have a truth table?
Several possibilities:
Generate one from the expression that you do have.
Convert your expression to SOP form then convert to the MinTerms.
Example #1: Express the following SOP expression in MinTerm form.
To find the MinTerms:
Write down a 1 for each non-inverted term - corresponding to 1's in the truth table.
Write down a 0 for each inverted term - corresponding to 0's in the truth table.
Convert the resulting binary numbers to decimal.
List the decimal numbers in increasing order in the MinTerm notation.
Example #2: Express the following SOP expression in MinTerm form.
What is the difficulty here?
Not all of the terms contain all of the variables!
Can that be fixed?
Yes. Use the Identity Law.
The SOP form where each term contains all variables is called: Sum-of-Normal-Products
Example #3: Express the following expression in MinTerm form.
What is the problem here?
This isn't even in SOP form, yet alone Sum-of-Normal-Products.
So convert it to SOP and then convert it to Sum-of-Normal-Products.
To convert an expression to SOP form:
Expand all !(AB) and !(A+B) type terms using DeMorgan's law.
Apply the distributive laws until an SOP form is achieved.
Use the Commutative law to write the variables of all terms in the same order.
To go to Sum-of-Normal-Products from SOP use the Identity and Distributive OR laws.