A data driven machine is one that executes an instruction if the needed data…

2018

A data driven machine is one that executes an instruction if the needed data is available. The physical ordering of the code listing does not dictate the course of execution. Consider the following pseudo-code:

(A) Multiply E by 0.5 to get F

(B) Add A and B to get E

(C) Add B with 0.5 to get D

(D) Add E and F to get G

(E) Add A with 10.5 to get C

Assume A, B, C are already assigned values and the desired output is G. Which of the following sequence of execution is valid?

  1. A.

    B, C, D, A, E

  2. B.

    C, B, E, A, D

  3. C.

    A, B, C, D, E

  4. D.

    E, D, C, B, A

Attempted by 17 students.

Show answer & explanation

Correct answer: B

To produce output G, instruction D requires values E and F. Value E is generated by instruction B (using A and B), while value F depends on E via instruction A. Therefore, the execution order must follow: Instruction B first to create E, then Instruction A to create F from E, and finally Instruction D to compute G. Instructions C and E rely on initial inputs and do not affect the dependency chain for G, but a valid sequence must ensure B precedes A, and both precede D.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro