Question

You are given the following code in C, a (2,1) global history predictor (hint: here we need four columns that each holds predictors of size 1 bit, and a number of rows…) and a 2-bit predictor (i.e., (...

You are given the following code in C, a (2,1) global history predictor (hint: here we need four columns that each holds predictors of size 1 bit, and a number of rows…) and a 2-bit predictor (i.e., (0,2) predictor)

for (i=100; i>0; i—-) { // Branch1

if (i mod 2 ==0) { //Branch2

………

} else {

……. }

}

Q 1: Which predictor is the most suitable for Branch1 and why?

Q 2: Which predictor is the most suitable for Branch2 and why?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(1)1-bit branch predictor is the most suitable for Branch1 . Because here next branch situation depends mostly on previous outcome , and 1-bit branch predictor (essentially a flip-flop) records the last outcome of the branch.

(2)2-bit branch predictor is the most suitable for Branch2 . Because here next branch situation is independent from previous branch outcome ,and 2-bit branch predictor does not predict branch on basis of last outcome of the branch.

Add a comment
Know the answer?
Add Answer to:
You are given the following code in C, a (2,1) global history predictor (hint: here we need four columns that each holds predictors of size 1 bit, and a number of rows…) and a 2-bit predictor (i.e., (...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT