Instruction Sequence
a. LW $t0, 0 ($sp)
ADD $t0, $t0, $t0
SW $t0, 0 ($sp)
b. ADD $t0, $a0, $a1
SUB $t1, $t0, $t1
ADD $t2, $t0, $t1
Use the given clock cycle times to answer the following questions:
Without Forwarding With ALU-ALU Forwarding With Full Forwarding
250 ps 275 ps 300 ps
1. What is the total execution time of each instruction sequence without forwarding and with full
forwarding? What is the speed-up achieved by adding full forwarding to a pipeline that had no
forwarding?
2. Add NOP instructions to this code to eliminate hazards if there is ALU-ALU forwarding only (no
forwarding from the MEM to EX stage.)
3. What is the total execution time of each instruction sequence with only ALU-ALU forwarding?
What is the speed-up over a pipeline without forwarding?
Instruction Sequence
a. LW $t0, 0 ($sp)
ADD $t0, $t0, $t0
SW $t0, 0 ($sp)
b. ADD $t0, $a0, $a1
SUB $t1, $t0, $t1
ADD $t2, $t0, $t1
Use the given clock cycle times to answer the following questions:
Without Forwarding With ALU-ALU Forwarding With Full Forwarding
250 ps 275 ps 300 ps
1. What is the total execution time of each instruction sequence without forwarding and with full
forwarding? What is the speed-up achieved by adding full forwarding to a pipeline that had no
forwarding?
a. 250 ps × 7 = 1750 ps; 300 ps × 4 = 1200 ps;
1750 ps
1200 ps
≈ 1.458 𝑡𝑖𝑚𝑒𝑠 𝑓𝑎𝑠𝑡𝑒𝑟
b. 250 ps × 7 = 1750 ps; 300 ps × 3 = 900 ps;
1750 ps
900 ps
≈ 1.944 𝑡𝑖𝑚𝑒𝑠 𝑓𝑎𝑠𝑡𝑒𝑟
2. Add NOP instructions to this code to eliminate hazards if there is ALU-ALU forwarding only (no
forwarding from the MEM to EX stage.)
a. LW, NOP, NOP, ADD, SW
b. ADD, SUB, ADD
3. What is the total execution time of each instruction sequence with only ALU-ALU forwarding?
What is the speed-up over a pipeline without forwarding?
a. 275 ps × 5 = 1375 ps;
1750 ps
1375 ps
≈ 1.272 𝑡𝑖𝑚𝑒𝑠 𝑓𝑎𝑠𝑡𝑒𝑟
b. 275 ps × 3 = 825 ps;
1750 ps
825 ps
≈ 2.121 𝑡𝑖𝑚𝑒𝑠 𝑓𝑎𝑠𝑡𝑒𝑟
1.