Question

Program the following advanced language formulas using the universal command statement expression method for the 0, 1, 2, 3 address machine in Figure 1. However, use any register name you want to use.

A = (A + B * C) / (D – B * E)0 Address PUSH M POPM ADD SUB MUL DIV 1 Address LOADM STOREM ADDM SUBM MUL M 2 Address MOVE ( XY) ADD (X-X+Y) SUB (X--X-Y) MU

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A = (A+B*C)/(D-B*E)
0 ADDRESS
PUSH B
PUSH C
MUL
PUSH A
ADD
PUSH D
PUSH B
PUSH E
MUL
SUB
DIV
POP A

1 ADDRESS

LOAD B
MUL C
ADD A
STORE M
LOAD B
MUL E
STORE P
LOAD D
SUB P
STORE P
LOAD M
DIV P
STORE A

2 Address
MOVE (X <- B)
MUL (X <- X x C)
ADD (X <-X + A)
MOVE (Y <- B)
MUL (Y <- Y x E)
MOVE (Z <- D)
SUB (Z <- D - Y)
DIV (X <- X / Z)
MOVE (A <- X)

3 ADDRESS
MUL (X <- B x C)
ADD (X <- X + A)
MUL (Y <- B x E)
SUB (Y <- D - Y)
DIV (A <- X/Y)

Add a comment
Know the answer?
Add Answer to:
Program the following advanced language formulas using the universal command statement expression method for the 0,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 6 pts) Compare zero- and three-address machines by writing programs to compute X = (A-B *...

    6 pts) Compare zero- and three-address machines by writing programs to compute X = (A-B * C) + (D + E) * F for each. Store your final result in variable "X". For the 0-address machine, you'll use "POP X". You have the following commands: 0 Address PUSH M POP M ADD SUB MUL DIV 3 Address MOVE (XY) SUB (XEY Z) DIV (X-Y/Z) Add or remove rows as needed. 0 Address 3 Address

  • Write a complete MIPS assembly language program that implements the following pseudocode. program h2 define global...

    Write a complete MIPS assembly language program that implements the following pseudocode. program h2 define global integer variables w, x, y, z -- in the .data section function main() SysPrintStr("Enter an integer >= 0 for w? ") w ← SysReadInt() SysPrintStr("Enter an integer >= 0 for x? ") x ← SysReadInt() SysPrintStr("Enter an integer < 0 for y? ") y ← SysReadInt() z ← 16(w + x) - (3 × -y mod 7) SysPrintStr("z = ") SysPrintInt(z) SysExit() end function...

  • Implement the following statements using MS430 assembly instructions. You may use more than one, ...

    Implement the following statements using MS430 assembly instructions. You may use more than one, but you should minimize the number of instructions required. You can use both native and emulated instructions. Use hex notation for all numbers 1. (a) Move the word located in register R14 to R15 (b) Increment the word in R6 by 2. (c) Perform a bitwise ANDing of the word located at address 0x0240 with the datum in R15, placing the results in R15. (d) Rotate...

  • Assignment 4 File “quad_sol.s” contains a quadratic polynomial solver, which calculates the integer solution of a quadratic polynomial equation. 1. Rewrite the program using instructions reordering to...

    Assignment 4 File “quad_sol.s” contains a quadratic polynomial solver, which calculates the integer solution of a quadratic polynomial equation. 1. Rewrite the program using instructions reordering to reduce the number of cycles needed to execute the program. Indicate the number of cycle reduction. 2. Describe how forwarding would affect the execution of the program. CODE # quad_sol.s # This assembly program calculates the integer solutions of a quadratic polynomial. # Inputs : The coefficients a,b,c of the equation a*x^2 +...

  • 1.) a.) Using the simplified instruction set shown for part b, write code for the following....

    1.) a.) Using the simplified instruction set shown for part b, write code for the following. Suppose memory locations 1400 to 1449 contain 16-bit words. Each word represents 2 ASCII characters. Write code to read in and write out these 100 characters. Left-side character from location 1400 should be first, right-side character from location 1400 should be second, and remaining characters follow in numeric order. Assume you have access to 4 registers: R1, R2, R3, R4. Each register holds one...

  • please help me solve these. discrete structures for computing. Answer the following 1) 2points Use a...

    please help me solve these. discrete structures for computing. Answer the following 1) 2points Use a table to express the values of the Boolean function: F(x, y, z) = xy + (xyz) 0 0 0 0 0 1 0 1 0 011 1 0 0 1 0 1 110 11 2) 2points) Find the sum-of-products expansion of the Boolean function: F(x, y, z) = (x + 2)y. i.e. 3) (2 points] Express the Boolean function F(x, y, z) = xy...

  • Consider the following MIPS assembly language instructions: addi $1, $2, 100 swr $1, 0($2): addi $rt,...

    Consider the following MIPS assembly language instructions: addi $1, $2, 100 swr $1, 0($2): addi $rt, $rs, immediate # add immediate swr $rt, immedi ate ($rs) # store word write register These instructions are I-format instructions similar to the load word and store word instructions. The addi and swr instructions store a computed value to the destina- tion register $rt. The instructions do not require any physical hardware changes to the datapath. The effect of each instruction is given below....

  • Group Project 1 The Micro-1 Processor Simulation <Micro-1 Computer> Here's the organization of a computer equipped...

    Group Project 1 The Micro-1 Processor Simulation <Micro-1 Computer> Here's the organization of a computer equipped with a Micro-1 processor Memory contains an array of integer cells: int cell[] = new int[CAP]; where CAP is the capacity of memory. Initially this is set to 256. Internally, the Micro-1 processor is equipped with eight 32-bit data/address registers and two 32 bit control registers: PC, the program counter, contains the address of the next instruction to execute. IR, the instruction register, contains...

  • Note: The question needs to be answered in "C Programming Languange ". And after the question fin...

    Note: The question needs to be answered in "C Programming Languange ". And after the question find 3 pages for needed informations. Spring CE4717 Language Processors Q1. Consider the following LEx program. return R1 return R2 return R3 return R4 return R5; return R6; IA-2a-z)[A-Za-z0-9]- -2 10-91+ 10-9a-EA-FI Ihi] [01] [01] 이삐 t Vtin) int main (void) int tcode; do f tcode -yylex()i printf ("token type td \"%s\"\n", tcode, yytext); ) while (tcode)i return 0; i. Explain the steps needed...

  • Using C programming language Question 1 a) through m) Exercise #1: Write a C program that...

    Using C programming language Question 1 a) through m) Exercise #1: Write a C program that contains the following steps (make sure all variables are int). Read carefully each step as they are not only programming steps but also learning topics that explain how functions in C really work. a. Ask the user for a number between 10 and 99. Write an input validation loop to make sure it is within the prescribed range and ask again if not. b....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT