Question: B) If a representative code sequence is: CONT: lw add iw beq SW SKIP: $t1, 0($a0) $s0, $s0, $t1 $a0, 4($50) $t1, $0, SKIP $50,



B) If a representative code sequence is: CONT: lw add iw beq SW SKIP: $t1, 0($a0) $s0, $s0, $t1 $a0, 4($50) $t1, $0, SKIP $50, 0($a1) bne $50, $0, CONT Below is a schedule for the loop when the branch to SKIP is A) not taken and B) correctly predicted: 1 |2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 CONT: lw $t1, 0($a0) F1 F2 H D E1 E2 M1 M2 W add $s0, $s0, $t1 F1 F2 In nh D E1 E2 M1 M2W lw $a0, 4($80) F1 |f2f2f2 F2 h D E1 E2 M1 M2W beq $t1, $0, SKIP f1 f1f1 F1 |f2|F2 HD E1 E2 M1 M2 w sw $so, O($a1) f1 F1 F2 H D E1 E2 M1 M2 W DI SKIP:bne $50, $0, CONT F1 F2 H D E1 E2 M1 M2 W 10 111 Below is a schedule where the branch to SKIP is A) taken and B) correctly predicted: 1 12 13 14 5 16 17 18 19 10 11 12 13 14 15 16 17 18 CONT: lw $t1, 0($a0) F1 F2 H D E1 E2 M1 M2 W add $80, $80, $t1 |F1 F2 In 1 In HD E1 E2 M1 M2W lw $a0, 4($80) F1 42 42 42 F2 h H D E1 E2 M1 M2 W beq $t1, $0, SKIP f1 f1 f1 F1 f2 F2 H D E1 E2 M1 M2 W SKIP:bne $50, $0, CONT f1 F1 F2 H D E1 E2 M1 M2 W If the branch to SKIP is only taken on the first iteration and the branch to CONT is taken 999 times in a row and not taken on the 1000th time, what is the average CPI for the first 300 loop iterations for the 9-stage pipeline? C) What would the CPI be for the 9-stage pipeline if we added a 1-bit bimodal branch predictor, initially in state N=0 (for the branch to SKIP) and T=1 (for the branch to CONT), both branches have been encountered before and an entry is present for each in the BTB, and this loop executes 1000 times (again, as in B, 999 taken, then 1 not taken to CONT, 1 Taken and then 999 not taken to SKIP)? B) If a representative code sequence is: CONT: lw add iw beq SW SKIP: $t1, 0($a0) $s0, $s0, $t1 $a0, 4($50) $t1, $0, SKIP $50, 0($a1) bne $50, $0, CONT Below is a schedule for the loop when the branch to SKIP is A) not taken and B) correctly predicted: 1 |2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 CONT: lw $t1, 0($a0) F1 F2 H D E1 E2 M1 M2 W add $s0, $s0, $t1 F1 F2 In nh D E1 E2 M1 M2W lw $a0, 4($80) F1 |f2f2f2 F2 h D E1 E2 M1 M2W beq $t1, $0, SKIP f1 f1f1 F1 |f2|F2 HD E1 E2 M1 M2 w sw $so, O($a1) f1 F1 F2 H D E1 E2 M1 M2 W DI SKIP:bne $50, $0, CONT F1 F2 H D E1 E2 M1 M2 W 10 111 Below is a schedule where the branch to SKIP is A) taken and B) correctly predicted: 1 12 13 14 5 16 17 18 19 10 11 12 13 14 15 16 17 18 CONT: lw $t1, 0($a0) F1 F2 H D E1 E2 M1 M2 W add $80, $80, $t1 |F1 F2 In 1 In HD E1 E2 M1 M2W lw $a0, 4($80) F1 42 42 42 F2 h H D E1 E2 M1 M2 W beq $t1, $0, SKIP f1 f1 f1 F1 f2 F2 H D E1 E2 M1 M2 W SKIP:bne $50, $0, CONT f1 F1 F2 H D E1 E2 M1 M2 W If the branch to SKIP is only taken on the first iteration and the branch to CONT is taken 999 times in a row and not taken on the 1000th time, what is the average CPI for the first 300 loop iterations for the 9-stage pipeline? C) What would the CPI be for the 9-stage pipeline if we added a 1-bit bimodal branch predictor, initially in state N=0 (for the branch to SKIP) and T=1 (for the branch to CONT), both branches have been encountered before and an entry is present for each in the BTB, and this loop executes 1000 times (again, as in B, 999 taken, then 1 not taken to CONT, 1 Taken and then 999 not taken to SKIP)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
