Write codes using 3, 2 and 1 address instruction formats to perform the given operations.

X = A/B + C × D/C

Answers

This answer is not selected as best answer. This answer may not be sufficient for exam.

Your limit has been exceed. We have implemented this system because, We got difficulty on managing our servers. Please donate some amount to remove this limit.

Quota: 0 / 30

Donate

Given operation is:

X = A/B + C × D/C

Three Address Instruction format

DIV R1, A, B
ADD R1, R1, C
DIV R2, D, C
MUL R2, R2, C
ADD x, R1, R2

Two Address Instruction format

MOV R1, A
DIV R1, B
ADD R1, B
MOV R2, D
DIV R2, C
MUL R1, R2
MOV x, R1

One Address Instruction format

LOAD A
DIV B
STORE T
LOAD C
ADD T
STORE T
LOAD D
DIV C
MUL T
STORE X
If you found any type of error on the answer then please mention on the comment or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .