title: 2 bit branch predictor with two for loops
body: <p>I got a 2 bit branch predictor, my starting state is weakly taken and I need to calculate the prediction accuracy:</p>
  
  <pre><code>for (int i=0; i &lt; 100; i++)
  {
     for (int j=0; j &lt; 50; j++)
     {
     ...
     }
  }
  </code></pre>
  
  <p>So with i = 0 we take the branch, so we are at i = 0 and j = 0 and set our predictor to strongly taken, right ? So if we iterate j now, does that mean we are not taking a new branch ? As we are still in the i = 0 branch, or does every iteration count as a new branch ?</p>