Coa Unit 4
Coa Unit 4
Instruction Pipeline :
• In this a stream of instructions can be executed by overlapping fetch,
decode and execute phases of an instruction cycle.
• This type of technique is used to increase the throughput of the
computer system, An instruction pipeline reads instruction from the
memory while previous instructions are being executed in other segments
of the pipeline.
• Thus we can execute multiple instructions simultaneously. The pipeline
will be more efficient if the instruction cycle is divided into segments of
equal duration.
• In general case computer needs to process each instruction in following
sequence of steps:
1. Fetch the instruction from memory (FI)
2. Decode the instruction (DA)
3. Calculate the Effective Address
4. Fetch the operands from memory (FO)
5. Execute the instruction (EX)
6. Store the result in the proper place
The flowchart for instruction pipeline
example:
Arithmetic Pipeline :
arithmetic pipeline :
The following sub operations are performed in this case:
1.Compare the exponents.
2.Align the mantissas.
3.Add or subtract the mantissas.
4.Normalise the result
First of all the two exponents are compared and the larger of two exponents is
chosen as the result exponent.The difference in the exponents then decides how
many times we must shift the smaller exponent to the right. Then after shifting
of exponent, both the mantissas get aligned. Finally the addition of both
numbers take place followed by normalisation of the result in the last segment.
Example 1:
Let us consider two numbers,
X=0.3214*10^3 and Y=0.4500*10^2
Explanation:
Difference of the components 3 - 2=1.
Thus 3 becomes the exponent of result and the smaller exponent is shifted 1
times to the right to give
Y=0.0450*10^3
Example 2:
X=0.9504*10^3 and Y=0.8200*10^2
Difference of the components 3 - 2=1 ,3 becomes the exponent of result and the
smaller exponent is shifted 1 time to right to give
Y=0.08200*10^3
finally the two numbers are added to produce Z=1.0324*10^3
RISC PIPELINE :
• RISC Instructions are Simple
• Memory Operations are limited to Load and Store Operations
• Almost all instructions can be executed in Single Clock cycle
• These characteristics are useful in creating an effective instruction
pipeline for RISC
Three -Segment Instruction Pipeline
I : Instruction fetch
A : ALU Operation
E :Execute instruction
• The I segment fetches the instruction from program memory. The
instruction is decoded and an ALU operation is performed in the A
segment.
• The ALU is used for three different functions, depending on the decoded
instruction. It performs an operation for a data manipulation instruction, it
evaluates the effective address for a load or store instruction, or it
calculates the branch address for a program control instruction.
• The E segment directs the output of the ALU to one of three destinations,
depending on the decoded instruction.
it transfers the result of the ALU operation into a destination register in
the register file, it transfers the effective address to a data memory for
loading or storing, or it transfers the branch address to the program
counter.
DELAYED BRANCH