Let's say you have broken the execution of an instruction into N steps which are performed by an N-stage pipeline. It takes N clock cycles to run an instruction through N stages. That is, it takes N cycles to complete execution of each instruction.All N stages can be working at the same time. However, each stage is working on a different instruction. Ideally the pipeline is working on N instructions at the same time. Each clock cycle a new instruction enters the pipeline and each clock cycle the oldest instruction completes and vanishes from the pipeline.Let's say you're executing three instructions A, B, and C:During clock cycle 1, instruction A step 1 is performed by pipeline stage 1.
At the beginning of clock cycle 2, the result of instruction A step 1 is passed to stage 2 and instruction B enters stage 1.
During clock cycle 2, instruction B step 1 is performed by stage 1 and simultaneously instruction A step 2 is performed by stage 2.
At the beginning of clock cycle 3, the result of instruction A step 2 is passed to stage 3, the result of instruction B step 1 is passed to stage 2 and instruction C enters stage 1.During clock cycle 3, all three stages are working: stage 1 on instruction C step 1, stage 2 on instruction B step 2, and stage 3 on instruction A step 3.
If N = 3, at the end of clock cycle 3 instruction A is complete and vanishes from the pipeline.Hope this helps.