A 5-stage pipelined processor has Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Perform Operation (PO) and Write Operand (WO) stages. The IF, ID, OF and WO stages take 1 clock cycle each for any instruction. The PO stage takes 1 clock cycle for ADD and SUB instructions, 3 clock cycles for MUL instruction, and 6 clock cycles for DIV instruction respectively. Operand forwarding is used in the pipeline. What is the number of clock cycles needed to execute the following sequence of instructions? Instruction Meaning of instruction I0 : MUL R2, R0, R1 R2← R0 * R1 I1 : DIV R5, R3, R4 R5 ← R3 / R4 I2 : ADD R2, R5, R2 R2 ← R5 + R2 I3 : SUB R5, R2, R6 R5 ← R2 – R6

A 5-stage pipelined processor has Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Perform Operation (PO) and Write Operand (WO) stages. The IF, ID, OF and WO stages take 1 clock cycle each for any instruction. The PO stage takes 1 clock cycle for ADD and SUB instructions, 3 clock cycles for MUL instruction, and 6 clock cycles for DIV instruction respectively. Operand forwarding is used in the pipeline. What is the number of clock cycles needed to execute the following sequence of instructions? Instruction Meaning of instruction I0 : MUL R2, R0, R1 R2← R0 * R1 I1 : DIV R5, R3, R4 R5 ← R3 / R4 I2 : ADD R2, R5, R2 R2 ← R5 + R2 I3 : SUB R5, R2, R6 R5 ← R2 – R6 Correct Answer 15

Key Points

It is given that there is operand forwarding. In the case of operand forwarding, the updated value from the previous instruction's PO stage is forwarded to the present instruction's PO stage. Here there's a RAW dependency between I1-I2 for R5 and between I2-I3 for R2. These dependencies are resolved by using operand forwarding as shown in the below table. The total number of clock cycles needed is 15.

CLK IF ID OF PO WO
1 I0        
2 I1 I0      
3 I2 I1 I0    
4 I3 I2 I1 I0  
5 I3 I2 I1 I0  
6 I3 I2 I1 I0  
7   I3 I2 I1 I0
8   I3 I2 I1  
9   I3 I2 I1  
10   I3 I2 I1  
11   I3 I2 I1  
12   I3 I2 I1  
13     I3 I2 I1
14       I3 I2
15         I3

clock cycles=15.

Hence the correct answer is 15.

Related Questions

