Answer: 3
To find the speedup obtained by the pipelined design over the non-pipelined design, we compare the average execution time per instruction for both designs.
1. Non-Pipelined Design
- Clock frequency (fnp) = 2 GHz
- Average cycles per instruction (CPInp) = 6
Since the clock frequency is the same for both designs, we can directly work with the average clock cycles per instruction (CPI).
2. Pipelined Design
- Clock frequency (fp) = 2 GHz
- Ideal CPI = 1
- Data hazard stalls: 20% of instructions incur an average of 2 stall cycles.
- Control hazard stalls: 20% of instructions incur an average of 3 stall cycles.
We calculate the average CPI for the pipelined design (CPIp) as:
CPIp=Ideal CPI+Average Stall Cycles per Instruction=1+(0.20×2)+(0.20×3)=1+0.4+0.6=2
3. Speedup Calculation
Since the clock cycle time (Tclk) is identical for both configurations (1/2 GHz=0.5 ns), the speedup is given by:
Speedup=Execution TimepExecution Timenp=CPIp×TclkCPInp×Tclk=CPIpCPInp
Speedup=26=3
Thus, the speedup obtained by the pipelined design is 3.