Open In App

ISRO | ISRO CS 2015 | Question 76

Like Article
Like
Save
Share
Report

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


Last Updated : 06 Apr, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads