GATE Computer ScienceModerateGATE CS (PYQ pattern)

A three-word memory-to-memory instruction ADD @A, B (opcode word, address word A, address word B) computes M[B] ← M[M[A]] + M[B], where @A is memory-indirect. Instructions and data are fetched one word per memory reference and there is no cache. How many memory references does one execution make?

  1. A. 7
  2. B. 6
  3. C. 5
  4. D. 8

Correct answer: A. 7

Fetch 3 instruction words (3); read the pointer M[A] (1); read the operand M[M[A]] (1); read M[B] (1); write the sum back to M[B] (1): 7. Forgetting the write-back gives 6; treating the instruction as a single fetch gives 5.

More Computer Organization and Architecture questions

Exams that ask this topic