787 views
1 1 vote

So I know pipelining has 5 stages: IF, ID, EX, MA, WB.

  1. Now the question is if I have a program of few instruction which has both ALU operation and LOAD/store operation in any sequence. So tell me among the 5 stages how many stages will be reqiured for ALU and how many for LOAD/STORE.

1 Answer

Best answer
1 1 vote
In a pipelined processor, the execution of instructions is divided into several stages, which are performed in parallel for different instructions. The stages of a pipelined processor are:

 

1. Instruction fetch (IF): In this stage, the instruction is fetched from memory and placed in the instruction register (IR).

 

2. Instruction decode (ID): In this stage, the instruction is decoded and the operands are fetched from the registers.

 

3. Execution (EX): In this stage, the instruction is executed. If the instruction is an ALU operation, it will be executed in this stage.

 

4. Memory access (MA): In this stage, the processor accesses data from memory if the instruction is a load or store operation.

 

5. Write back (WB): In this stage, the result of the instruction is written back to the register file.

 

So, if the instruction is an ALU operation, it will be executed in the EX stage. If the instruction is a load or store operation, it will be executed in the MA stage.

Note that the stages of the pipeline are executed in parallel for different instructions. This means that while one instruction is being executed in the EX stage, another instruction may be in the ID stage, and another instruction may be in the IF stage. This allows the processor to overlap the execution of instructions and achieve higher performance.
• selected by
Position:
Show:

Related questions

79 79 votes
11 answers 11 answers
34.0k
34.0k views
go_editor asked Sep 28, 2014
33,979 views
Consider a $6$-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is exec...
199 199 votes
9 answers 9 answers
79.0k
79.0k views
Kathleen asked Sep 22, 2014
78,971 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
74 74 votes
4 answers 4 answers
36.0k
36.0k views
Kathleen asked Sep 12, 2014
35,950 views
Which of the following are NOT true in a pipelined processor?Bypassing can handle all RAW hazardsRegister renaming can eliminate all register carried WAR hazardsControl h...
0 0 votes
2 2 answers
914
914 views
Divyanshu Shukla asked Jan 6, 2022
914 views
Consider a pipeline processor with 5 stages S1 to S5. We want to execute the following loops:while(i<=1) {I1,I2,I3,I4} where i=0. Time (ns) taken by the instruction I1 to...