Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please show all your work. Thank you. Here is an example problem my professor ha

ID: 2079804 • Letter: P

Question

Please show all your work. Thank you.

Here is an example problem my professor has posted that can help solve this one.

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. A program consists of 70% ALU instructions and 30% store instructions. Forwarding is done. b. A program consists of 50% ALU instructions, 20% stores and 30% loads where 50% of the read result is used in the next instruction. c. 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 d. 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

Explanation / Answer

a. 70% are ALU instructions and 30% are store instructions.

For ALU instructions, it takes 1 cycle and for store instructions, it takes 1 cycle.

Thus, CPI = (70/100)*1 + (30/100)*1 = 0.7+0.3=1.0 average cycles per instruction

b. 50% are ALU instructions, 20% are store instructions and 30% are load insructions with 50% of the read result used in the next instructions. Thus, 50% are using no load-use data hazard and 50% are using load-use data hazard.

Thus, CPI = (50/100)*1 + (20/100)*1 + (50/100)*2 + (50/100)*1 = 0.5 + 0.2 + 1 + 0.5 = 1.2 average cycles per instruction.

c. 40% are ALU instructions, 20% are stores, 20% are loads and 20% are jumps. Here, 100% program is using no load-use data hazard.

Thus, CPI = (40/100)*1 + (20/100)*1 + (20/100)(100/100)*1 + (20/100)*2 = 0.4 + 0.2 + 0.2 + 0.4 = 1 average cycle per instruction.

d. 30% are ALU instructions, 20% sw, 30% lw with 20% memory reads, 10% branches and 10% jumps with branches taking 40% of the total time.

ALU : (30/100)*1 = 0.3

Branches: (10/100)(40/100)*2 + (10/100)(60/100)*1 = 0.1*0.4*2 + 0.1*0.6 = 0.08+0.06=0.14

Here, (10/100)(40/100)*2 signifies the branches taken and the other one signifies the branches not taken.

jumps: (10/100)*2 = 0.2

sw: store: (20/100)*1 = 0.2

lw with 20% load-use data hazard: (30/100)(20/100)*2 + (30/100)*(80/100)*1 = 0.3*0.2*2 + 0.3*0.8 = 0.12 + 0.24 = 0.36

Thus CPI = 0.3+0.14+0.2+0.2+0.36=1.2 average cycles per instruction.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote