S4 Computer architecture · Practice
Branch prediction
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 10 kinds solid
Check
A loop of 8 iterations runs many times. What's a 1-bit predictor's misprediction rate on its closing branch?
Check
The same loop, 8 iterations, with a 2-bit counter. What's the misprediction rate?
Check
Branches are 0.15 of instructions, the predictor is 0.9 accurate, and a misprediction costs 20 cycles. How much CPI do mispredictions add?
Check
A core has base CPI 0.4, 0.18 branches and a 12-cycle misprediction penalty. What speedup comes from improving accuracy from 0.92 to 0.98?
Check
500 active branches share a predictor of entries, indexed uniformly. What's the probability a given branch shares its entry with at least one other?
Check
Branches are 0.15 of instructions and 0.6 of them are taken. The BTB finds the target of 0.95 of taken branches; a BTB miss costs 3 cycles. What CPI does it add?
Check
Branches are 0.15 of instructions, predicted with accuracy 0.9 and a 20-cycle penalty, using a table of 2-bit counters (n = 14) shared by 500 active branches.
(a)
What CPI do mispredictions add?
(b)
How many bits is the table?
(c)
What is the chance a given branch shares its entry?
Check
2-bit misprediction rate on a 16-iteration loop?
Check
Misprediction CPI: 0.17 branches, 0.93 accuracy, 22-cycle penalty?
Check
Aliasing chance: 800 branches, entries?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in S4