Question: Question 4 ( 3 0 points ) . A MIPS assembly code is shown below. The assembly code is executed using a 5 - stage
Question points A MIPS assembly code is shown below. The assembly code is executed
using a stage MIPS processor and we can actually decide the branch a little earlier, in ID instead
of EX Answer the following questions:
Loop: sub $ $ $
addi $ $
sw $$
addi $$
sll $ $ $
add $ $ $
addi $ $
sll $ $
add $ $ $
lw $$
sub $ $ $
sw $$
beq $ $ Loop
addi $ $
a Identify all the stalls which two instructions or which register are the cause of the stall and the total
number of stalls in the above assembly code. Assume there is no forwarding, no branch prediction, and
no duplicate copies of instruction memory or data memory.
b Reorder the above code to reduce the stalls get the smallest number of stalls without changing the
functionality. Assume there is no forwarding, no branch prediction, and no duplicate copies of instruction
memory or data memory. Identify all the stalls which two instructions or which register are the cause of
the stall and the total number of stalls in the reordered assembly code.
c Reorder the above code to reduce the stalls without changing the functionality get the smallest
number of stalls Assume there is forwarding, no branch prediction, and no duplicate copies of
instruction memory or data memory. Identify all the stalls which two instructions or which register are
the cause of the stall and the total number of stalls in the reordered assembly code.
d Based on c plot the pipeline diagram to show the execution of these instructions and clearly
show the data forwardingbypassing in the pipeline diagram. hint: The instruction sequence is shown
vertically, from top to bottom. Clock cycles are shown horizontally, from left to right. Each instruction is
divided into its component stages. Question points Assuming the following functional unit latencies:
What is the cycle time of a singlecycle implementation? What is the cycle time of a pipelined
implementation?
Given the program below:
lw a
subi $t $t
addi $v$
add $t$$
add $t $a $a
The assembly code is executed using a stage MIPS processor. Plot the pipeline diagram to
show the execution of these five instructions. hint: The instruction sequence is shown vertically, from
top to bottom. Clock cycles are shown horizontally, from left to right. Each instruction is divided into its
component stages.
If the given program is run on the singlecycle implementation, how many cycle does it take to
execute these five instructions? How long does it take to complete execution ns
If the given program is run on the pipelined implementation, how many cycles does it take to
execute these five instructions? How long does it take to complete execution nsQuestion points Given the program below,
li $t
li $t
beq t Exit
addi t
j L
Exit:
How many static instructions in the program? How many dynamic instructions in the program?
Exit is a label not an instruction
Compare the performance of the following two processors:
P: GHz with a CPI of for the given program
P: GHz with a CPI of for the same program
Calculate the CPU execution time of these two processors on the given program. Which processor is
faster in executing the given program? How much faster?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
