Question

Problem 3 [150 Points] [a] [50 points] Assume $to holds the value 0x00101000. What is the value of $t2 after the following instructions? Rewrite the code in C slt $t2, $zero, $t0 bne $t2, $zero, ELSE j DONE ELSE: addi $t2, $t2, 2 DONE: With steps and explain
0 1
Add a comment Improve this question Transcribed image text
Answer #1

image.png

answered by: GrinderBob
Add a comment
Know the answer?
Add Answer to:
With steps and explain Problem 3 [150 Points] [a] [50 points] Assume $to holds the value...
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
  • 2-If we assume we place the following MIPS code starting at location 8000 in memory, what...

    2-If we assume we place the following MIPS code starting at location 8000 in memory, what is the MIPS machine code for this code? Please explain each instruction and specify its type (R format, I format, or J format). slt $12, S0, Sto bne $12, SO, ELSE j DONE ELSE: addi $12, $12,2 DONE: obodno bendruomebook 01 ni moi bonbo n

  • A) The following code fragment takes as input a number in t1 and produces a value...

    A) The following code fragment takes as input a number in t1 and produces a value in register $s2. Assume that initially $s2 equals zero. Line Loop: addi $t2, $zero, 10 2 Loop2: addi$s2, $s2, 2 3 subi $t2, $t2, 1 4 bne $t2, $zero, Loop2 5 subi $t1,$t1, 1 6 bne $t1, $zero, Loop For each of the following problems, justify your answers and show your calculations clearly. Final answers without justifications are not accepted. What is the final...

  • 2. The table below holds MIPS assembly code fragments with different branch instructions LOOP addi $s2....

    2. The table below holds MIPS assembly code fragments with different branch instructions LOOP addi $s2. $s2. 2 subi $t1. st1. 1 bne t1. 0. LOOP DONE: LOOP: it st2. $0. stl beq t2. 0. DONE addi $s2. Ss2. 2 LOOP DONE: For the loops written in MIPS assembly in the above table, assume that the register Şt1 is initialized to the value of 10. What is the value in register $s2 assuming that $s2 initially has a value of...

  • please explain fully 3. Consider the following MIPS loop: LOOP: Comment slt $t2, 0, Sti beg...

    please explain fully 3. Consider the following MIPS loop: LOOP: Comment slt $t2, 0, Sti beg $t2, 0, exit addi $t1, $t1,-1 addi Sal, $31, 2 TOOP exit: a. (5 pts) Write comments for each line, at the right side of above table. b. (12 pts) Write the equivalent C code. Assume that the registers $sland $t1 is associated with integers "a" and "I", respectively. c. (3pts) Assume that the register $t1 is initialized to the value 2. What is...

  • 1. (15 pts) For the following C statement, what is the corresponding MIPS assembly code? Assume...

    1. (15 pts) For the following C statement, what is the corresponding MIPS assembly code? Assume f, g, h correspond to $80, $s1, and $s2, respectively. f=g+(h-5) 2. (15 pts) For the following pseudo-MIPS assembly instructions, what is the corresponding C code? add f, g, h add f,i, f 3. (30 pts) Provide the instruction type, assembly language instruction, and binary representation of the instruction described by the following MIPS fields: a. op = 0, rs = 18, rt=9, rd...

  • The relative time ratings of exercises are shown in square brackets after each exercise number. On average, an exercise...

    The relative time ratings of exercises are shown in square brackets after each exercise number. On average, an exercise rated [10] will take you twice as long as one rated [5]. Sections of the text that should be read before attempting an exercise will be given in angled brackets; for example, <1.3> means you should have read Section 1.3, Under the Covers, to help you solve this exercise. 2.1 [5] For the following C statement, what is the corresponding MIPS...

  • I AM POSTING MY QUESTION 3RD TIME . FIRST TWO TIMES I DIDNOT GET THE PROPER...

    I AM POSTING MY QUESTION 3RD TIME . FIRST TWO TIMES I DIDNOT GET THE PROPER ANSWER. PLEASE DO ALL STEPS BY LABELING THE EACH STEP. THIS IS THE ASSIGNMENT IN WHICH THE EACH STEP SHOULD BE LABEL . I MEAN EVERY THING SHOULD BE WRITTEN WHAT WE HAVE DONE IN OUR PROGRAM THIS IS THE REQUIREMENT OF TEACHER , PLEASE DO IT PROPERLY   1) MIPS to C. Assume that the variables f, g, h, i, and j are assigned...

  • Translate the following C code to MIPS assembly code. Assume that the value of i is...

    Translate the following C code to MIPS assembly code. Assume that the value of i is in register $t0, and $s0 holds the base address of the integer MemArray if (i > 10) MemArray[i] = 0; else MemArray[i] = -MemArray[i];

  • Problem 4 (30 points) a) Consider the RISC-V code below. Indicate what is the value in register x20 after the code belo...

    Problem 4 (30 points) a) Consider the RISC-V code below. Indicate what is the value in register x20 after the code below is executed, and explain why; х18 х0 16 ori addi x20 х18 0 beg x20, х18, НERE x20 х20, х20 add HERE Problem 4 (30 points) a) Consider the RISC-V code below. Indicate what is the value in register x20 after the code below is executed, and explain why; х18 х0 16 ori addi x20 х18 0 beg...

  • Problem 1: (20 marks) Part 1: (15 points) Compile the RISC-V assembly code for the following C co...

    please code using risc-v language and make it as simple as possible Problem 1: (20 marks) Part 1: (15 points) Compile the RISC-V assembly code for the following C code. Assume that n and k are passed in x3 and x4 respectively. Values n and k are initialized to 14 and 14. Assume that result returned in register fl and that double precision numbers are used. After you are done store the result in address: 12(x3). Are you allowed to?...

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