I need help with this. thank you 2. Determine the effective or average CPI for e
ID: 3890181 • Letter: I
Question
I need help with this. thank you
2. Determine the effective or average CPI for each of the following. Assume that the program in all cases is very large and forwarding is done. Show your work A program consists of 70% ALU instructions and 30% store instructions. Forwarding is done A program consists of 50% ALU instructions, 20% stores and 30% loads where 50% of the read result is used in the next instruction. A program consists of 40% ALU instructions, 20% stores and 20% loads and 20% jumps. None of the read result is used in the next instruction. A program consists 30% ALU instructions, 20% sw, 30% lw where 20% of the memory reads are used in the next instructions, 10% branches and 10% jumps. Branches are taken 40% of the time. There are no data dependencies with the branches causing delays. Forwarding is done. a. b. C. d.Explanation / Answer
2)
Since the time for each operation is not given I assume that for ALU it takes x and memory it takes y. The ratio will also work here.
a)
time will be 0.7x + 0.3y
b)
here the load result is used again so it will increase the speed by 2.
cpi will be 0.5x + 0.2*stores+0.3*2*loads
c)
0.4*alu + 0.2*read+0.2*write+0.2*jump
d)
0.3*alu+0.2*strore+0.3*1.2*loads + 0.1*br*0.4 + 0.1*ju
branches will have a negative impact on cpi as it causes flushes in the pipeline therefore we need to consider the effectiveness of the branch predictor here and therefoe I have multipled it by 0.4 for br.
Since the values and time/ratio for execution is not known we cannot direcly give the exact cpi.