How do I calculate Instruction Per Clock?
The computation of instructions per cycles is a measure of the performance of an architecture, and, a basis of comparison all other things being equal.&nbsp; IPC can be used to compare two designs for the same instruction set architecture, as in the question you're asking comparing two design alternatives for a MIPS architecture.

Or, IPC can be used to compare vastly different designs (like CISC vs. RISC).&nbsp; If the processor can execute one instruction per cycle, then the IPC=1.&nbsp;Especially processors in the 1970's were usually were microcoded, and instructions completed in a variable number of cycles, like some in 2 cycles or some instructions in 4.&nbsp; So, for these machines IPC &lt; 1.&nbsp; Some processors using VLIW or EPIC or other architectural designs might complete several instructions in one cycle.

A MIPS processor attempts to execute one instruction per cycle using its pipelined design.&nbsp; However, certain conditions cause it to stall:


waiting for a result that isn't ready, like multiply or divide
waiting for a cache miss to resolve


Other times, it does work, but the work must be thrown away &#8212; this is the case of the branch instruction.&nbsp; More specifically, the issue of how soon the processor can get back onto the right instruction stream.

Let's look more closely at the pipeline for the question you're asking about:
Here the code sequence is 

&lt;x&gt;
B trg
&lt;a&gt;
&lt;b&gt;
&lt;c&gt;


In the following, @trg represents the instruction at the target of the branch, and this is the proper instruction to execute immediately after the branch.

    IF       ID      EX     MEM      WB 
-1  &lt;x&gt;                                 
0   B trg   &lt;x&gt;                         
1   &lt;a&gt;     B trg   &lt;x&gt;                 
2   &lt;b&gt;     &lt;a&gt;     B trg   &lt;x&gt;         
3   &lt;c&gt;     &lt;b&gt;     &lt;a&gt;     B trg   &lt;x&gt; &lt;--- if the branch executes here in the MEM stage, then &lt;a&gt;,&lt;b&gt;&lt;c&gt; are unwanted and have to be discarded.
4   @trg    &lt;c&gt;     &lt;b&gt;     &lt;a&gt;     B   
5           @trg    &lt;c&gt;     &lt;b&gt;     &lt;a&gt; 
6                   @trg    &lt;c&gt;     &lt;b&gt; 
7                           @trg    &lt;c&gt; 
8                                   @trg    


The above shows the branch executing in the MEM stage.&nbsp; Thus, the fetches the processor did for &lt; a >, &lt; b >, and &lt; c > are invalid and have to be discarded.&nbsp; Three cycles are lost or wasted.

    IF       ID      EX     MEM      WB 
-1  &lt;x&gt;                                 
0   B trg   &lt;x&gt;                         
1   &lt;a&gt;     B trg   &lt;x&gt;                 &lt;--- if the branch executes here in the ID stage, then only &lt;a&gt; is lost
2   @trg    &lt;a&gt;     B trg   &lt;x&gt;         
3             @trg  &lt;a&gt;     B trg   &lt;x&gt; 
4                   @trg    &lt;a&gt;     B   
5                           @trg    &lt;a&gt; 
6                                   @trg


Since the ID stage is 2 stages earlier, this processor has a larger IPC.&nbsp; We can use the IPC to ascertain exactly how much faster this design would be, and this demonstrates the value of the IPC definition.



(There is term in sailing and yachting called Velocity Made Good, VMG &#8212; the idea is that even though you're going a certain speed (in sailing: knots, in computing: cycles per second aka hertz), only some of that speed goes to useful work being done (in sailing: reaching the finish line, in computing: completing instructions from the program).&nbsp; VMG for a processor would be instructions / hertz.&nbsp; So, compared to VMG which includes a time component, IPC factors out the time component.)