Total number of instructions = 100.
assuming stages are – IF ID EX MA WB and ID stage utilized for operand fetch. Also, ID and WB cannot overlap.
then 1st instruction takes 5 cycles, after that each instruction adds 4 cycles.
Total cycles = 5+(99*4) = 401
then average CPI = 4.01
If ID and WB can overlap, then
Total cycles = 5+(99*3) = 302, so then average CPI = 3.02