Open In App
Related Articles

ISRO | ISRO CS 2015 | Question 76

Improve Article
Save Article
Like Article

In X = (M + N x O)/(P x Q), how many one-address instructions are required to evaluate it?
(A) 4
(B) 6
(C) 8
(D) 10

Answer: (C)

Explanation: In One-address instructions, an accumulator register is required to perform all the instructions. Load and store operations are performed to fetch the values of operands from registers or memory to accumulators and to store the value of accumulator to a memory location. Instructions required to execute the code:

X = (M + N x O)/(P x Q)
1) Load A  :  ACC  <-- M[M]
2) Add N   :  ACC  <-- ACC + M[N]
3) Mul O   :  ACC  <-- ACC x M[O]
4) Store T :  M[T] <-- ACC
5) Load P  :  ACC  <-- M[P]
6) Mul Q   :  ACC  <-- ACC x M[Q]d
7) Div T   :  ACC  <-- M[T] / ACC
8) Store X :  M[X] <-- ACC

So, option (C) is correct.

Quiz of this Question

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 06 Apr, 2018
Like Article
Save Article
Similar Reads