Since the clock cycle duration is 1 ns, an instruction requiring tEX nanoseconds in the EX stage takes ⌈tEX/1 ns⌉=⌈tEX⌉ clock cycles.
Whenever an instruction occupies the EX stage for k>1 cycles, the subsequent instruction cannot enter the EX stage for k−1 cycles, leading to k−1 stall cycles per instruction due to structural hazard.
Calculating stalls for each instruction type:
LOAD: tEX=1.8 ns⟹⌈1.8⌉=2 cycles ⟹2−1=1 stall cycle.
Stalls=15×1=15 IMUL: tEX=1.5 ns⟹⌈1.5⌉=2 cycles ⟹2−1=1 stall cycle.
Stalls=10×1=10 IDIV: tEX=2.5 ns⟹⌈2.5⌉=3 cycles ⟹3−1=2 stall cycles.
Stalls=5×2=10 FADD: tEX=1.7 ns⟹⌈1.7⌉=2 cycles ⟹2−1=1 stall cycle.
Stalls=10×1=10 FSUB: tEX=1.7 ns⟹⌈1.7⌉=2 cycles ⟹2−1=1 stall cycle.
Stalls=5×1=5 FMUL: tEX=2.8 ns⟹⌈2.8⌉=3 cycles ⟹3−1=2 stall cycles.
Stalls=15×2=30 FDIV: tEX=3.2 ns⟹⌈3.2⌉=4 cycles ⟹4−1=3 stall cycles.
Stalls=5×3=15 All other instructions: tEX<1.0 ns⟹1 cycle ⟹0 stall cycles.
Stalls=35×0=0
Summing all stall cycles:
Total stall cycles=15+10+10+10+5+30+15+0=95