CPI for non pipelined processor :
occurrence of certain type of instruction x cycles taken by that instruction
(0.15 * 5) + (0.2 * 4) + (0.15*3) +
(0.5 *4) = 4.00
Speedup if this is executed on a 5 stage pipelined processor :
speedup = CPI ( non pipelined) / CPI ( pipelined)
In an ideal pipeline CPI =1
but as mentioned in question it will either fetch instruction or store/load in a cycle
so loading( data read) and storing ( data write) will take additional cycles
1 ( what an ideal inst take in pipeline) + ( load or store *1)
1+ (0.15+0.2)*1
1.35
speedup 4.00/1.35 = 2.963