ECE437 –Spring 2016 – Homework 3 Solutions
4.12.1 If we use no forwarding, what fraction of cycles are we stalling due to data hazards?
Dependence type # of stall cycles dependences to 1stnext instruction result 2 dependences to both 1stand 2ndnext instruction 2 Dependence to only 2ndinstruction 1
CPI = 1 + 0.35 * 2 + 0.15 * 1 = 1.85
Fraction of stall cycles = 0.85 / 1.85 = 46%. –> ( 46% of the total CPI is in stalling )
4.12.2 If we use, full forwarding, what fraction of the cycles are we stalling due to data hazards?
With full forwarding, the only RAW dependences that cause stalls are those from the MEM stage of onse instruction to the 1stnext instruction. Even this dependences causes only one stall cycles, so we have: CPI = 1 + 0.20 = 1.20
Fraction of stall cycles = 0.2 / 1.20 = 17%
4.12.3 Let us assume that we cannot afford to have three-input Muxes that are needed for full forwarding. We have to decide if it is better to forward only from the EX/MEM pipeline register (next-cycle forwarding) or only from the MEM/WB pipeline register (two-cycle forwarding). Which of the two options results in fewer data stall cycles?
Other samples, services and questions:
When you use PaperHelp, you save one valuable — TIME
You can spend it for more important things than paper writing.