CS251 - Computer Organization
Computer Science 251
Computer Organization

Dickinson College
Fall Semester 2000
Grant Braught


Class #8 - Propagation Delays and Logic Simplification


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: Gate Delay -------------------- NOT 4.5 ns AND 7.5 ns OR 7.0 ns NAND 7.5 ns NOR 5.0 ns XOR 6.5 ns
When gates are combined into circuits the circuit will have a propagation delay.
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.
       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: A B C | E --------+-- 0 0 0 | 0 0 0 1 | 1 0 1 0 | 0 0 1 1 | 1 1 0 0 | 0 1 0 1 | 1 1 1 0 | 0 1 1 1 | 1 What is the straight forward SOP expression that we can generate from this truth table?
As follows: _ _ _ _ E = A B C + A B C + A B C + A B C 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: Name: AND form: OR form: ---------------------------------------------------------------------------- Identity 1 A = A 0 + A = A Null 0 A = 0 1 + A = 1 Idempotent A A = A A + A = A _ _ Inverse A A = 0 A + A = 1 Commutative A B = B A A + B = B + A Associative (A B) C = A (B C) (A + B) + C = A + (B + C) Distributive A + (B C) = (A + B)(A + C) A (B + C) = A B + A C Absorption A (A + B) = A A + A B = A ___ _ _ _____ _ _ DeMorgan's A B = A + B A + B = A B To get started let's prove some of these laws:

Identity and Null should be pretty obvious.

Idempotent: A A*A A+A ----------- 0 0 0 1 1 1        We can see from the truth table that A = A*A and A = A+A this proves the Idempotent identity.

Inverse: _ _ _ A A A*A A+A -------------- 0 1 0 1 1 0 0 1        Again, the truth table verifies the Inverse law.

Distributive OR: A B C B+C A(B+C) AB AC AB+AC ------------------------------- 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1        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 +: A + A B = A A 1 + A B = A Identity AND (Technically there is a commutative step here too!) A (1 + B) = A Distributive OR A 1 = A Null OR A = A Identity AND Absorption AND: A (A + B) = A A A + A B = A Distributive OR A + A B = A Idempotent AND A = A Absorption OR 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: _ _ _ _ E = A B C + A B C + A B C + A B C _ _ _ E = A (B C + B C) + A (B C + B C) Distributive OR _ _ _ E = A C (B + B) + A C (B + B) Distributive OR _ E = A C (1) + A C (1) Inverse OR _ E = A C + A C Identity AND _ E = C A + C A Commutative AND _ E = C (A + A) Distributive OR E = C (1) Inverse OR E = C Identity AND        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: ___ ___ _ Z = (A B) + (A C) _ _ _ _ _ Z = (A + B) + (A + C) DeMorgan's AND _ _ _ Z = A + B + A + C _ _ _ Z = (A + A) + B + C Commutative/Associative OR _ _ Z = (1 + B) + C Inverse/Associative OR _ Z = 1 + C Null OR Z = 1 Null OR        Note: Terms such as !(AB) or !(A+B) will require the use of DeMorgan's laws to simplify.

Simplification Example #2: ________________ _ _ _ _ Z = ((A + B)(A + C)) _______ _______ _ _ _ _ Z = (A + B) + (A + C) DeMorgan's AND _ _ _ _ _ _ _ _ Z = A B + A C DeMorgan's OR Z = A B + A C 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: Z = A (B + C) Distributive OR        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. A B C D | Z --------+-- 0 0 0 0 0 | 1 1 0 0 0 1 | 0 2 0 0 1 0 | 0 3 0 0 1 1 | 0 4 0 1 0 0 | 1 5 0 1 0 1 | 0 6 0 1 1 0 | 1 7 0 1 1 1 | 0 MinTerm Form --> Z(A,B,C,D) = Sm(0,4,6,10,11,14) 8 1 0 0 0 | 0 9 1 0 0 1 | 0 10 1 0 1 0 | 1 11 1 0 1 1 | 1 12 1 1 0 0 | 0 13 1 1 0 1 | 0 14 1 1 1 0 | 1 15 1 1 1 1 | 0        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. _ _ _ _ _ _ _ _ _ _ _ _ Z = A B C D + A B C D + A B C D + A B C D + A B C D + A B C D + A B C D + A B C D 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 0 1 0 0 15 11 7 14 10 12 6 4 Z(A,B,C,D) = Sm(4,6,7,10,11,12,14,15)        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. _ _ _ J = A B + A C + A B C What is the difficulty here?
Not all of the terms contain all of the variables!
Can that be fixed?
Yes. Use the Identity Law. _ _ _ J = A B + A C + A B C _ _ _ _ _ J = A B (C + C) + A C (B + B) + A B C Identity OR _ _ _ NOTE: A B (C + C) = A B _ _ _ A C (B + B) = A C _ _ _ _ _ _ _ J = A B C + A B C + A C B + A C B + A B C Distributive OR _ _ _ _ _ _ _ J = A B C + A B C + A B C + A B C + A B C Commutative OR 1 0 1 1 0 0 0 1 1 0 0 1 1 1 0 5 4 3 1 6 J(A,B,C) = Sm(1,3,4,5,6)        The SOP form where each term contains all variables is called: Sum-of-Normal-Products

Example #3: Express the following expression in MinTerm form. ___ _ _____ K = (A B + C) (A + C)
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. ___ _____ K = (A B + C) (A + C) _ _ _ _ K = ((A + B) + C) (A C) DeMorgan's AND/OR _ _ _ _ K = (A + B + C) (A C) Associative OR _ _ _ _ _ _ _ _ K = A (A C) + B (A C) + C (A C) Distributive OR _ _ _ _ _ _ _ _ K = A A C + A B C + A C C Associative/Commutative AND _ _ _ _ _ _ K = A C + A B C + A 0 Idempotent/Inverse AND _ _ _ _ _ K = A C + A B C Null AND _ _ _ _ _ _ K = A C (B + B) + A B C Identity OR _ _ _ _ _ _ _ _ K = A C B + A C B + A B C Distributive OR _ _ _ _ _ _ _ _ K = A B C + (A B C + A B C) Commutative AND / Associative OR _ _ _ _ _ K = A B C + A B C Idempotent OR 0 1 0 0 0 0 2 0 K(A,B,C) = Sm(0,2)        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.