CDA4101, Problem Set 2

  1. Refer to the timing diagram of Fig. 3-38. The time needed from the point where !MREQ is asserted and the data must be stable before it is read can be calculated two ways from the table.
    1. Calculate the time needed using both calculations for a 100MHz bus.
    2. If the memory needs 15 nsec for this measurement, how many wait states are needed to read from the memory on a 100MHz bus?
    3. Calculate the time needed using both calculations for a 200MHz bus.
    4. If the memory needs 15 nsec for this measurement, how many wait states are needed to read from the memory on a 200MHz bus?
  2. Calculate the bus bandwidth to display 1280x1024 full-color video at 30 frames/sec. Assume that the data must pass over the bus twice, once from the CD-ROM to the memory and once from the memory to the screen.
  3. Assume DMA is being used to read all 2048 sectors of 512-bytes each in a track on a disk. Each 32-bit DMA transfer takes 1 bus cycle of 5 nsec. It takes one rotation of 8 msec to read the entire track. How many bus cycles per millisecond is the DMA using the bus? If the DMA has higher priority than the CPU, how many cycles per millisecond are left for the CPU?
  4. In section 3.7.2, assume that the memory space is 32K; the EPROM is 2K in size and will be placed at address 18K; the RAM is 4k in size and will be placed at address 24K; the PIO is 4 bytes and will be placed starting at address 7K. Draw the circuit for the !CS lines into the devices. Use full address decoding.
  5. Draw the circuit for the "high bit" in Figure 4.6.
  6. What would be the byte code for the instruction:
    GOTO -300
    You must show your work for translating -300 into hex.
  7. What is the hex microinstruction for the Micro Assembly Language (MAL) instruction,
    MDR = TOS = MDR - H; wr; goto (MBR OR 0x100)?
    You must show the binary equivalent of the above MAL and identify the various parts of the microinstruction, before writing the hex equivalent.
  8. What is the Micro Assembly Language (MAL) instruction for the hex microinstruction 142A40897?
    You must show the binary equivalent of the above hex and identify the various parts of the microinstruction, before writing the MAL code.
  9. Draw a picture of the stack after each of these instructions:
           ILOAD j
           ILOAD n
           ISUB
           BIPUSH 7
           ISUB
           DUP
           IADD
           ISTORE k
  10. Translate the following statement into IJVM symbolic instructions (like ILOAD, BIPUSH, ISTORE, etc). Use reasonable integer values for I, J AND K. Assume that the offset of CALCULATE in the constant pool is 0xA2B4. Since we are not implementing object oriented calls, assume that this (the pointer to the current object) is 0 (NULL). Do not make up an implementation for CALCULATE, just call the subroutine. Use the offset to the constant pool to make the call to the calculate routine.
    K = CALCULATE(I, J, 42);
  11. Explain why the following instrcutions cannot (or can) execute in one cycle in our architecture:
    1. MAR = CPP + TOS
    2. OPC = -TOS
    3. MDR = 1 + 1
    4. MBR = SP + 1
  12. In the statement if (Z) goto L1 else goto 0x087, what must be the value of L1?
  13. How long does a 2-GHz Mic-1 take to execute the following Java instruction?
    i = j - k
  14. Write the code for INOT, in Mic-1. It inverts the value on the top of the stack.
  15. Write the code for INAND, in Mic-1. It calculates the NAND of the top two values on the stack, removes them, and places the result on the stack.
  16. What is the relationship between the addresses for the labels T and F in Mic-1? Give an example what the addresses might be.
  17. Implement IF_ICMPNEQ in Mic-1. It compares the top values of the stack, removes them, and branches if they are not equal. Warning: think twice about the labels you use.
  18. Write the code for IINC_W, in Mic-1. It behaves like IINC, but the offset to the local variable and the constant are both 16 bits.
  19. Write the code fo IDIV2, in Mic-1. It divides the top operand on the stack by 2 and overwrites the top of the stack with the result.