CS 3853 Computer Architecture Recitation 12 Answers


Quiz 7a

  1. 2 on 1, 4 on 1, 3 on 2, 3 on 1
  2. 4 on 3, 5 on 2, 5 on 4
  3. 2 and 4, 1 and 5

Quiz 7b

  1. 3 on 2, 3 on 1, 5 on 3, 5 on 1, 5 on 2
  2. 4 on 3, 5 on 3
  3. 1 and 4, 2 and 5

Problems


  1. Instruction
    Reservation
    Station
    Execution
    Unit
    Issue
    Cycle
    Ex Start
    Cycle
    Ex End
    Cycle
    Memory
    Cycle
    CDB
    cycle
    Write
    dest
    L.D    F2,8(R1)Load1ALU12234F2
    ADD.DF4,F2,F2Add1fadd2678F4
    SUB.DF6,F8,F8Add2fadd3456F6
    MUL.DF10,F4,F2Mult1fmul491314F10
    ADD.DF12,F2,F6Add3fadd58910F12
    SUB.DF14,F6,F8Add4fadd6101112F14

  2. Two functional units that can add and subtract:

    Instruction
    Reservation
    Station
    Execution
    Unit
    Issue
    Cycle
    Ex Start
    Cycle
    Ex End
    Cycle
    Memory
    Cycle
    CDB
    cycle
    Write
    dest
    L.D    F2,8(R1)Load1ALU12234F2
    ADD.DF4,F2,F2Add1fadd12567F4
    SUB.DF6,F8,F8Add2fadd23456F6
    MUL.DF10,F4,F2Mult1fmul481213F10
    ADD.DF12,F2,F6Add3fadd15789F12
    SUB.DF14,F6,F8Add4fadd267810F14

  3. One functional unit for floating point (and one reservation type for floating point)

    Instruction
    Reservation
    Station
    Execution
    Unit
    Issue
    Cycle
    Ex Start
    Cycle
    Ex End
    Cycle
    Memory
    Cycle
    CDB
    cycle
    Write
    dest
    L.D    F2,8(R1)Load1ALU12234F2
    ADD.DF4,F2,F2Fu1fu2678F4
    SUB.DF6,F8,F8Fu2fu3456F6
    MUL.DF10,F4,F2Fu3fu4101415F10
    ADD.DF12,F2,F6Fu4fu58910F12
    SUB.DF14,F6,F8Fu5fu6151617F14
    Note 1: Fu4 has both of its operands available in cycle 8 and waits until cycle 8 for fu to become available.
    Note 2: Fu3 has its operand available in cycle in cycle 9 but fu is not yet ready.
    Note 3: Fu5 has its operands available in cycle 8, but fu is not available.
    Note 4: Fu3 and Fu5 both become ready after cycle 9 when the fu becomes available, so Fu3 starts execution because it issued first.

  4. The first instruction stalls for 6 cycles waiting for memory

    Instruction
    Reservation
    Station
    Execution
    Unit
    Issue
    Cycle
    Ex Start
    Cycle
    Ex End
    Cycle
    Memory
    Cycle
    CDB
    cycle
    Write
    dest
    L.D    F2,8(R1)Load1ALU122910F2
    ADD.DF4,F2,F2Add1fadd2111213F4
    SUB.DF6,F8,F8Add2fadd3456F6
    MUL.DF10,F4,F2Mult1fmul4141819F10
    ADD.DF12,F2,F6Add3fadd5131415F12
    SUB.DF14,F6,F8Add4fadd6789F14
    Note: Add1 and Add3 have their operands ready in cycle 11, so Add1 goes first because it issued first. Add3 needs to wait for fadd.

  5. Assume one reservation station for each functional unit. Reservation stations are clased Load, Add, and Mult. Assume that a reservation station does not become free until the cycle after its result it put on the CDB.:

    Instruction
    Reservation
    Station
    Execution
    Unit
    Issue
    Cycle
    Ex Start
    Cycle
    Ex End
    Cycle
    Memory
    Cycle
    CDB
    cycle
    Write
    dest
    L.D    F2,8(R1)LoadALU12234F2
    ADD.DF4,F2,F2Addfadd2567F4
    SUB.DF6,F8,F8Addfadd891011F6
    MUL.DF10,F4,F2Multfmul9101415F10
    ADD.DF12,F2,F6Addfadd12131416F12
    SUB.DF14,F6,F8Addfadd17181920F14
    Note 1: The first ADD.D reservies that Add when it issues so the SUB.D cannot issue until after the ADD.d uts its result on the CDB in cycle 7.
    Note 2: Since the SUB.D has not issued when ADD.D has its operands, it can start executing.
    Note 3: Even though the MUL.D has a reservation station available it has to wait for cycle 9 to issue since instructions must issue in order.
    Note 4: The second ADD.D cannot issue until SUB.D finishes and its reservation station is available.
    Note 5: The second ADD.D cannot put its result on the CDB in cycle 15 since the CDB is not available.