Question: 2. Write machine instruction codes to evaluate each of the following arithmetic statements X=A-B*(C*D+E) Y=A/B + C/D * (E-F) a b, 1. on a general

2. Write machine instruction codes to evaluate each of the following arithmetic statements X=A-B*(C*D+E) Y=A/B + C/D * (E-F) a b, 1. on a general register CPU with 3-address instructions 2. on a general register CPU with 2-address instructions 3. on an accumulator-based CPU with 1-address instructions 4. on a stack-based CPU with 0-address instructions (note: in a stack- based machine, PUSH and POP are one-address instructions) STORE, MOVE, POP and PUSH instructions as appropriate in its instruction set. Also assume that operand A is in memory location MA, operand B is in memory location MB, and so on. If the opcode length is 5 bits, register addresses are 4 bits, memory addresses are 32 bits, compute the size in bits of each program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
