Question

Write the code for 2-address machine for the following. Note A, B, C and F are values, and X is register. X=(A. C-B)/Fcomputer architecture

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

In 2 address instructions each address field can specify either register or word

MOV R1,A
MOV R2,C
MUL R1,R2   
MOV R3,B
SUB R1,R3
MOV R4,F   
DIV R1,R4
MOV X,R1   

Add a comment
Know the answer?
Add Answer to:
computer architecture Write the code for 2-address machine for the following. Note A, B, C and...
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
  • Computer Architecture Please help me explain the answer 3 For the following statement, translate the statement to ARM assembly code. Assume that variable fand g are each in register rO, r1. Base addr...

    Computer Architecture Please help me explain the answer 3 For the following statement, translate the statement to ARM assembly code. Assume that variable fand g are each in register rO, r1. Base address of array A is in r3 and base address of array B is in r4. Temporary register is r5. f= g + A[B[3]] Ans) sol) LDR r5, 14, #12] ADD rs. r3. r5, LSL #2 LDR r5, [r3. #01 ADD rO, rl, r5 3 For the following...

  • This question is from Computer architecture. Please show steps and add comments so its easy to...

    This question is from Computer architecture. Please show steps and add comments so its easy to understand. Translate the high-level language code below into assembly instructions. The variables A, B, C, D, E and F are located in the memory and can be accessed by their label (e.g., LOAD R1, A will load A from the memory into R1). Minimize the number of instructions in the assembly code that you write. F = (A-B)*(C+D)/(E-D) a) Write the code for an...

  • Write an equivalent MIPS code for the following C code. Assume that the base address of...

    Write an equivalent MIPS code for the following C code. Assume that the base address of an array A is stored in register 450. Variables x, i, j and h are stored in registers $t0,$t1, $t2 and $t3 respectively. do{ x = x + A[i]; i = i + j; } (while i != h); Make sure your MIPS code has sufficient comments.

  • 1. Consider the code sequence: C= A + B D= A-E F= C+ D Assume the...

    1. Consider the code sequence: C= A + B D= A-E F= C+ D Assume the values A, B, C, D, E, and F reside in memory. For each Architecture I. Accumulator Architecture II. Memory- Register Architecture III. Register-Register Architecture write the code assuming the instruction codes (opcode) are 8 bits, memory addresses are 32 bits, and register addresses are 6 bits and CPU has 64 Registers; and create a table which specifies: – The execution sequence – The variables...

  • Computer Architecture problem Consider the following number 5 Digits Depending on the given number, convert the...

    Computer Architecture problem Consider the following number 5 Digits Depending on the given number, convert the assembly instruction into machine code in hexadecimal. Register (F)fopl opcode funct(C)Irs! Number Even and 0x0 0x24 Even $a0 Odd or Ox0 0x25 Odd $al Number Even $s6 22 5 Odd $s7 23 Write out your assembly instruction f irst. Convert it into machine code in hexadecimal. If the content of the registers are as follows, determine the value of $vO after your instruction has...

  • Write the code to implement the expression A (((B C)/D) *(E F) *G) on 3-, 2-, 1-, and 0- address ...

    Write the code to implement the expression A (((B C)/D) *(E F) *G) on 3-, 2-, 1-, and 0- address machines. Do not rearrange the expression. In accordance with programming language practice, computing the expression should not change the values of its operands. When working with 0-address instructions, assume that the operation is TOS-SOS OP TOS. Write the code to implement the expression A (((B C)/D) *(E F) *G) on 3-, 2-, 1-, and 0- address machines. Do not rearrange...

  • 4. Convert the below C code snippet to LEGV8 assembly code. Base address of x is...

    4. Convert the below C code snippet to LEGV8 assembly code. Base address of x is stored in register X19. Assume variables a, b, andc are stored in registers X20, X21, and X22 respectively. Assume all values are 64-bits. Do not use divide and multiply instructions in your code. Comment your assembly code. (30 Points) x[e] a x[1]; q [e]x x[a/2]b; x[2]; + x[1] x[2] x[c] C >> 4: x[1] + 4. Convert the below C code snippet to LEGV8...

  • Solve the following problems clearly - assembly - computer organization and architecture- william stallings 1) 2)...

    Solve the following problems clearly - assembly - computer organization and architecture- william stallings 1) 2) Let the address stored in the program counter be designated by the symbol X1. The instruction stored in X1 has an address part (operand reference) X2. The operand needed to execute the instruction is stored in the memory word with address X3. An index register contains the value X4. What is the relationship between these various quantities if the addressing mode of the instruction...

  • 1. Write a code segment that adds the immediate values $29 and $42, with the final...

    1. Write a code segment that adds the immediate values $29 and $42, with the final result located in register A. Determine the value of the result. 2. Write a code segment that uses one instruction to add 1 to register B. 3. Write a code segment that uses one instruction to subtract 1 from register X. 4. Write a code segment that loads the value $1234 into register D. 5. Write a code segment that loads S54 into B,...

  • ASAP Computer Architecture and Organization CSC 264 all questions Question 1. Write a note on general-purpose...

    ASAP Computer Architecture and Organization CSC 264 all questions Question 1. Write a note on general-purpose and special-purpose computers. Briefly explain logic gates and various gates used in digital logic design. Explain how data is represented in a digital computer and state how the signed binary numbers are represented. Using the Hamming code algorithm (7, 4), convert a data message (0110) using 7bit. Find the number of parity bits needed Evaluate the values of parity bits Final message bits with...

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