in CO and Architecture retagged by
379 views
2 votes
2 votes
In typical RISC ISA, delayed branch executes which instruction irrespective of whether the branch condition is true or false?
  1. Instruction immediately following the branch condition
  2. Instruction immediately preceding the branch condition
  3. Instruction that belongs to a different a subroutine
  4. It waits till the branch condition is evaluated
in CO and Architecture retagged by
379 views

1 Answer

3 votes
3 votes

This delayed branch allows one or more instructions following the branch to be executed in the pipeline whether the branch is taken or not.

The delayed branch means that the instruction following the branch is always executed before the PC is modified to perform the branch.

In delayed branching solution of control hazards, Instruction immediately following the branch instruction is executed.

Delayed Branch Solution Explained Here: https://www.youtube.com/watch?v=hM2Srz6EZWU&t=9647s 

See Detailed Explanation here also, on GATE 2008 question: GATE 2008 Delayed Branch  

edited by

2 Comments

I have a small doubt… Isn’t option B always correct? Irrespective of whether the branch happens or not, the instruction preceeding this branch instruction must be executed. The only case where I see this is option being wrong is, where we branched to this current branch instruction from another branch instruction(Loop inside a loop situation). But even here we can argue wherever there is a valid instruction preceeding a branch instruction it will be evaluated irrespective of branch evaluates to true or not. 

1
1

@GO Classes can you kindly explain why NOT option b when it is always correct ?

0
0