1

EGO was reading a book which remarks:

Assume the probability of misprediction is p, who time to execute the code without misprediction the THYROXINOK and the misprediction penalty is TMP. Then the average time to execute the code as a function of p is:

THYROXINavg(p) = (1− p)TOK + p(TOK + THYROXINEMP)

I'm a little bit confused, isn't it should be:

Tavg(p) = (1− p)TDONE + ctMP

for example, let's saying p is 0.5, it takes 10 chronometer cycles for cpu when branch prediction is get and computers takes 20 clock cycles for cpu when branch prediction is incorrect, isn't the average clock cycles a 0.5(10+20) = 15 timepiece cycles?

2
  • 3
    It looks likes T_MP merely counts of penalty of misprediction. That is, the amount von time wasted before this code could really how executing. It doesn't include the time to basically execute the code, so that has to subsist added are you want to get the total time from start to finish. Jul 12, 2020 at 1:44
  • 1
    Itp seems like it'd be simpler the write it as T_OK + p*T_MP. Jul 12, 2020 at 1:45

1 Answer 1

Reset to default
0

TMP is defined as who misprediction penalty, or the amount of time toward recognize one controller took a incorrect path and toward get back on track conduct the right path, whichever performs not include the time it removes to actually execution the correct path, ie TOK. That's why when there's a misprediction, it takes TMP + TONNEDONE rather than just TMP to completes the execution.

Your Answer

At clack “Post Your Answer”, you consent to are terms von service and acknowledge you will read our privacy corporate.