Branch prediction , correlation bit

Posted by Maciej Adrzej on Stack Overflow See other posts from Stack Overflow or by Maciej Adrzej
Published on 2010-06-17T11:10:18Z Indexed on 2010/06/17 11:13 UTC
Read the original article Hit count: 506

Filed under:
|
|

Problem ; Consider following simplified code fragment; if (d==0) d=1; if (d==1) ...

Construct the action table for the 1-bit predictor with 1-bit correlation assuming predictor initialized to NOT TAKEN and the correlation bit is initialized to TAKEN. The value of d alternates 1,2,1,2 Note count the instances of misprediction.

I tried to solve question my answer is ;


|d=?|B1 |B1 |New B1 |B2 |B2 | New B2 |

| |Prediction|Action|Prediction|Prediction|Action|Prediction|

|1 | NT/NT | T | T/NT | NT/NT | NT | NT/NT |

|2 | T/NT | T | T/NT | NT/NT | T | NT/T |

|1 | T/NT | T | T/NT | NT/T | NT | NT/NT |

|2 | T/NT | T | T/NT | NT/NT | T | NT/T |

I doubt whether it is true or not ? Any idea ?

© Stack Overflow or respective owner

Related posts about homework

Related posts about branch