CORC 1312
HW#9: Inside the Computer


  1. For these questions, use the simple CPU datapath simulator:

    1. What happens if you put the number 100 in R0, then set the knobs so that A Bus = R0, B Bus = R0, ALU=A-B, and C Bus=R0?

    2. Describe the settings that would cause the value stored in R2 to be doubled.

    3. How many cycles are required to add the contents of R0, R1 and R2 and then place the sum in R3? Describe the settings for each cyle.

  2. For these questions, use the datapath with memory simulator:

    1. What settings would result in the sum of the registers R0 and R3 being stored in memory location 4?

    2. What settings would cause the contents of memory address 4 to be copied into register R0?

    3. Assuming that data can be copied to and from main memory in a single CPU cycle, how many cycles are required to add the contents of memory addresses 5 and 6 and then store the result in memory address 7? Describe the settings for each cylce.

  3. For these questions, use the Stored Program Computer simulator:

    1. What task is performed by the following machine language program?
      0: 1010001000000000
      1: 1000001000000011
      2: 1111111111111111
      

    2. What do you think would happen if you forgot to place a HALT instruction at the end of a machine language program? How would the control unit react? Use the simulator to test your prediction, then report the results.
    3. What task is performed if the following is stored in memory and executed?
      LOAD R0 5
      LOAD R1 6
      SUB R2 R0 R1
      STORE 7 R2
      HALT
      10
      4
      0