If the branch is taken in a pipeline, the PC is normally not updated until the end of which stage if there is no branch prediction

137 views
Skip to first unread message

Anshul Gupta

unread,
May 19, 2021, 11:23:14 AM5/19/21
to Computer Organisation and Architecture
If the branch is taken in a pipeline, the PC is normally not updated until the end of which stage if there is no branch prediction.

Assume the stages are Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory (MEM) and Write Back (WB).

If suppose I got a question like this then at what stage the branch instruction be executed?

Consider an instruction pipeline with five stages without any branch prediction: Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Execute (EX) and Operand Write (OW). The stage delays for IF, ID, OF, EX and OW are 5 nsec, 7 nsec, 10 nsec, 8 nsec and 6 nsec, respectively. There are intermediate storage buffers after each stage and the delay of each buffer is 1 nsec. A program consisting of 12 instructions I1, I2, …, I12 is executed in the pipelined processor. Instruction I4 is the only branch instruction and its branch target is I9. If the branch is taken during the execution of this program, the time needed to complete the program is

Smruti R. Sarangi

unread,
May 19, 2021, 11:43:44 AM5/19/21
to Anshul Gupta, Computer Organisation and Architecture
The answer is there in Chapter 9. All the stage delays have to be the same.

--
You received this message because you are subscribed to the Google Groups "Computer Organisation and Architecture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to archbooksaran...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/archbooksarangi/ea0d2596-e1b6-42bf-adec-f094195a3659n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anshul Gupta

unread,
May 20, 2021, 2:41:50 AM5/20/21
to Smruti R. Sarangi, Computer Organisation and Architecture
Thank you for the clarification. 

Yours sincerely
Anshul Gupta
Reply all
Reply to author
Forward
0 new messages