Question: Course: ((computer architecture)) a. How many instructions are executed during the running of the following code? b. How many cycles are needed to execute the

Course: ((computer architecture))

Course: ((computer architecture)) a. How many instructions are executed during the running

a. How many instructions are executed during the running of the following code? b. How many cycles are needed to execute the code (all iterations)? c. Calculate the average CPI (cycles per instruction)? d. Calculate the Branch Target Address (loop) when branch is taken? e. Identify the Read after Write (RAW) hazards that exist among the Loop instructions (only)? f. What are the five pipeline stages of a MIPS machine (see table below as a hint)? Write one sentence explaining each stage.

Q3: Assume multiple cycle MIPS: Assume that x and y are arrays of words and the base address of x is in R1 and the base address of y is in R2. If ALU instructions (add and addi) take 1 cycle to execute, load/store (lw and sw) take 5 cycles to execute, and the branch (bne) instruction takes 3 cycles to execute; # TO = i = 0+0 = 0 # T1 = address of x[i] # T2 = address of y[i] Loop: caress addi TO, zero, zero add2 T1, R1, zero add3 T2, R2, zero add4 T3, zero, 101 lw T4, 0 (T2) add5 T5, T4, C sw T5, O (T1) addi1 TO, TO, 1 addi2 T1, T1, 4 addi3 T2, T2, 4 bne TO, T3, -7 add6 TO, TO, 100 add7 T1, T1, 10 # Load T4 with M[T2+0] value # c is a constant value # Store T5 to M[T1+0] # Goes to Loop when taken 240: 244: 248

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!