Question

Question 14 Given the assembly code below, calculate the offset value of beq instruction. (Offset value: the value in immedia

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

Answer: -7

Explanation:

There is no beq instruction in the question; I hope it is bne statement

Let L1 is at address location is 1000; Then

1000: L1: lw R1, 0(R5)
1004: lw R2, 400(R5)
1008: add R3, R1, R2
1012: sw R3, 0(R5)
1016: addi R4, R4, -4
1020: addi R5, R5, 4
1024: bne R4, R0, L1
1028:

and bne instruction is at 1024 and PC (Program Counter) will be 1028

offset = (L1 - PC) / 4

= (1000-1028)/ 4 = -7

Add a comment
Know the answer?
Add Answer to:
Question 14 Given the assembly code below, calculate the offset value of beq instruction. (Offset 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
  • Copy of Given the assembly code below, calculate the offset value of beq instruction. (Offset value:...

    Copy of Given the assembly code below, calculate the offset value of beq instruction. (Offset value: the value in immediate field of beq) bea addi sub $50, $s1, L1 $sl, $sl, 1 $sl, $sl, $50 $s3, $sl, $s1 $sl, $sl, $ s0 lw L1: add Offset:

  • Question 14 Given the assembly code below, calculate the offset value of beq instruction. (Offset value:...

    Question 14 Given the assembly code below, calculate the offset value of beq instruction. (Offset value: the value in immediate field of beq) beg $50, $81, L1 addi $31, $31, 1 sub $31, $81, $50 L1: add $31, $31, $50 Offset:

  • Question 14 Given the assembly code below, calculate the offset value of beq instruction (Offset value...

    Question 14 Given the assembly code below, calculate the offset value of beq instruction (Offset value the value in immediate field of beg) bog $80, $81, L1 addi $si, si, 1 sub $si, si, $ 11: add $81, $81, $50 Offset: A Moving to another question will save this response.

  • Given the assembly code below, calculate the offset value of beq instruction. (Offset value: the value...

    Given the assembly code below, calculate the offset value of beq instruction. (Offset value: the value in immediate field of beq) beg $80, $s1, L1 addi $81, $sl, 1 sub $81, $sl, $50 LI: add $sl, $sl, $50 Offset: Moving to another question will save this response. DOD OSC F3 8.

  • . U 8. (15 pts) Assuming the code fragment below is executed by the classic 5-stage...

    . U 8. (15 pts) Assuming the code fragment below is executed by the classic 5-stage MIPS architecture, answer the following questions. Ll: lw RI, O (R5) // 11 add R2, Ri, 20 // 12 lw R3, 0(R6) // 13 add R3, R2, R3 SW R3, 0(R5) addi R4, R4,-4 // 16 addi R5, R5,4 // 17 addi R6, R6,4 // 18 bne R4, RO, L1 // 19 a. (5 pts) Assuming R5 holds the address of array A, R6...

  • help Question 11 The classic five-stage pipeline MIPS architecture is used to execute the code fragments...

    help Question 11 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 200....

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    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 200. L1: lw lw...

  • 12 po Iw add Question 11 The dassic five-stage pipeline MIPS architecture is used to execute...

    12 po Iw add Question 11 The dassic 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 cycles register read is performed in the second half of the clock cyde. Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism Register R4 is initially...

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    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. L1:  lw    R1, 0(R4)   add   R3, R1, R2 sw   ...

  • Assembly code time

    Consider the following assembly language code:I0: add $R4,$R1,$R0                             //ADD R4 = R1 + R0;I1: lw $R1,100($R3)                             //LDW R1 = MEM[R3 + 100];I2: lw $R9,4,($R1)                                // LDW R9 = MEM[R1 + 4];I3: add $R3,$R4,$R9                             //ADD R3 = R4 + R9;I4: lw $R1,0($R3)                                 //LDW R1 = MEM[R3 + 0];I5: sub $R3,$R1,$R4                             //SUB R3 = R1 - R4;I6: and $R9,$R9,$R7                             //AND R9 = R9 & R7;I7: sw $R2,100($R4)                             //STW MEM[R4 + 100] = R2;I8: and $R4,$R2,$R1                             //AND R4 = R2 & R1;I9: add...

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