4. Consider the following assembly language code: I0: add$t1,$s0,$t4 I1: add$t1,$t1,$t5 I2: lw$s0, value I3: add$s1,$s0,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

4. Consider the following assembly language code: I0: add$t1,$s0,$t4 I1: add$t1,$t1,$t5 I2: lw$s0, value I3: add$s1,$s0,

Post by answerhappygod »

4. Consider the following assembly language code:
I0: add$t1,$s0,$t4
I1: add$t1,$t1,$t5
I2: lw$s0, value
I3: add$s1,$s0,$s1
I4: add$t1,$t1,$s0
I5: lw$t7,($s0)
I6: bnez$t7, loop
I7: add$t1,$t1,$s0
4 Consider The Following Assembly Language Code I0 Add T1 S0 T4 I1 Add T1 T1 T5 I2 Lw S0 Value I3 Add S1 S0 1
4 Consider The Following Assembly Language Code I0 Add T1 S0 T4 I1 Add T1 T1 T5 I2 Lw S0 Value I3 Add S1 S0 1 (43.12 KiB) Viewed 42 times
4. Consider the following assembly language code: 10: add $t1,$30, $t4 11: add $t1,$t1,$t 5 I2: lw $30, value I3: add $31, $30, $31 14: add $1$t1,$ = 0 15: lw $t7, ($30) 16: bez $t7, loop 17: add $t1,$t1,$30 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 forwarding/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? TO T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 add $t1,$30, $t4 IF ID EX MEM WB add $t1,$t1,$t 5 IF ID EX MEM WB lw $30, value IF ID EX MEM WB add $31, $30, $31 $, IF ID EX MEM WB add #t,#ti, 30 IF ID EX MEM WB lw $57, (630) IF ID EX MEM WB lonez $t7, loop IF ID EX MEM WB add $t1,$t1,$30 =, IF ID EX MEM WB Total Cycles used:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply