title: What is the number of cycles needed to execute the following loop?
body: <blockquote>
    <p>Consider a 4 stage pipeline processor. The number of cycles needed by
     the four instructions I1, I2, I3, I4 in stages S1, S2, S3, S4 is shown below:</p>
  </blockquote>
  
  <pre><code>    S1    S2    S3    S4
  I1  2     1     1     1
  I2  1     3     2     2
  I3  2     1     1     3
  I4  1     2     2     2 
  </code></pre>
  
  <blockquote>
    <p>What is the number of cycles needed to execute the following loop?</p>
  </blockquote>
  
  <pre><code>For (i=1 to 2) {I1; I2; I3; I4;}
  </code></pre>
  
  <p>Options are:</p>
  
  <ol>
  <li><p>16</p></li>
  <li><p>23</p></li>
  <li><p>28</p></li>
  <li><p>30</p></li>
  </ol>
  
  <hr>
  
  <p><strong>My explanation :</strong></p>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/3SA2Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3SA2Y.png" alt="enter image description here"></a></p>
  
  <p>where I'm wrong ?</p>