answer question 2 please Speed up memory. If you keep the clock the same and add
ID: 658749 • Letter: A
Question
answer question 2 please
Speed up memory. If you keep the clock the same and add a high performance bus and larger multilevel cache can improve memory performance by 4 timesover t le ongma Justify your answer and specify the performance increase over the original by. Calculate the speedup of the fast clock system over the original, Calculate the fraction of time spent in memory instructions for the original system. Calculate the speedup of the fast memory system over the original. Clearly state your choice. What is the C/C++ equivalent of the following MIPS code? add i $t0, $s6, 4 add $t1, $s6, 0 add $s0, $t1, $t0 addi $t2, $t1, $t0 sw $s0, 0($t2) Assume the following register assignments: f = $s0, g = $s1, h=$s2,i=$s3,J=$s4 base addresses of integer arrays A and B are in $s6" find $sfExplanation / Answer
Answer:
addi $t0, $s6, 4
The above instruction refers A[1]. Here, since the inputs are integers, so the array A is referring to the index 1 because off addi function. This will refer to the next immediate address of array A.
Thus $t0 is holding the value of A[1]+4.
add $t1, $s6, 0
The above instruction refers to A[0]. Here, the in general $s6 is considered as A[0]. Hence, $t1 is holding the value of A[0]+0.
add $s0, $t1, $t0
In the above instruction, the contents of the A[0] and A[1] are added and stored in the register $s0. Here it is assumed to be f. Therefore, f=A[0]+A[1].
addi $t2, $s7, 4
In the above instruction it refers to the reference address of B. Here, since the inputs are integers, so the array B is referring to the index 1 because off addi function. This will refer to the next immediate address of array B and it stores the B[1]+4 into $t2
sw $s0, 0($t2)
Thus C/C++ equivalent code is:
$t0=A[1]+4
$t1=A[0]+0
f=A[0]+0+A[1]+4 or f=$t0+$t1
$t2=B[1]+4
B[0]=f
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.