Assignment 2

Due  2/20 at the start of class

  1. (4 points) On many CPUs there are 4 condition codes: Z, N, O, C to test if the result of the ALU operation was zero, negative, wrong as a signed number, wrong as an unsigned number, respectively. An 8-bit ALU is constructed from 8 1-bit ALUs in Fig. 3-20. How would each of these condition codes be wired to such an ALU? Draw the circuits for each. (The O bit is set when the carry into the highest ALU is different from the carry out of the highest ALU).
  2. (3 points) The shifter on page 136 only has two functions: shift right and shift left. Modify it so that it can do four functions: arithmetic shift right, logical shift right, shift left, don't shift. The shifting done in the book is logical shifting: a 0 is placed into the S0 or S7 bit, depending on which way the shift goes. An arithmetic shift left is the same as a logical shift left, a 0 is placed into bit S7. An arithmetic shift right places D0 into both S0 and S1: it is duplicating the sign bit. A don't shift operation would send each data bit to the corresponding output: D0 to S0, D1 to S1, etc.
  3. (3 points) An SR latch can also be built from two NAND gates, instead of two NOR gates. No other gates are needed.
    1. Draw such a circuit.
    2. Categorize as queiescent, unstable, set, or reset the following values for S and R
      1. S = 0 R = 0
      2. S = 1 R = 1
      3. S = 0 R = 1
      4. S = 1 R = 0
  4. (4 points) The 4 X 3 memory of Figure 3-29 uses 22 AND gates and three OR gates. It also has 11 input, output, and control lines.
    1. Suppose the circuit were expanded to 256 X 32.
      1. How many AND gates would be needed?
      2. How many OR gates would be needed?
      3. How many pins would be coming into and out of the chip?
    2. Suppose the circuit were expanded to 512 x 16.
      1. How many AND gates would be needed?
      2. How many OR gates would be needed?
      3. How many pins would be coming into and out of the chip?
  5. (2 points) Sometimes it is useful for an 8-bit ALU such as Fig. 3-20 to generate the constant -1 as output. Give two different ways this can be sone. For each way, specify the values of the six control signals: ENA, ENB, INVA, INC (carry into the lowest ALU), F0 and F1. Each of the ALUs gets the same values for ENA, ENB, INVA, F0, and F1. Only the lowest ALU gets INC. You may not control the values of A and B.
  6. (2 points) In round robin bus arbitration, each device gets the bus in turn: device 1, device 2, device 3, device 4, device 1, device 2, device 3, device 4 etc. If a particular device has not made a request, then the arbiter will grant the bus to the next device. How could such an arbitration scheme be implemented? Design such a circuit using a centralized arbitration scheme. You may want to design a 2-bit adder that can count 00, 01, 10, 11, 00, 01, etc.
  7. (1 point) Referring to the timing diagram of Fig, 3-37, suppose that you slowed the clock down to 25 MHz instead of 40 MHz as shown but the timing constraints remained unchanged. How much time would the memory have to get the data onto the bus during T3 after NOT MREQ was asserted, in the worst case?
  8. (1 point) Why is it IMPOSSIBLE for the Pentium II to work on a 32-bit PCI bus without losing any functionality? Be specific. (Think about the address lines on the Pentium II).
  9. Optional. Draw a circuit using AND and OR gates, and only two INVERTERS that will invert its three inputs. You may use as many AND and OR gates as needed. You may not use any other circuits, such as NAND, NOR, XOR.