Question: SHORT ANSWER: Given the following MIPS code: lw $s1, 0($s5) add $t0, $s1, $s2 beq $t0, $t1, next sub $t2, $t1, $t0 addi $t2, $t2,

SHORT ANSWER:

Given the following MIPS code:

lw $s1, 0($s5)

add $t0, $s1, $s2

beq $t0, $t1, next

sub $t2, $t1, $t0

addi $t2, $t2, 1

j after

next: sw $s1, 20($t1)

after: sw $t0, 0($s5)

Considering the above code, and a multi-cycle processor. In which cycle of the program run does the ALU add the values from registers $s1 and $s2? Assume the first instruction starts running in cycle 1.

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!