Académique Documents
Professionnel Documents
Culture Documents
GENERAL CONCEPTS
Pipeline Classification
There are two areas of computer design where the
pipeline organization is applicable.
1- Instruction pipeline which is explained in the previous
lecture and the beginning of this lecture.
2- Arithmetic pipeline which divides an arithmetic operation
into sub-operations for execution in the pipeline segments
Important Laws
1- No. of clock cycle time= n+m-1
where :
n: No. of tasks.
m: No. of segments.
Solution:
n= 5
m=5
tp =20 ns
= 500 / 180
= 2.777
Gantt’s chart
In order to formulate some performance measures for the
goodness of a pipeline in processing a series of tasks, a space
time chart –table- (called the Gantt’s chart) is used. The chart
shows the succession ( )ﺗﻌﺎﻗ ﺐof the subtasks (segments) in the
pipe with respect to time. The following examples will show you
how to use Gantt’s chart for displaying the execution of the
instruction using pipeline:
EXAMPLE1:-
There are (4) instructions ,Use Gantt’s chart to show how
are they executed in the pipeline .Suppose that the pipe have
(4) segment (FI: fetch instruction, DI: decode instruction ,FO:
fetch operands , EX: execution).
SOLUTION:
1 2 3 4 5 6 7
I1 FI DI FO EX
I2 FI DI FO EX
I3 FI DI FO EX
I4 FI DI FO EX
The chart shows that the four instructions need (7) clock cycles .
EXAMPLE2:-
There are (5) instructions ,Use Gantt’s chart to show how are
they executed in the pipeline .Suppose that the pipe have (5)
segment (FI: fetch instruction, DI: decode instruction ,FO: fetch
operands , EX: execution , SR: save result).
SOLUTION:-
1 2 3 4 5 6 7 8 9
I1 FI DI FO EX SR
I2 FI DI FO EX SR
I3 FI DI FO EX SR
I4 FI DI FO EX SR
I5 FI DI FO EX SR
The chart shows that the five instructions need (9) clock cycles.
Home work:
There are (6) instructions , Suppose that the pipe have (4)
segment (FI: fetch instruction, DI: decode instruction , EX:
execution , WR: write results to the memory) where each
segment take 15ns :-
Unconditional branches
There is on unconditional branch instruction, in some
programming language this instruction is (jmp), in other
language may this type of instruction be (go or goto).
When the pipe encounters such instructions , the pipe empty
itself until the unconditional branch is executed , then start a
new cycle to exexcute the rest of instruction normally.
Example :
Use Gantt chart to show the behaviour of pipeline when (6)
instructions is executed and the third one is unconditional
SOLUTION
1 2 3 4 5 6 7 8 9 10 11 12
I1 Fi DI FO EX
I2 FI DI FO EX
I3 - - FI DI FO EX
(BRANCH)
I4 - - - - - - FI DI FO EX
I5 - - - FI DI FO EX
I6 FI DI FO DI
Important Laws :
= (6+4-1)+(1× (4-1))
= 9+ 3
= 12
2- Total time with pipe = No. of clock cycle × tp
= 12 × tp
Example :
Use Gantt chart to show the behaviour of pipeline when (6)
instructions is executed and the third one is conditional branch
instruction. Suppose the each instruction has 4 segments .
Sol :
There was only one conditional instruction ,
so we draw 21 = 2 charts
The first chart when the branch condition is achieved :
1 2 3 4 5 6 7 8 9 10 11 12
1 Fi DI FO EX
2 FI DI FO EX
3 - - FI DI FO EX
(BRANCH)
4 - - - - - - FI DI FO EX
5 - - - FI DI FO EX
6 FI DI FO DI
4 - - - FI DI FO EX
5 - - - - FI DI FO EX
6 - - - - - FI DI FO EX