Question: Assume the following C code: for ( i = 0 ; i < = 2 0 0 0 ; i + + ) { int
Assume the following C code:
fori; i; i
int temp;
temp Xi;
Xi Yi;
Yi temp;
Assume that $s has the address of X and $s has the address of Y and i is in $s
a Write the above code using MIPS instructions.
b How many instructions are executed during running this code.
c Find the performance duration of total execution of above coode in MIPS GHz processor, assuming that arithmetic instruction takes cycle, data transfer instruction takes cycles, conditional branch takes cycles and jump takes cycle.
d Find average CPI for the above code.
e Find performance speed up for above code if data transfer instruction takes cycle using cache.
Solve and explain all soluitons.
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
