Question

Ch04.2. [3 points] Consider the following assembly language code: I0: ADD R4 R1RO I1: SUB R9R3 R4; I2: ADD R4 - R5+R6 I3: LDWLabel all data stalls (Draw an X in the box). Label all data forwards that the forwarding unit detects (arrOw between the sta

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 design. For the above code, complete the pipeline diagram below (instructions on the left, cycles on top) for the code. Insert the characters IF, ID, EX, MEM, WB for each instruction in the boxes. Assume that there two levels of bypassing, that the second half of the decode stage performs a read of source registers, and that the first half of the write-back stage writes to the register file.
Label all data stalls (Draw an X in the box). Label all data forwards that the forwarding unit detects (arrOw between the stages handing off the data and the stages receiving the data). What is the final execution time of the code? T1 T2 T3 T4 T5 T6 T8 T9 T10 T11 T12 T13 T14T15 T16T17 IO 12 13 14 15 16 17 18
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Clocx 23456 工多 工与 exe | Mon |闪ム clocks

Add a comment
Know the answer?
Add Answer to:
Ch04.2. [3 points] Consider the following assembly language code: I0: ADD R4 R1RO I1: SUB R9R3 R4...
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
  • 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...

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

  • c. The classic five-stage pipeline MIPS architecture is used to execute the code fragments. Assume the...

    c. The classic five-stage pipeline MIPS architecture is used to execute the code fragments. Assume the followings: 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 second stage of the pipeline and the architecture does not utilize any branch prediction mechanism Forwarding is fully supported Clock Cycle à 1 2 3 4 5 6 7 8 9 10 11 12...

  • a) Describe the main techniques used by superscalar processors to achieve a high degree of machine-level parallelism. Consider the following assembly code: I1: LOAD r3 (r1) TO 12: MOVE r4 #1 1...

    a) Describe the main techniques used by superscalar processors to achieve a high degree of machine-level parallelism. Consider the following assembly code: I1: LOAD r3 (r1) TO 12: MOVE r4 #1 13: ADD r3 r3 r4 I4: LOAD r2 (r2) 15: MOVE r4 #2 I6: MUL r2 r2 r4 17: MUL r3 r3 r2 I8: LOAD r4 (r1) 19: MOVE r1 #3 I10: ADD r4 r4 r1 I11: MUL r3 r3 r4 Using register renaming reorganise the code from the...

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

  • Consider a standard 5-stage MIPS pipeline of the type discussed during the class sessions: IF- ID-EX-M-WB....

    Consider a standard 5-stage MIPS pipeline of the type discussed during the class sessions: IF- ID-EX-M-WB. Assume that forwarding is not implemented and only the hazard detection and stall logic is implemented so that all data dependencies are handled by having the pipeline stall until the register fetch will result in the correct data being fetched. Furthermore, assume that the memory is written/updated in the first half of the clock cycle (i.e. on the rising edge of the clock) and...

  • I need help plz 6. 4-stage MIPS pipeline: It has "IF, ID-EX, MEM, WB" stages. Specify...

    I need help plz 6. 4-stage MIPS pipeline: It has "IF, ID-EX, MEM, WB" stages. Specify how many stalls (or bubbles) are required for the following cases. Assume that there is a forwarding logic and branch condition is determined at ID-EX stage. No delayed branch is assumed. (a) lw $1, 4($0) add $2, $1, $1 (b) lw $1, 4($0) beq $1, $2, add $3, $4, $5 X: sub $3, $3, $5 7. For problem 2 (c), how many bubbles are...

  • 4.10 In this exercise, we examine how resource hazards, control hazards, and Instruction Set Arch...

    4.10 In this exercise, we examine how resource hazards, control hazards, and Instruction Set Architecture (ISA) design can affect pipelined execution. Problems in this exercise refer to the following fragment of MIPS code: sw r16,12(r6) lw r16,8(r6) beq r5,r4,Label # Assume r5!=r4 add r5,r1,r4 slt r5,r15,r4 Assume that individual pipeline stages have the following latencies: (NOTE THESE ARE DIFFERENT VALUES THAN THE ONES IN OTHER SIMILAR QUESTIONS) IF ID EX MEM WB 250ps 100ps 175ps 150ps 200ps 4.10.4 [10] <§4.5>...

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

  • Consider the following operations: A B- C The corresponding assembly code instruction list generated by a compiler are 1 load [%r0 +4], %r1 2 load [%r0 + 8], %r2 3 sub %r1, %r2,%r3 4 load [ZrO + 1...

    Consider the following operations: A B- C The corresponding assembly code instruction list generated by a compiler are 1 load [%r0 +4], %r1 2 load [%r0 + 8], %r2 3 sub %r1, %r2,%r3 4 load [ZrO + 12], %r4 5 add %r3, %r4 , %r5 6 store %r3, [%r0 + 16] 7 store %r5, [%r0 + 20] a) Identify the potential pipeline hazards. (10 points) b) State if the found hazards can be eliminated and if so propose a scheme...

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