Pipeline questions Consider the memory location 0x 10000000 has the value 000000
ID: 3707937 • Letter: P
Question
Pipeline questions
Consider the memory location 0x 10000000 has the value 00000014 Sa3 holds the address 0x10000000 and $t1 holds the value 5 Consider the following MIPS code sequence with a 5-stage pipeline without data forwarding: addi Stl, Stl, 2 lw Stl, 0(Sa3) addi $t2, $t1, 5 addi Stl, Stl, 12 What are the contents of the registers St1, St2 and $a3 after the code sequence above is executed? Consider initial values of registers St1 St2 St3 Given below is a sequence of MIPS instructions with a 5-stage pipeline without data forwarding: Loop: sll St2, $t2,1 addi St2, St2, 1 bne Stl, St3, Loop addi Stl, Stl, 1 What are the contents of the registers St1, St2 and St3 after the code sequence is executed?Explanation / Answer
Answer is as follows :
According to Chegg Guidelines, We are allowed to solve only first part of the question, So please repost others.
So now we have
$t1 = 5
$a3 at memory location whcih stores 00000014 in hexadecimal for which decimal equivalent is 00000020 in decimal.
So for given instructions :
a) addi $t1, $t1, 2
The instruction immediately add the 2 with contents of $t1 and store thee result back to $t1.
So $t1 = $t1 + 2
$t1 = 5 + 2 = 7
So upto know $t1 contains 7.
b) lw $t1,0($a3)
it loads the contents of 0 + $a3 to regiter $t1.
We have data 20 in $a3.
So after adding 0+20 = 20 i.e. store in $t1.
So upto know $t1 contains 20
c) addi $t2, $t1, 5
it add the contents of $t1 with 5 and store the result to register $t2.
$t2 = $t1 + 5
$t2 = 20 + 5 = 25
So upto know
$t1 contains 20
$t2 contains 25
d) addi $t1, $t1, 12
It add the contents of $t1 with 12 and store them back to $t1.
So
$t1 = $t1 + 12
$t1 = 20 + 12 = 32
So $t1 contains 32.
So the final contents are :
$t1 = 32
$t2 = 25
$a3 = 20
All the data are in decimal.
if there is any query or you want other part please ask in comments...