Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A program consists of a large number of instructions with the following mix 40%A

ID: 3841025 • Letter: A

Question


A program consists of a large number of instructions with the following mix 40%ALU 10% store 20% load (of which 60% have values used in the next instruction) 20% branch (determined in the ID stage. taken 40% of the lime and no prediction is done) 0% jump (determined in the ID stage) For the pipelined CPU, what is the formula to determine the actual CPI based on those numbers? A. 40% (1) + 10% (1) + 20%(50%)(2) + 20%(40%(2) + 10%(2) B. 40%(1) + 10%(1) + 20%(1) + 20%(2) + 10%(2) C. 40%(1) + 10%(1) + 20%(50%)(1) + 20%(50%)(2) + 20%(60%)(2) + 20%(40%)(1) + 10%(2) D 40%(1) + 10%(1) + 20%(50%)(1) + 20%(50%)(2) + 20%(40%)(2) + 20%(60%)(1) + 10%(2) The following code is supposed to set St0 to 3 = 0. There is an instruction what is the missing instruction? beq 5t1, $0 Skip ori $t0, $0, 3} end

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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote