Question

Consider the execution of the program below on a fully bypassed (i.e. both W-E and M-E...

Consider the execution of the program below on a fully bypassed (i.e. both W-E and M-E operand forwarding), 5-stage MIPS pipeline with early branch resolution (i.e., branches resolved in D stage).

i1: add $v0, $0, $0

i2: addi $t0, $0, 100

i3: lw $t1, 0($a0)

i4: add $v0, $v0, $t1

i5: addi $a0, $a0, 4

i6: addi $t0, $t0, -1

i7: beq $t0, $0, end

I8: beq $0, $0, i3

end:

Which lines in the program would require stalls based on data dependencies

Reorder the program so that no stalls are required.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • I4 instruction will need to stall for 1 clock cycle waiting for t1 (RAW)
  • I7 instruction also will need to stall for 1 cycle waiting for t0 (RAW)

Reordering below will not cause any stall.

  • i1: add $v0, $0, $0
  • i3: lw $t1, 0($a0)
  • i2: addi $t0, $0, 100
  • i4: add $v0, $v0, $t1
  • i6: addi $t0, $t0, -1
  • i5: addi $a0, $a0, 4
  • i7: beq $t0, $0, end
  • I8: beq $0, $0, i3
  • end
Add a comment
Know the answer?
Add Answer to:
Consider the execution of the program below on a fully bypassed (i.e. both W-E and M-E...
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
  • MIPS Insertion program.........I could really use some help ASAP

    I have this MIPS program and I'm having trouble with it. This program is user inputs numbers until zero and sorts and print the numbers in order. Please soove this issue. You can use any sorting algorithm except bubble sort.  Need it as soon as possible. Here is the code:.datanum: .word 0space: .byte ' ' .text main:  # la $t0, val # loads val into a register  # li $t1, 0      #keeps track of how many numbers entered  la $a0,...

  • (a) Fill in the following pipeline timing chart showing the execution of the first 5 instructions...

    (a) Fill in the following pipeline timing chart showing the execution of the first 5 instructions as- suming that NO forwarding is available I1: LUI R1, 0x1234 I2: ORI R1, R1, 0x0010 I3: LW I4: LW I5: SUB R4, R3, R2 I6: BGEZ R4, +4 17: SUB R4, R2, R3 I8: SW ; load upper 2 bytes of R1 R2, 0 (R1) R3, 4 (R1) ; load A ; load B compute B-A compute A-B R4, 8 (R1) ;store the...

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

  • Reschedule (i.e., re-order) the instructions within the loop to improve performance. The loop must still produce...

    Reschedule (i.e., re-order) the instructions within the loop to improve performance. The loop must still produce the same results. Show timing of this MIPS instruction sequence through the pipeline, for two iterations of the loop. Show all stalls clearly, and mark with arrows all cases where forwarding takes place, as in our lectures. loop: lw $t0, 0($s0) lw $t1, 4($s0) add $t0, $t1, $t0 sw $t0, 0($s1) addi $s0, $s0, 8 addi $s1, $s1, 4 bne $s0, $s5, loop

  • The task will be to write a program in assembler to enter a number and calculate...

    The task will be to write a program in assembler to enter a number and calculate its associated Fibonacci number using a procedure (subroutine) that is called recursively. Factorial and Fibonacci(outline Programs) # MIPS assembly assembly assemblyassemblycode .data n: .word 4 .text main: la $s0,n lw $a0, 0($s0) jal factorial # move what ever is returned into $a0 move $a0, $v0 li $v0,1 syscall b finished factorial: add $sp , $sp , -8 # make room sw $a0, 4($sp )...

  • 4) Consider the following assembly language code: INSTRUCTIONS T01 T02 T03 T04 T05 T06 T07 T08...

    4) Consider the following assembly language code: INSTRUCTIONS T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 T11 T12 T13 T14 (as a table) Loop: sll $t1, $s3, 2 add $t1, $t1, $s6 lw $t0, 0($t1) beq $t0, $s5, Exit addi $s3, $s3, 1 j Loop Exit: Use a pipeline with forwarding, hazard detection, and 1 delay slot for branches. The pipeline is the typical 5-stage IF, ID, EX, MEM, WB MIPS design. For the above code, complete the...

  • Ch04.2. [3 points] Consider the following assembly language code: I0: ADD R4 R1RO I1: SUB R9R3 R4...

    Ch04.2. [3 points] Consider the following assembly language code: I0: ADD R4 R1RO I1: SUB R9R3 R4; I2: ADD R4 - R5+R6 I3: LDW R2MEMIR3100]; 14: LDW R2 = MEM [R2 + 0]; 15: STW MEM [R4 + 100] = R3 ; I6: AND R2R2 & R1; 17: BEQ R9R1, Target; I8: AND R9 R9&R1 Consider a pipeline with forwarding, hazard detection, and 1 delay slot for branches. The pipeline is the typical 5-stage IF, ID, EX, MEM, WB MIPS...

  • im trying to complete mips program code about a calculator program that can calculate integer addition...

    im trying to complete mips program code about a calculator program that can calculate integer addition / subtraction written using the MIPS assembler. im having hard times to debug this. The input is given to the array of Formula char (base address $ s0) in the form of a formula. The null character (\ 0, ASCII code 0) is placed at the end. The calculation result is given to the register $ s1 and the overflow is ignored. For example,...

  • Write a MIPS program that prints(displays) "Hello World" using MMIO (NOT syscall!) Here is a scre...

    Write a MIPS program that prints(displays) "Hello World" using MMIO (NOT syscall!) Here is a screenshot of a MIPS program that prints user input to the screen. And I need something that displays "Hello World" without taking any input. Please help! Thanks. The output should be something like this but without the input .data 7 strl:.asciiz "\nStart entering characters in the MMIO Simulator" .text 10 .globl echo 12 13 14 15 16 17 echo: al Read # single print statement...

  • The following MIPS program is to be run on a MIPS pipeline processor of 5 stages...

    The following MIPS program is to be run on a MIPS pipeline processor of 5 stages (IF-ID-EX-MEM-WB). Work out and diagram the optimal pipeline schedule using full forwarding from EX or MEM stages to any other stage, Draw the pipeline execution diagram for this code and then compute the pipeline CPI: addi $t6, $t6, 10 sub $t5, $t6, $t4 srl $t5, $t5, 2 sw $t5, 20($t5) lw $t2, 0($t6) add $t7, $t2, $t3 beq $t5, $t7, End

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