Question: 4. Consider the following MIPS assembly language code fragment. enigma addi $3, $0, 1000 s11 $3, $3, 2 add $3, $3, $1 add $2, $0,

4. Consider the following MIPS assembly language code fragment. enigma addi $3, $0, 1000 s11 $3, $3, 2 add $3, $3, $1 add $2, $0, $0 lw $4, 0($1) slt $5, $4, $0 beq $5, $0, skip sub $4, $0, $4 add $2, $2, $4 addi $1, $1, 4 slt $5, $1, $3 bne $5, $0, loop loop skip: Assume this code is run on a machine that requires the following number of cy- cles for each instruction. Instruction Cycles add, addi, sll, slt, sub3 bne If the clock speed of the machine is 3.75 GHz, how many seconds will it take to execute this code in the worst case, (i.e., longest possible execution time)? 4. Consider the following MIPS assembly language code fragment. enigma addi $3, $0, 1000 s11 $3, $3, 2 add $3, $3, $1 add $2, $0, $0 lw $4, 0($1) slt $5, $4, $0 beq $5, $0, skip sub $4, $0, $4 add $2, $2, $4 addi $1, $1, 4 slt $5, $1, $3 bne $5, $0, loop loop skip: Assume this code is run on a machine that requires the following number of cy- cles for each instruction. Instruction Cycles add, addi, sll, slt, sub3 bne If the clock speed of the machine is 3.75 GHz, how many seconds will it take to execute this code in the worst case, (i.e., longest possible execution time)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
