Question: Problem 5 Consider the following code segment using the instruction set from lecture. Assume that the ISA specifies 1 branch delay slot. SUB R1, R1,

 Problem 5 Consider the following code segment using the instruction set

Problem 5 Consider the following code segment using the instruction set from lecture. Assume that the ISA specifies 1 branch delay slot. SUB R1, R1, R1 SUB R2, R2, R2 ADDI R2, R2, 3 L: LB R3, 0 (R1) LB R4, 1 (R1) ADD R5, R3, R4 SB R5, 2 (R1) ADDI R1, R1, 3 ADDI R2, R2, -1 BGEZ R2, L NOP If the branch is taken, the program jumps to label L. (a) Identify an instruction that can be moved in place of the NOP while maintaining the same code fiunctionality (b) We want to compare the branch prediction accuracy (percentage of time that the prediction is correct) for two branch predictors: 1. The bimodal predictor from lecture with an initial state of 00. 2. A 1-bit predictor that predicts the next outcome (taken or not taken) to be the same as the outcome the previous time that the branch was executed. If the bit is 0, the taken, and taken if the bit is 1. The initial state is 0 s not Assuming that the code above executes three times (for instance, if it is part of a function that's called three times), fill out the table belowentering "incorrect" or "correc" in the Bimodal and 1-bit table entries (ditto marks are fine)-and then calculate the final percentage accuracy Code Execution Iteration Bimodal (incorrect or correct-bit (incorrect or correct 4 4 4 Problem 5 Consider the following code segment using the instruction set from lecture. Assume that the ISA specifies 1 branch delay slot. SUB R1, R1, R1 SUB R2, R2, R2 ADDI R2, R2, 3 L: LB R3, 0 (R1) LB R4, 1 (R1) ADD R5, R3, R4 SB R5, 2 (R1) ADDI R1, R1, 3 ADDI R2, R2, -1 BGEZ R2, L NOP If the branch is taken, the program jumps to label L. (a) Identify an instruction that can be moved in place of the NOP while maintaining the same code fiunctionality (b) We want to compare the branch prediction accuracy (percentage of time that the prediction is correct) for two branch predictors: 1. The bimodal predictor from lecture with an initial state of 00. 2. A 1-bit predictor that predicts the next outcome (taken or not taken) to be the same as the outcome the previous time that the branch was executed. If the bit is 0, the taken, and taken if the bit is 1. The initial state is 0 s not Assuming that the code above executes three times (for instance, if it is part of a function that's called three times), fill out the table belowentering "incorrect" or "correc" in the Bimodal and 1-bit table entries (ditto marks are fine)-and then calculate the final percentage accuracy Code Execution Iteration Bimodal (incorrect or correct-bit (incorrect or correct 4 4 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!