Pipelining Processor

25 年 9 月 13 日 星期六 (已编辑)
336 字
2 分钟

Pipelining Processor

Pipelining is a technique used in modern processors to improve performance by executing multiple instructions simultaneously. It breaks down the execution of instructions into several stages, where each stage completes a part of the instruction. These stages can overlap, allowing the processor to work on different instructions at various stages of completion.

Design of a basic Pipeline

  • In a pipleined processor, a pipeline has two ends, the input and the output end. Between these ends, there are multiple stages/segments such that the output of one stage is connected to the input of the next stage and each stage performs a specific operation.
  • Interface registers are used to hold the intermediate output between two stages. These interface registers are also called buffer.
  • All the stages in the pipeline along with the interface registers are controlled by a common clock.

Execution in a pipelined processor Execution sequence of instructions in a pipelined processor can be visualized using a space-time diagram. For example, consider a processor having 4 stages and let there be 2 instructions to be executed. We can visualize the execution sequence through the following space-time diagrams:

Non-Overlapped Execution

Stage / Cycle12345678
S1I1I2
S2I1I2
S3I1I2
S4I1I2

Total time = 8 Cycles

Overlapped Execution

Stage / Cycle12345
S1I1I2
S2I1I2
S3I1I2
S4I1I2

Total time = 5 Cycles

Pipeline Stages RISC processor has 5 stage instruction pipeline to execute all the instructions in the RISC instruction set. Following are the 5 stages of the RISC pipeline with their respective operations:

  • Stage 1 (Instruction Fetch): CPU fetches the instructions from the memory.
  • Stage 2 (Instruction Decode): The instruction is decoded and register file is accessed to obtain the value of registers used in the instruction.
  • Stage 3 (Instruction Execute): In this stage some of activities are done such as ALU operations.
  • Stage 4 (Memory Access): In this stage, memory operands are read and written from/to the memory that is present in the instruction.
  • Stage 5 (Write Back): In this stage, computed/fetched value is written back to the register present in the instructions.

Conclusion

Pipelining is one of the most essential concepts and it improes CPU's capability to process several instructions at the same tiem across various stages.

文章标题:Pipelining Processor

文章作者:Jorthan

文章链接:https://jorthan.com/posts/pipelining_processor[复制]

最后修改时间:


商业转载请联系站长获得授权,非商业转载请注明本文出处及文章链接,您可以自由地在任何媒体以任何形式复制和分发作品,也可以修改和创作,但是分发衍生作品时必须采用相同的许可协议。
本文采用CC BY-NC-SA 4.0进行许可。