Question

2-If we assume we place the following MIPS code starting at location 8000 in memory, what is the MIPS machine code for this c
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the answer below:

slt $t2,$0,$t0

SLT $t2 $zero $t0 Binary: 00000000000010000101000000101010 Hex: 0x0008502a 2625 SPECIAL $zero 2120 | 16 15 11 10 1 st2 0 1010


bne $t2,$0,ELSE

BNE $t2 $zero 0x0001 Binary: 00010101010000000000000000000001 Hex: 0x15400001 26 25 2120 16 15 5+ 2 BNE 000101 $zero 00000 of


j DONE

Address of done is :

8010 in hex

1000000000010000 in binary

address in 26 bit will be

0000000000001000000000010000

Address with jump instruction is :

00001000000000000010000000000100

it will be in hexadecimal as below

8002004

Jump Format: i target [J-type] MIPS Architecture Extension: MIPS I 2625 target 000010 26


ELSE: addi $t2,$t2,2
ADDI $t2 $t2 0x0002 Binary: 00100001010010100000000000000010 Hex: 0x214 a0002 31 26 25 21 20 16 15 ADDI 001000 10 immediate 0

Add a comment
Know the answer?
Add Answer to:
2-If we assume we place the following MIPS code starting at location 8000 in memory, what...
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
  • Consider the following MIPS code (don't worry about what it does): loop: beq $s0, $s1, done...

    Consider the following MIPS code (don't worry about what it does): loop: beq $s0, $s1, done addi $t0, $t0, 7 addi St1, St2, 4 addi $s0, $s0, 1 j loop done: beq St1, $15, skip addi St0, Sto, 1 addi St1, St2, St0 skip addi $t5, $0, 10 beq St1, St5, done j end Compute the branch offset for each beq in number of words away from the branch (e.g., "branch offset is 2") Assume label loop is at location...

  • Convert the following MIPS instructions Into Machine Code Instructions. Assume the first Instruction starts at memory...

    Convert the following MIPS instructions Into Machine Code Instructions. Assume the first Instruction starts at memory address 20000 slt $t1, $s1, $s0 beq $s1, $s2, L1 beq $t1, $zer0, L2 j Exit L1: add $s1, $s1, $s1 j Exit L2: add! $s1, $s1, 1 Exit:

  • 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...

  • 5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer...

    5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A- The MiteASM Assembler and Appendix B - The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should display a count on the 7-segment display. The count should increase by 1 when button 0 is 1. pressed. It should reset to 0 when button 1 is...

  • There is an example below Now that everything is working you can try the following exercises. To complete them you wi...

    There is an example below Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A The MiteASM Assembler and Appendix B The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should 1. display a count on the 7-segment display. The count should increase by 1 when button 0 is pressed. It should reset to 0 when button...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

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