Homework 3 - Chapter 4

Due: Friday February 13, 2015 by 11:59pm PST

  1. (6 pts) Using Figure 4.17 in the book (electronic version of this image is posted on Moodle), highlight the portions of the simple datapath that will be used AND state the value of each control line (for both main control and ALU control) for the following instructions:
    1. lw $s0, 4($t1)
    2. sw $s0, 0($t1)
    3. sub $t0, $s5, $t1
  2. (4 pts) For the following instructions parsed by the simple datapath, state whether or not they would be affected by a stuck-at-1 error for bit 0 of ALUOp. If it is affected, state what would go wrong. If it is not affected, explain why.
    1. load word (lw)
    2. store word (sw)
    3. branch equal (beq)
    4. R-type instructions
  3. (4 pts) For the following instructions parsed by the simple datapath, state whether or not they would be affected by a stuck-at-0 error for RegWrite. If it is affected, state what would go wrong. If it is not affected, explain why.
    1. load word (lw)
    2. store word (sw)
    3. branch equal (beq)
    4. R-type instructions
  4. (2 pts) What control lines and functional units would be needed to expand the simple datapath to support the jump register (jr) instruction? This instruction will use the contents of the rs register as the address of the next instruction (e.g. as the jump target). See page A-64 (B-64 in the 4th edition) for more details on the format of the jr instruction.
  5. (2 pts) What is the motivation behind using a pipelined datapath as opposed to the simple datapath?
  6. (2 pts) Assume that each stage in the instruction execution takes the following times:
    Instruction Fetch       250 ps
    Register Read            75 ps
    ALU Operation           150 ps
    Data Memory Access      250 ps
    Register Write          100 ps
    
    How long would it take to execute the following instructions using the simple datapath and how long would it take using the pipelined datapath with 5 stages as described in section 4.5:
    lw $t1, 0($t3)
    sw $t2, 0($s1)
    add $s3, $a0, $a1