Docstoc

Lecture07

Document Sample
Lecture07 Powered By Docstoc
					                              7
        ENSC 150




More Combinatorial Circuits
                          Look-Ahead Carry
      If we build a 32-bit adder with 1-bit adders there is a 32 stage delay caused
      by the carry propagating through 32 stages. How can we reduce this?

     Cout  ( AB)  ( A  B)Cin     The expressions g & p depend only upon A & B.
     Cout  ( g )  ( p )Cin        The expressions g & p attain stable values with only
                                    a single gate delay.

          Suppose we wish to build a 4-bit adder.
        C0  g 0  p0Cin
       C1  g1  p1C0  g1  p1 g0  p1 p0Cin
       C2  g 2  p2C1  g 2  p2 g1  p2 p1 g 0  p2 p1 p0Cin
       C3  g3  p3C2  g3  p3 g 2  p3 p2 g1  p3 p2 p1 g0  p3 p2 p1 p0Cin


Monday, Sept 25th '00                                                                      2
Monday, Sept 25th '00   3
                                   Priority Encoder
     Remember the encoder which produced a unique code when a single coin
     was in the coin box. Suppose we wish to produce a circuit which allows for
     the possibility that more than one coin could be in the box.
     In this case:
     We want the circuit to produce the code for only the most important coin.


 The x’s allow us to write many
 rows of the truth table in less
 space.




Monday, Sept 25th '00                                                             4
                        A priority Encoder Circuit



                                             A useful exercise:
                                             Complete the connections from
                                             the decoded rows to produce the
                                             final code outputs.




Monday, Sept 25th '00                                                          5
                        9-bit Parity Generator

       Suppose that we want a circuit which indicates the parity of a nine
       bit number.
       We are too lazy to write down a truth table with 512 rows so we try
       a recursive trick.

       Pretend that we already have 3-bit parity generators.




Monday, Sept 25th '00                                                        6
                        Odd + Odd + Odd = Odd
                        Odd + Odd + Even = Even
                        Odd + Even + Even = Odd
                        Even + Even + Even = Even
Monday, Sept 25th '00                               7
                        Magnitude Comparators

     We already know how to build a circuit which can compare binary
     numbers to check whether they are equal.




   Now we want to build a circuit to decide whether A > B ( unsigned binary)

Monday, Sept 25th '00                                                          8
     If A and B are both 4-bit numbers there will be 256 rows in the truth table.

     Let us try a recursive trick instead.
                                                              An An 1 ...   ... A1 A0
            Split the digits of A and B at some position
                                                                  Atop ...   ... Abot
            if A top  Btop then A  B
            if A top  Btop then A  B only if A bot  Bbot

                                                               I.e. Consider the two
                                                               numbers

                                                               2339840550328 and
                                                               2330840239854




Monday, Sept 25th '00                                                                    9
           Exercise:    1) design a 1-bit comparator using truth tables
                        2) design a 2-bit comparator using recursion
                        3) simplify the 2-bit comparator
                        4) design the final 4-bit comparator.
Monday, Sept 25th '00                                                     10

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:2/17/2013
language:Unknown
pages:10