4. Do the following problems: A pipelined processor has a clock rate of 2.5 GHz
ID: 3739960 • Letter: 4
Question
4. Do the following problems: A pipelined processor has a clock rate of 2.5 GHz and executes a program with 1.5 million instructions. The pipeline has 5 stages and the instructions are issued at a rate of one per clock cycle. Ignore penalties due to branch instructions and out-of-sequence executions. (x) What is the Speed up of the processor this program compared to a non-pipelined processor? (xx) What is the Throughput (in MIPS) of the pipelined processor? Assume a pipeline has 4 stages: FI (fetch instruction), DA (decode instruction and calculate addresses), FO (fetch operand), EX (execute). Draw a pipeline timing diagram for a sequence of 9 instructions in which the third instruction is a branch that is taken, and there are no data dependencies. a. b.Explanation / Answer
a) Speed up of a pipeline is defined as:
Speed up = no. of cycles taken by a non pipeline architecture/no. of cycles taken by a pipeline architecture
Let s see the no. of cycles required by te non pipeline first,
There are 1.5 million i.e. 1500000 instructions and each of the instruction is taking 5 clock cycles
No. of clock cycles in non pipeline architecture = 1500000x5 = 7500000
In pipeline architecture, first instruction will take 5 clock cycles and after that 1 instruction will be completed every clock cycle, So,
No. of cycles required in pipeline architecture = 5 + 1499999 = 1500004
Speed Up = 7500000/1500004 = 4.999
Throughput of a pipeline is defined as the no of instruction completed per second. According to the given information, processoor has a clock rate of 2.5 GHz i.e there are 1000000000 cycles in 1 second
no. of instructions completed in 1 second = (1500004/1500000)*1000000000 = 1000002666.667
Throughput = 1000002666.667 = 1000 MIPS (aprox.)
b) For the sake of convenience, assume instruction 3 branches to instrction 5
c) (x) resource hazard
Consider an example of four stage pipeline given in part b, Assume the data is stored in cache, which is accessed through a common bus used by all the stages. here when we perform the FI, we need to access the memory and when we perform the FO, then also we need to access the memory. When the first instruction will be performing Fo, the third instruction will not be able to perform FI, so, it will be delayed. This is hazard is resource hazard
(xx) Data Hazard
RAW - consider an example where in two instructions, one instruction is trying ti write the data to the operand another instruction is trying to read the same data.
I1: X = A+B
I2: Y = X+C
Here, I2 will try to read value of X before I1 has written it, this type of hazard is RAW
WAR- consider the following instructions:
I1: X = A + B
I2: A = C
If I2 performs the write on A before I1 could read it will create problem, it type of hazard is WAR data hazard
WAW-consider the example
I1: X = A*B
I2: X = C
Second instruction will take much less time than the first instruction, so, second instruction will write in X before I1, and final write will be performed by I1, which will create problem. This type of hazard is WAW data hazard
(xxx) Control Hazard
Consider a set of 9 instructions, if branch instructions are present in the set of instruction, next instruction to be fetched may not be the instruction in sequence. For example, let 3rd instruction is the branched instruction, and it brances to 7th insruction, then, after the 3rd instruction finish, we will come to know that next instruction to be fetched is 7, so, instruction currently being fetched or decoded are of no use and we will have to flush the pipeline and start fetching 7th instruction. This type of hazard in contro hazard
Instr. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 I1 FI1 DA1 FO1 EX1 I2 FI2 DA2 FO2 EX2 I3 FI3 DA3 FO3 EX3 I4 FI4 DA4 FO3 I5 FI5 DA6 I7 FI7 I4 FI4 DA4 FO4 EX4 I5 FI5 DA5 FO5 EX5 I6 FI6 DA6 FO6 EX6 I7 FI7 DA7 FO7 EX7 I8 FI8 DA8 FO8 EX8 I9 FI9 DA9 FO9 EX9Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.