Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following code, which is loaded to memory address 0x70008000. Trans

ID: 3700555 • Letter: C

Question

Consider the following code, which is loaded to memory address 0x70008000. Translate the highlighted beq and j instructions into hexadecimal-based machine code of MIPS CPU? You do not need to translate all the instructions; just provide the machine code of beq and j instructions. 1. add $4, $0, $0 0x70008000 0x70008004 Loop: slti $8, $4, $10 0x70008008 0x7000800C 0x70008010 0x70008014 0x70008018 0x7000801C 0x70008020 0x70008024 0x70008018 End: beq $8, $0, End lui $8, 0x1234 ori $8, $8, 0x5678 s11 $9, $4, 2 add $8, $8, $9 sw $0, 0 ($8) addi $4, $4, 1 j Loop

Explanation / Answer

Solution:

beq:

000100 01000 00000 0000 0000 0000 0111

opcode rs rt offset of End from beq line (i.e 7) --------- Explanation as which chunk of bit means what

j:

000010   0111 0000 1000 0000 0000 0100 00

opcode Then pseudo indexing ---- PC <- PC31-28::IR25-0::00

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote