. Strategy 1 → Branch is always taken: In this, the strategy is to assume that the branch will always be taken. For this strategy show the branch prediction table, comparing it with the actual branch outcome and compute the branch predictor accuracy. Question 3: In the context of control hazards, branch prediction strategies are used to improve performance. Given a branch, the following example shows the branch prediction table for some strategy and the outcome of the branch. Predictor value of 1 indicates the prediction that the branch will be taken and 0 indicates the prediction that the branch will not be taken. Value of register 1 Branch predictor for Branch b Prediction (T/NT) Actual outcome Misprediction? of branch bl (yes/no) 0 NT NT No 1234 0 1 0 NT T Yes T NT Yes NT NT No 5 0 NT NT No Branch predictor accuracy is defined as the percentage of predictions that are correct. In the example above, the prediction is correct 3 out of 5 times (shown in bold). The accuracy can be computed as shown below: Accuracy 3/5 = 0.6 Let's assume that A is an array stored in the main memory with values [3, 4, 2, 6, 4, 7, 4, 4] associated with array indices 0 through 6, respectively. Furthermore, assume that the base address for array variable A is associated with register XO, and that of i and k are associated with X1, X2, respectively. Consider the following LEGv8 code. AND X1, X1, XZR Loop: LSL X3, X1, #3 ADD X3, X0, X3 LDUR X4, [X3, #0] SUBI X5, X4, #4 CBNZ X5, Cond ADDI X2, X2, #1 Cond: SUBI X6, X1, #7 CBZ X6, Exit ADDI X1, X1, #1 B Loop Exit: // Branch B1 Consider the following strategies and show branch prediction strategies tables and accuracies for branch B1 for each of the strategy
. Strategy 1 → Branch is always taken: In this, the strategy is to assume that the branch will always be taken. For this strategy show the branch prediction table, comparing it with the actual branch outcome and compute the branch predictor accuracy. Question 3: In the context of control hazards, branch prediction strategies are used to improve performance. Given a branch, the following example shows the branch prediction table for some strategy and the outcome of the branch. Predictor value of 1 indicates the prediction that the branch will be taken and 0 indicates the prediction that the branch will not be taken. Value of register 1 Branch predictor for Branch b Prediction (T/NT) Actual outcome Misprediction? of branch bl (yes/no) 0 NT NT No 1234 0 1 0 NT T Yes T NT Yes NT NT No 5 0 NT NT No Branch predictor accuracy is defined as the percentage of predictions that are correct. In the example above, the prediction is correct 3 out of 5 times (shown in bold). The accuracy can be computed as shown below: Accuracy 3/5 = 0.6 Let's assume that A is an array stored in the main memory with values [3, 4, 2, 6, 4, 7, 4, 4] associated with array indices 0 through 6, respectively. Furthermore, assume that the base address for array variable A is associated with register XO, and that of i and k are associated with X1, X2, respectively. Consider the following LEGv8 code. AND X1, X1, XZR Loop: LSL X3, X1, #3 ADD X3, X0, X3 LDUR X4, [X3, #0] SUBI X5, X4, #4 CBNZ X5, Cond ADDI X2, X2, #1 Cond: SUBI X6, X1, #7 CBZ X6, Exit ADDI X1, X1, #1 B Loop Exit: // Branch B1 Consider the following strategies and show branch prediction strategies tables and accuracies for branch B1 for each of the strategy
Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter13: Decision Making Under Uncertainty
Section13.5: Bayes’ Rule And Decision Trees
Problem 1P
Related questions
Question
Can someone help me
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole