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.