Assume that all register-register instructions except jump instructions consume
ID: 2084041 • Letter: A
Question
Assume that all register-register instructions except jump instructions consume 10nJ of energy while unconditional jump instructions consume 20nJ and conditional jump instructions (i.e., branch instructions, whether taken or not consume 25nJ. All memory instructions consume 40nJ. Consider the following program: # a simple counting for loop and a conditional if-then-else statement .data L1:.word 0 times 44, 22, 33, 55 # array for which we will compute the sum .text .globl main main:la existt0, L1 # initialize starting address li existt1, 4 # initialize loop count add existt2, existzero, existzero # initialize sum loop:lw existt3, 0(existt0) # load first element add existt2, existt2, existt3 # update sum addi existt0, existt0, 4 # point to next word addi existt1, existt1, -1 # decrement count bne existt1, existzero, loop # check if done bgt existt2, exist0, then # if the sum is not > 0, move sum to exists0 move exists0, existt2 j exit then:move exists1, existt2 # else the sum > 0, move sum to exists1 exit:li existv0, 10 syscall For the preceding program: a. How much energy is expended in the execution of the above program? b. What is the average power (i.e., Joules dissipated per second) if the processor is executing at 1 GHz?Explanation / Answer
A) There is register to register instructions, memory instructions and conditional jump instructions in the given program. There is no unconditional jump instruction.
so, the total energy consumed in the execution is:
Etotal= E(register to register instructions) + E(memory instructions) + E(conditional jump instructions)
= ( 10 + 40 + 25 ) = 75 nJ
B) The average power = Etotal x f
P = 75 nJ x 1 GHz
P = 75 W
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.