Comparing Address Machines
Not what you're looking for?
Compare zero-, one-, two-, and three-address machines by writing programs to compute
X = (A+B X C)/D - E X F)
For each of the four machines. The instructions available for use as follows:
0 Address 1 Address 2 Address 3 Address
PUSH M LOAD M MOVE (X<-- Y) MOVE (X <--Y)
POP STORE M ADD (X<--X +Y) ADD (X<-- Y +Z)
ADD ADD M SUB (X<-- X -Y) SUB (X<-- Y -Z)
SUB SUB M MUL (X<-- X x Y) MUL (X<-- Y x Z)
MUL MUL M DIV (X<-- X /Y) DIV (X<-- Y /Z)
DIV DIV M
Legend: <-- arrow
small x multiply
Purchase this Solution
Solution Summary
The following posting helps compare address machines.
Solution Preview
3 Address mode
X=(A+B*C)/D-E*F
MUL T,B,C //T=B*C
ADD T,T,A //T=A+B*C
DIV T,T,D //T=(A+B*C)/D
MUL T1,E,F // T1=E*F
SUB X,T,T1 //X=T-T1=(A+B*C)/D-E*F
Here we have taken two temporary registers T,T1 and storing the result in these two temp registers and finally, we have stored the content of registers into X which is the result.
In 3 address machines, each instruction takes 4 memory access, one access to fetch opcode from memory, 2 for getting the 2 inputs operands and a final to write the result back in memory
Hence, machine generates a total no of 20 ...
Purchase this Solution
Free BrainMass Quizzes
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.
C++ Operators
This quiz tests a student's knowledge about C++ operators.
Inserting and deleting in a linked list
This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.
Basic Computer Terms
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.
Basic Networking Questions
This quiz consists of some basic networking questions.