The instruction pipeline of a RISC processor has the following stages: Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Perform Operation (PO) and Writeback (WB), The IF, ID, OF and WB stages take 1 clock cycle each for every instruction. Consider a sequence of 100 instructions. In the PO stage, 40 instructions take 3 clock cycles each, 35 instructions take 2 clock cycles each, and the remaining 25 instructions take 1 clock cycle each. Assume that there are no data hazards and no control hazards.
The number of clock cycles required for completion of execution of the sequence of instruction is ______ .
Note – This was Numerical Type question.
(A) 219
(B) 104
(C) 115
(D) 220
Answer: (A)
Explanation: Given, total number of instructions (n) = 100
Number of stages (k) = 5
Since, if n instructions take c cycle, so (c-1) stalls will occur for these instructions.
Therefore, the number of clock cycles required = Total number of cycles required in general case + Extra cycles required (here, in PO stage)
= (n + k – 1) + Extra cycles
= (100 + 5 -1) + 40*(3-1)+35*(2-1)+20*(1-1)
= (100 + 4) + 40*2+35*1+20*0
= 104 + 115
= 219 cycles
So, option (A) is correct.
Quiz of this Question
Recommended Posts:
- GATE | GATE CS Mock 2018 | Question 39
- GATE | GATE CS 2018 | Question 5
- GATE | GATE CS 2018 | Question 6
- GATE | GATE CS 2018 | Question 4
- GATE | GATE CS Mock 2018 | Set 2 | Question 23
- GATE | GATE CS Mock 2018 | Set 2 | Question 24
- GATE | GATE CS Mock 2018 | Set 2 | Question 25
- GATE | GATE CS Mock 2018 | Set 2 | Question 26
- GATE | GATE CS Mock 2018 | Set 2 | Question 27
- GATE | GATE CS Mock 2018 | Set 2 | Question 28
- GATE | GATE CS Mock 2018 | Set 2 | Question 29
- GATE | GATE CS Mock 2018 | Set 2 | Question 30
- GATE | GATE CS Mock 2018 | Set 2 | Question 31
- GATE | GATE CS Mock 2018 | Set 2 | Question 32
- GATE | GATE CS Mock 2018 | Set 2 | Question 33
- GATE | GATE CS Mock 2018 | Set 2 | Question 34
- GATE | GATE CS Mock 2018 | Set 2 | Question 35
- GATE | GATE CS Mock 2018 | Set 2 | Question 36
- GATE | GATE CS Mock 2018 | Set 2 | Question 37
- GATE | GATE CS Mock 2018 | Set 2 | Question 38

