A 5-stage pipelined processor has Instruction Fetch (IF), Instruction Decode…

GATE · 2010 · CS · Computer Science & IT

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?

InstructionMeaning of instructionI0: MUL R2,R0,R1R2←R0∗R1I1: DIV R5,R3,R4R5←R3∕R4I2: ADD R2,R5,R2R2←R5+R2I3:SUB R5,R2,R6R5←R2−R6\begin{array} c{} \textbf {Instruction} & \textbf{Meaning of instruction} \\ \text{$I _0$: MUL $R _2$,$R _0$,$R _1$} & \text{R}_2 \gets \text{R}_0*\text{R}_1\\ \text{$I _1$: DIV $R _5,R _3,R _4$} & \text{R}_5 \gets \text{R}_3 ∕ \text{R}_4\\ \text{$I _2$: ADD $R _2,R _5,R _2$} & \text{R}_2 \gets \text{R}_5 + \text{R}_2 \\ I_3: \text{SUB} \:\text{R}_5,\text{R}_2,\text{R}_6 & \text{R}_5 \gets \text{R}_2 - \text{R}_6 \\\end{array}

  1. A.

    13

  2. B.

    15

  3. C.

    17    

  4. D.

    19

Attempted by 124 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…