Read the passage carefully and choose the best answer to each question out of the four alternatives and click the button corresponding to it. The Alaska pipeline starts at the frozen edge of the Arctic Ocean. It stretches southward across the largest and northernmost state in the United States, ending at a remote ice-free seaport village nearly 800 miles from where it begins. It is massive in size and extremely complicated to operate. The steel pipe crosses windswept plains and endless miles of delicate tundra that tops the frozen ground. It weaves through crooked canyons, climbs sheer mountains, plunges over rocky crags, makes its way through thick forests, and passes over or under hundreds of rivers and streams. The pipe is 4 feet in diameter, and up to 2 million barrels (or 84 million gallons) of crude oil can be pumped through it daily. Resting on H-shaped steel racks called "bents", long sections of the pipeline follow a zigzag course high above the frozen earth. Other long sections drop out of sight beneath spongy or rocky ground and return to the surface later on. The pattern of the pipeline's up-and-down route is determined by the often harsh demands of the arctic and subarctic climate, the tortuous lay of the land, and the varied compositions of soil, rock, or permafrost (permanently frozen ground). A little more than half of the pipeline is elevated above the ground. The remainder is buried anywhere from 3 to 12 feet, depending largely upon the type of terrain and the properties of the soil. One of the largest in the world, the pipeline cost approximately $8 billion and is by far the biggest and most expensive construction project ever undertaken by private industry. In fact, no single business could raise that much money, so 8 major oil companies formed a consortium in order to share the costs. Each company controlled oil rights to particular shares of land in the oil fields and paid into the pipeline-construction fund according to the size of its holdings. Today, despite enormous problems of climate, supply shortage, equipment breakdowns, labour disagreements, treacherous terrain, a certain amount of mismanagement, and even theft, the Alaska pipeline has been completed and is operating.
Which of the following were not problems faced while constructing the pipeline?
Read the passage carefully and choose the best answer to each question out of the four alternatives and click the button corresponding to it. The Alaska pipeline starts at the frozen edge of the Arctic Ocean. It stretches southward across the largest and northernmost state in the United States, ending at a remote ice-free seaport village nearly 800 miles from where it begins. It is massive in size and extremely complicated to operate. The steel pipe crosses windswept plains and endless miles of delicate tundra that tops the frozen ground. It weaves through crooked canyons, climbs sheer mountains, plunges over rocky crags, makes its way through thick forests, and passes over or under hundreds of rivers and streams. The pipe is 4 feet in diameter, and up to 2 million barrels (or 84 million gallons) of crude oil can be pumped through it daily. Resting on H-shaped steel racks called "bents", long sections of the pipeline follow a zigzag course high above the frozen earth. Other long sections drop out of sight beneath spongy or rocky ground and return to the surface later on. The pattern of the pipeline's up-and-down route is determined by the often harsh demands of the arctic and subarctic climate, the tortuous lay of the land, and the varied compositions of soil, rock, or permafrost (permanently frozen ground). A little more than half of the pipeline is elevated above the ground. The remainder is buried anywhere from 3 to 12 feet, depending largely upon the type of terrain and the properties of the soil. One of the largest in the world, the pipeline cost approximately $8 billion and is by far the biggest and most expensive construction project ever undertaken by private industry. In fact, no single business could raise that much money, so 8 major oil companies formed a consortium in order to share the costs. Each company controlled oil rights to particular shares of land in the oil fields and paid into the pipeline-construction fund according to the size of its holdings. Today, despite enormous problems of climate, supply shortage, equipment breakdowns, labour disagreements, treacherous terrain, a certain amount of mismanagement, and even theft, the Alaska pipeline has been completed and is operating.
The Alaskan pipeline ends
Read the passage carefully and choose the best answer to each question out of the four alternatives and click the button corresponding to it. The Alaska pipeline starts at the frozen edge of the Arctic Ocean. It stretches southward across the largest and northernmost state in the United States, ending at a remote ice-free seaport village nearly 800 miles from where it begins. It is massive in size and extremely complicated to operate. The steel pipe crosses windswept plains and endless miles of delicate tundra that tops the frozen ground. It weaves through crooked canyons, climbs sheer mountains, plunges over rocky crags, makes its way through thick forests, and passes over or under hundreds of rivers and streams. The pipe is 4 feet in diameter, and up to 2 million barrels (or 84 million gallons) of crude oil can be pumped through it daily. Resting on H-shaped steel racks called "bents", long sections of the pipeline follow a zigzag course high above the frozen earth. Other long sections drop out of sight beneath spongy or rocky ground and return to the surface later on. The pattern of the pipeline's up-and-down route is determined by the often harsh demands of the arctic and subarctic climate, the tortuous lay of the land, and the varied compositions of soil, rock, or permafrost (permanently frozen ground). A little more than half of the pipeline is elevated above the ground. The remainder is buried anywhere from 3 to 12 feet, depending largely upon the type of terrain and the properties of the soil. One of the largest in the world, the pipeline cost approximately $8 billion and is by far the biggest and most expensive construction project ever undertaken by private industry. In fact, no single business could raise that much money, so 8 major oil companies formed a consortium in order to share the costs. Each company controlled oil rights to particular shares of land in the oil fields and paid into the pipeline-construction fund according to the size of its holdings. Today, despite enormous problems of climate, supply shortage, equipment breakdowns, labour disagreements, treacherous terrain, a certain amount of mismanagement, and even theft, the Alaska pipeline has been completed and is operating.
What is the capacity of the Alaskan pipeline?
Read the passage carefully and choose the best answer to each question out of the four alternatives and click the button corresponding to it. The Alaska pipeline starts at the frozen edge of the Arctic Ocean. It stretches southward across the largest and northernmost state in the United States, ending at a remote ice-free seaport village nearly 800 miles from where it begins. It is massive in size and extremely complicated to operate. The steel pipe crosses windswept plains and endless miles of delicate tundra that tops the frozen ground. It weaves through crooked canyons, climbs sheer mountains, plunges over rocky crags, makes its way through thick forests, and passes over or under hundreds of rivers and streams. The pipe is 4 feet in diameter, and up to 2 million barrels (or 84 million gallons) of crude oil can be pumped through it daily. Resting on H-shaped steel racks called "bents", long sections of the pipeline follow a zigzag course high above the frozen earth. Other long sections drop out of sight beneath spongy or rocky ground and return to the surface later on. The pattern of the pipeline's up-and-down route is determined by the often harsh demands of the arctic and subarctic climate, the tortuous lay of the land, and the varied compositions of soil, rock, or permafrost (permanently frozen ground). A little more than half of the pipeline is elevated above the ground. The remainder is buried anywhere from 3 to 12 feet, depending largely upon the type of terrain and the properties of the soil. One of the largest in the world, the pipeline cost approximately $8 billion and is by far the biggest and most expensive construction project ever undertaken by private industry. In fact, no single business could raise that much money, so 8 major oil companies formed a consortium in order to share the costs. Each company controlled oil rights to particular shares of land in the oil fields and paid into the pipeline-construction fund according to the size of its holdings. Today, despite enormous problems of climate, supply shortage, equipment breakdowns, labour disagreements, treacherous terrain, a certain amount of mismanagement, and even theft, the Alaska pipeline has been completed and is operating.
How was the fund for pipeline - construction generated?