Question

The pipelined MIPS datapath executes the following code: lw $16, 12($4) lw $17, 16($4) beq $8, $9...

The pipelined MIPS datapath executes the following code:

lw $16, 12($4)

lw $17, 16($4)

beq $8, $9, skip

sw $18, 16($4)

add $18, $16, $18

How many cycles does it take to execute the code if the branch is not taken?

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

ANSWER:

Since there is no data hazard so the second instruction will execute from cycle number 2 itself. Since there which is Instruc

Add a comment
Know the answer?
Add Answer to:
The pipelined MIPS datapath executes the following code: lw $16, 12($4) lw $17, 16($4) beq $8, $9...
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
  • In the class, we have shown how to maximize performance on our pipelined datapath with forwarding...

    In the class, we have shown how to maximize performance on our pipelined datapath with forwarding and stalls on a use following a load. Rewrite the following code to minimize performance on this datapath – that is, reorder the instructions so that this sequence takes the most clock cycles to execute while still obtaining the same result: lw $3, 0($5)
 lw $4, 4($5)
 add $7, $7, $3 add $8, $8, $4 add $10, $7, $8 sw $6, 0($5)
 beq $10,...

  • (60 points) The following instructions are executed on the 5-stage MIPS pipelined datapath. add r...

    Computer architecture help: (60 points) The following instructions are executed on the 5-stage MIPS pipelined datapath. add r5,r2, r1 lw r3, 4(r5) lw r2, 0(r2) or r3, r5, r3 sw r3, 0(r5) (a) (20 points) List the data hazards in the above code. For each data hazard identified, clearly mark the source and the destination. For example you can say, there is a data hazard from instruction X to instruction Y on register Z. (b) (20 points) Assume there is...

  • 2. Consider executing the following code on the five-stage pipelined datapath: add $1, $2, $3 sub...

    2. Consider executing the following code on the five-stage pipelined datapath: add $1, $2, $3 sub $2 $1, Thoora Tropi and $3, $2 $1 or $9, $8, $2 -nepez SW $9, 100($17) lw $9, 100($18) (a) Draw a multiple-clock-cycle pipeline diagram of six instructions in this code, and mark all ti data dependence lines among the instructions in the figure. (109 CES MEMWB) pin E 1 (WVB (b) Indentify all of the data dependencies in this code. Please point out...

  • a).For the following MIPS assembly code to be executed using the pipelined datapath, identify all of...

    a).For the following MIPS assembly code to be executed using the pipelined datapath, identify all of the data dependencies (which register in which instruction needs the result register value from which another instruction?) and enumerate them (give them numbers as 1,2, ...). b).Which dependencies are data hazards that will be resolved via forwarding and without a stall (you can specify the number(s) from the part a)? c).Which dependencies are data hazards that will cause a stall (you can specify the...

  • Consider the following code to be executed on a pipelined processor lw $s1, 40(Ss6) add $s6,...

    Consider the following code to be executed on a pipelined processor lw $s1, 40(Ss6) add $s6, $s2, $s2 sw Ss6, 48(Ss1) a. Include stalls/nops in the code so it executes correctly in the cases of (i) No forwarding (ii) ALU-ALU for warding, (iii) Full forwarding b. In each case calculate the number of clock cycles required to execute the code c. Assume further that the clock cycle time is 110 ps with no forwarding, 120 ps with ALU-ALU forwarding and...

  • 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 12 The datapath for 5-stage MIPS pipelined architecture is given below. IFAD IDEX EX/MEM MEMWB...

    Question 12 The datapath for 5-stage MIPS pipelined architecture is given below. IFAD IDEX EX/MEM MEMWB Add 4 Add Add result Shift left 2 PC Address Instruction ALU Instruction memory Read register 1 Read data 1 Read register 2 "Registers Read Write data 2 register Write data Zero ALU result Address Read data Data memory Write data 16 32 Sign- extend Choose all the components that generate a useful result during the execution of the following instruction: LW R1, 8(R2)...

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

  • Question 4) (12 Marks) This question is based on the MIPS assembly code shown below. data...

    Question 4) (12 Marks) This question is based on the MIPS assembly code shown below. data the Array: space 160 main: li $t6, 1 li $17, 4. sw $17, the Array($0) sw $17, theArray($17) li $t0, 8 loop: addi $t3, $t0, -8 addi $t4, $t0, -4 lw 1, the Array($t3) lw $12, the Array(St4) add $15, $t1, $t2 sw $15, theArray($to) addi $t0, $t0, 4 blt $t0, 160, loop jr Sra. Question 4 Assembly code a) what is the contents...

  • Topics 1. MIPS instruction set architecture (ISA). 2. Performance. 3. MIPS datapath and control. Exercise 1...

    Topics 1. MIPS instruction set architecture (ISA). 2. Performance. 3. MIPS datapath and control. Exercise 1 Consider the memory and register contents shown below. Registers Ox0100 FFF8 13 ($t 5) 14 ($t6) 0x0100 FFFC 0x0101 0000 Memory 0x0000 0000 0x0001 1100 0x0A00 со00 0x1234 4321 OxBAOO OOBB 15 OXAAAA 0000 0x1111 1010 0x7FFF FFFD 0x0100 FFFO 0x0101 0008 (St7) Ox0101 0004 16 ($80) 0x0101 0008 17 ($sl) Show what changes and give the new values in hexadecimal after the following...

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