Speedup factor = Time to execute 100000 inst on non pipeline machine/ Time to execute 100000 inst on pipelined machine
Time to execute 100000 inst on non pipeline machine = No of inst * No of stages of pipeline * time for each stage
= 100000 * 4 * 10 - (A)
Time to execute 100000 inst on pipelined machine:
Clock cycles per inst = 1 + %Branch inst * No of Stall cycles due to branch
= 1 + 0.3 * 3 = 1.9
-> Time to execute 100000 inst = No of instructions * Clock cycles per inst * time for 1 clock cycle(which is same as time taken by pipeline stage having maximum delay. Here each stage takes 10 ns).
= 100000 * 1.9 * 10. - (B)
Now, just divide (A) & (B) to get 2.105 as the answer.
Another method:
Speedup = No of pipeline stages/ 1 + %branch * no of stall cycles due to branch (This formula is derived by using argument similar to what is given above).
= 4/(1+0.3*3)
=2.105