Question: 4. Branch Prediction [20 points] Let's assume we have a processor that does dynamic branch prediction. The processor's branch history table has 8 entries and

 4. Branch Prediction [20 points] Let's assume we have a processor

4. Branch Prediction [20 points] Let's assume we have a processor that does dynamic branch prediction. The processor's branch history table has 8 entries and each entry in the branch history table is 1 bit. For this problem, assume the PC is initially 32 and the branch history table's initial values are as shown Hints: $0 contains 0 always. addi $t, $s, imm; // $t -$s + imm 1 in the value field of BHT indicates "predict taken". Loop Code Initial Contents of the BHT Address Instructions Entry Value 32 36lab2: addi $1,S0,.5 40 addi $3,50,5 0 lab1: add $2,$2,$2 2 48 52 56 60 subu $1,S1,1 bne $1,S0,labl subu S3,S3,1 bne $3,S0,lab2 add S9,$20,$21 (a) How many branches does this code execute? (b) How many of the branches are predicted correctly!? (c) What is the branch prediction accuracy? 4. Branch Prediction [20 points] Let's assume we have a processor that does dynamic branch prediction. The processor's branch history table has 8 entries and each entry in the branch history table is 1 bit. For this problem, assume the PC is initially 32 and the branch history table's initial values are as shown Hints: $0 contains 0 always. addi $t, $s, imm; // $t -$s + imm 1 in the value field of BHT indicates "predict taken". Loop Code Initial Contents of the BHT Address Instructions Entry Value 32 36lab2: addi $1,S0,.5 40 addi $3,50,5 0 lab1: add $2,$2,$2 2 48 52 56 60 subu $1,S1,1 bne $1,S0,labl subu S3,S3,1 bne $3,S0,lab2 add S9,$20,$21 (a) How many branches does this code execute? (b) How many of the branches are predicted correctly!? (c) What is the branch prediction accuracy

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!