Home » Computer Organization and Architecture » Computer organization and architecture miscellaneous » Question

Computer organization and architecture miscellaneous

Computer Organization and Architecture

  1. The following code is to run on a pipelined processor with one branch delay slot :
    l1 : ADD R2 < R7 + R8
    l2 : SUB R4 ← R5 – R6
    l3 : ADD R1 ← R2 + R3
    l4 : STORE Memory [R4] ← R1
    BRANCH to Label if R1 = 0
    Which of the instructions I1, I2, I3 or I4 can legitimately occupy the delay slot without any other program modification?
    1. I1
    2. I2
    3. I3
    4. I4
Correct Option: D

I4, the store instruction can be moved below the conditional branch instruction. whether the branch is taken or not, STORE will be executed as the next instruction after conditional branch instruction, due to delayed branching. Here, I3 is not the answer because the branch conditional variable R1 is dependent on it. same for I1, similarly, I4 has a dependency on I2 and hence I2 must be executed before I 4



Your comments will be displayed only after manual approval.