Question: Compare 0 - , 1 - , 2 - , 3 - and 4 - address machines by writing programs to compute the Taylor series

Compare 0-,1-,2-,3- and 4-address machines by writing programs to compute
the Taylor series expansion of sine(x):
SIN X = X 1/3! X3+1/5! X5
The instructions available for use are as follows:
0-address 1-address 2-address 3-address
PUSH M LOAD M MOV X, Y MOV X, Y
POP M STORE M ADD X, Y ADD X, Y, Z
ADD ADD M SUB X, Y SUB X, Y, Z
SUB SUB M MUL X, Y MUL X, Y, Z
MUL MUL M DIV X, Y DIV X, Y, Z
DIV DIV M
DUP
Assume that you can replace any operand with a constant value in all machines, e.g.
PUSH 3, puts the constant 3 onto the stack. You must calculate the factorial values.
In these instructions, opcodes are 8 bits long; M is a 16-bit memory address; X, Y,
and Z are 16-bit addresses (or 8-bit constants). The data (operand) size is 32 bits.
The zero-address machine uses a stack and the 1-address machine uses an
accumulator. The DUP instruction duplicates the top of the stack, so the same value
appears twice.
The variables are initially stored in main memory, and the result (sin(x)) must be
stored back to memory into memory location SIN. Code the program for each
machine as compactly as possible, and calculate how many bits of memory traffic
are used to compute sin(x) ONLY for 3-address machine.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!