A program consists of a large number of instructions with the following mix 40%A
ID: 3841025 • Letter: A
Question
Explanation / Answer
Option D is correct.
There will not be any stalls for ALU instructions and store instructions. Hence CPI for those instructions is 1.
There will not be any stalls for Load instructions unless there is data dependency. Since 50% of load instructions have data dependency, therefore CPI for load instructions will be 20%(50%)(1) + 20%(50%)(2).
Since 40% of branch instructions are taken, only those instructions require one extra cycle because we notice branch only after ID stage. Hence CPI for branch instructions will be 20%(40%)(2) + 20%(60%)(1).
Jump instructions need one extra cycle because we notice jump only after ID stage. Hence CPI for jump instructions will be 20%(2).
Therefore, CPI is given by 40%(1) + 10%(1) + 20%(50%)(1) + 20%(50%)(2) + 20%(40%)(2) + 20%(60%)(1) + 10%(2).
Question 22>
Option B is Correct.
Suppose $t0 has a value 2.
After slt instruction, $t1 gets 0 because 0 is not less than 2.
Since $t1 has value 0, branch will be taken and $t0 will be set to 0.
Similarly other cases can be verified.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.