Skip to main content

Pipelining in Computer Architecture

Pipelining in Computer Architecture

Pipelining is a technique to process the data in parallel way . In this technique multiple instructions are overlapped during execution. Pipeline is divided into stages and Each stage completes a part of an instruction in parallel.

Pipelining increases the overall Throughput of executing instructions . Throughput of

Types of Pipelines -

  • Arithmatic Pipeline -The arithmetic pipeline represents the parts of an arithmetic operation that can be broken down and overlapped as they are performed .
  • Instruction Pipeline - The instruction pipeline represents the stages in which an instruction is moved through the processor, including its being fetched, perhaps buffered , decoding , and then executed. Instruction pipelining is a technique used in the design of modern microprocessors, microcontrollers and CPUs to increase their instruction throughput .
Instruction Throughput = The number of instructions that can be executed in a unit of time .
Basically CPUs are driven by a clock. The CPU consists internally Flip flops means both Logic and Memory . When the clock signal arrives, the flip flops store their new value then the logic requires a period of time to decode the new values of flip flops . Then the next clock pulse arrives and the flip flops store another values, and so on. By breaking the logic into smaller pieces and inserting flip flops between pieces of logic, the time required by the logic is reduced . In this way the clock period can be reduced.

A Pipeline may be of 3-stages , 4-stages , 5-stages .
A 5-stage pipeline contains five stages with a set of flip flops between each stage as follows :

  • Instruction fetch
  • Instruction decode and register fetch
  • Execute
  • Memory access
  • Register write back
Working of pipeline among the different stages is the shown in diagram -
Pipelining in Computer Architecture


Advantages of Pipelining -

  • Pipeline reduces the cycle time of the processor and increases the instruction throughput.
  •  Pipelining increases the number of instructions that can be processed simultaneously at same time . Pipelining reduces the delay between completed instructions .

Disadvantages of Pipelining - 

  • Pipelined processors or CPU's are costly rather than Non-Pipelined processors are cheaper with the simpler design .
  • In pipelining , we use Flip-Flops between modules . Using the Flip-Flops increases the Instruction Latency .
  • The performance of a pipelined processor is much harder to predict and may vary for different programs .
  • Sometimes Hazards is the main disadvantage .
Hazard - When a programmer Compiles writes assembly code, they generally assume that each instruction is executed before the next instruction execution . When this assumption is not validated or understood by pipelining it causes the incorrect behaviour , called Hazards . 

Comments