Question

You may not need as many lines 5: add, sub, addi, j, beq, bne, lw, sw. as we provide space for

(4 pts) Write a MIPS program starting at address 20 that writes a value of 488 to register $7. Next, you will test if registe
You may not need as many lines 5: add, sub, addi, j, beq, bne, lw, sw. as we provide space for
(4 pts) Write a MIPS program starting at address 20 that writes a value of 488 to register $7. Next, you will test if register $10 is equal to register $7. If the values are equal, continue execution at address 48; otherwise set the value in register $7 to $10 $21 (contents of register $10 subtract contents of register $21). Following these steps your program should continue execution at address 228. You should use both a branch type instruction (beq or bne) and one ( jump) instruction. 20 24 28 32 36
0 0
Add a comment Improve this question Transcribed image text
Answer #1

oo20 H $7,483 201w loads Registe 7 th ug 24be $7, $10, 48 =) branch jump) to 48 1f $7-lo PoCRpam Contsol injumPs to location

Add a comment
Know the answer?
Add Answer to:
You may not need as many lines 5: add, sub, addi, j, beq, bne, lw, sw. as we provide space for (4 pts) Write a MI...
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
  • Usc only the following MIPS instructions for assignment questions 3, 4 and 5: add, sub, addi,...

    Usc only the following MIPS instructions for assignment questions 3, 4 and 5: add, sub, addi, j, beq, bne, lw, sw. You may not need as many lines as we provide space for 4. (4 pts) Write a MIPS program starting at address 20 that writes a value of 488 to register $7. Next, you will test if register $10 is equal to register $7. If the values are equal, continue execution at address 48; otherwise set the value in...

  • Edit: Not sure what more information you need. Write a MIPS assembly program to determine the...

    Edit: Not sure what more information you need. Write a MIPS assembly program to determine the range between pairs of numbers. Keep things very basic with instructions such as load (lw), store (sw), add (addi and add), subtract (sub), multiplication (mul), branch (beq and bne), jump (j), and set on less than (slt) instructions. Your program should meet the following functional requirements: Input: an arbitrary number of integer pairs (in all pairs, the first number will be the max value)...

  • Consider the following MIPS code: add $t3,$t2,$t1 lw $t4,0($t3) sw $t7,0($t3) add $t6,$t2,$t8 addi $t3,$t5,4 (a)...

    Consider the following MIPS code: add $t3,$t2,$t1 lw $t4,0($t3) sw $t7,0($t3) add $t6,$t2,$t8 addi $t3,$t5,4 (a) Draw a general pipeline diagram from CC1 to CC5 (b) Can you identify the type of hazard in pipeline for executing the code? (c) What is the solution to the hazard? If NOP (noop or bubbles) have to be inserted to avoid hazard, where will you put them? (d) Put the code into the MIPS simulator and observe your findings. You may want to...

  • 1. Given the following instruction sequence for the MIPS processor with the standard 5 stage pipeline $10, S0. 4 addi lw S2.0(S10) add sw S2,4(510) $2, $2, $2 Show the data dependences between th...

    1. Given the following instruction sequence for the MIPS processor with the standard 5 stage pipeline $10, S0. 4 addi lw S2.0(S10) add sw S2,4(510) $2, $2, $2 Show the data dependences between the instructions above by drawing arrows between dependent instructions (only show true/data dependencies). a. Assuming forwarding support, in what cycle would the store instruction write back to memory? Show the cycle by cycle execution of the instructions as they execute in the pipeline. Also, show any stalls...

  • Question 11 add sw addi bne The classic five-stage pipeline MIPS architecture is used to execute...

    Question 11 add sw addi bne The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings • The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction med • Register R4...

  • add SW addi bne The classic five-stage pipeline MIPS architecture is used to execute the code...

    add SW addi bne The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, • Register R4 is initially 100....

  • Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for...

    Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for a special R-type instruction jlr Jump and Link Register) to the single-cycle datapath below. Though this is an R-type instruction, but it is a special one that has the opcode being 000001 (instead of 000000), so the control unit will be able to differentiate this jlr instruction from the other R-type instructions and generate a special set of controls for this instruction. Opcode rs...

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

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

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