• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

ISRO | ISRO CS 2020 | Question 78

A computer which issues instructions in order, has only 2 registers and 3 opcodes ADD, SUB and MOV. Consider 2 different implementations of the following basic block:

Case 1            Case 2
t1 = a + b;      t2 = c + d;
t2 = c + d;      t3 = e – t2;
t3 = e – t2;     t1 = a + b;
t4 = t1 – t2;    t4 = t1 – t2; 

Assume that all operands are initially in memory. Final value of computation also has to reside in memory. Which one is better in terms of memory accesses and by how many MOV instructions ?

(A)

Case 2, 2

(B)

Case 2, 3

(C)

Case 1, 2

(D)

Case 1, 3

(E)

None of these

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments