GATEverse
← GATE CSE 2004

Q64

MCQ2 marks, −0.5

Consider the following program segment for a hypothetical CPU having three user registers R1,R2R_1, R_2 and R3.R_3.

InstructionOperationInstruction size (in Words)MOV R1,5000R1←Memory[5000]2MOV R2,(R1)R2←Memory[(R1)]1ADD R2,R3R2←R2+R31MOV 6000,R2Memory[6000]←R22HaltMachine Halts1\begin{array}{|l|l|c|} \hline \text{Instruction} & \text{Operation} & \text{Instruction size (in Words)} \\ \hline \text{MOV } R_1, 5000 & R_1 \leftarrow \text{Memory}[5000] & 2 \\ \hline \text{MOV } R_2, (R_1) & R_2 \leftarrow \text{Memory}[(R_1)] & 1 \\ \hline \text{ADD } R_2, R_3 & R_2 \leftarrow R_2 + R_3 & 1 \\ \hline \text{MOV } 6000, R_2 & \text{Memory}[6000] \leftarrow R_2 & 2 \\ \hline \text{Halt} & \text{Machine Halts} & 1 \\ \hline \end{array}

Let the clock cycles required for various operations be as follows:

Register to/from memory transfer3 clock cycles ADD with both operands in register1 clock cycles Instruction fetch and decode2 clock cycles \begin{array}{|l|l|} \hline \text {Register to/from memory transfer} & \text{3 clock cycles } \\\hline \text {ADD with both operands in register} & \text{1 clock cycles } \\\hline \text {Instruction fetch and decode} & \text{2 clock cycles }\\\hline \end{array}

The total number of clock cycles required to execute the program is

Sign in to save attempts.

Loading…