Question

Consider the following MIPS code and a 5 stages processor as discussed in class, and assume...

Consider the following MIPS code and a 5 stages processor as discussed in class, and assume the loop executes 3 times:

loop: lw r1,4(r7)

lw r2,8(r7)

lw r3,12(r7)

add r1,r1, r3

sw r1,4(r7)

bne r1,r2,loop

addi r1,r1,42

c. Draw the execution diagram. (10 points)

d. The CPI (cycles per instruction) is obtained by computing the ratio of total cycles to number of instructions. Compute the CPI for the for the pipeline on this code. (5 points)

Homework Answers

Answer #1

PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The following code runs on a microprocessor with five pipelined stages. In the code lw is...
The following code runs on a microprocessor with five pipelined stages. In the code lw is a load word and sw is a store word. The register on the far right is the target register for lw and add and source for sw. The memory latency is 2 cycles. lw 0(r1),r2 label1:    beq r2,r0,label2 # not taken once, then taken lw 0(r2),r3 beq r3,r0,label1 # taken add r1,r3,r1 label2: sw 0(r2),r1 Identify all the possible hazards that may exist in...
Assume a five-stage single-pipeline microarchitecture (fetch, decode, execute, memory, write- back) and the code given below....
Assume a five-stage single-pipeline microarchitecture (fetch, decode, execute, memory, write- back) and the code given below. All ops are one cycle except LW and SW, which are 1+2 cycles, and branches, which are 1+1 cycles. There is no forwarding. Show the phases of each instruction per clock cycle for one iteration of the loop. Loop: lw x1,0(x2)       addi x1,x1, 1       sw x1,0(x2)       addi x2,x2,4       sub x4,x3,x2       bnz x4,Loop How many clock cycles per loop iteration...
Consider the following code segment, where the branch is taken 30% of the time and not-taken...
Consider the following code segment, where the branch is taken 30% of the time and not-taken 70% of the time. R1 = R2 + R3 R4 = R5 + R6 R7 = R8 + R9 if R10 = 0, branch to linex R11 = R12 + R13 R14 = R11 + R15 R16 = R14 + R17 ... linex: R18 = R19 + R20 R21 = R18 + R22 R23 = R18 + R21 ... Consider a 10-stage in-order processor,...
(MIPS Assembly Language): Assume the following piece of MIPS code: label1: .text 0x4000fc lui $t0, 1022...
(MIPS Assembly Language): Assume the following piece of MIPS code: label1: .text 0x4000fc lui $t0, 1022 ori $t0, $t0, 2048 srl $t1, $t0, 18 sw $t0, 101($t1) slti $t2, $t1, 5 beq $t2, $0, label3 label2:... ... label3:... a) The code modifies a word in memory at the following address (circle one): (i) 1022 (ii) 101 (iii) 5 (iv) 10220000 (v) Other (provide your own answer): _________________ b) The following value is stored in memory (circle one): (i) 0x17 (ii)...