title: Pipelining -Mips instructions
body: <p>I have confused by using pipelining in mips instruction. Any help will be great. Thanks in advance.</p>
  
  <p>What is the data dependency in the next two codes? Which  of them can be solved by using stall (bubble) or forwarding. You can use the shape 1 for convenience.</p>
  
  <pre><code>          shape 1:
  
             If-Id-Ex-Mem-Wb
  </code></pre>
  
  <hr>
  
  <p>explanation: </p>
  
  <pre><code>if=instruction fetch
  
  id=instruction decode register fetch
  
  ex=execute
  
  mem=memory access
  
  wb=write back 
  </code></pre>
  
  <hr>
  
  <p>code 1:</p>
  
  <pre><code>add $3,$4,$2
  
  sub $5,$3,$1
  
  lw  $6,200($5)
  
  sw  $6,200($2)
  
  lw  $6,200($3)
  
  add $7,$4,$6
  </code></pre>
  
  <p>code 2:</p>
  
  <pre><code>add $3,$4,$2
  
  sub $5,$3,$1
  
  lw $6,200($3)
  
  add $7,$3,$6
  </code></pre>
  
  <p>(sorry for bad post,but i can't yet post an image)</p>
  
  <p>Thanks. </p>