Question: computer science 6 . For the following code, show all work to calculate the number of instruction cycles required to execute the following code, including
computer science
For the following code, show all work to calculate the number of instruction cycles required to execute the following code, including the time to call this function with BL sumU and the time to return from the function with BXLR You can assume that the pipeline is full before the BL sumU instruction is executed. When calling the function, assume that the count
Assume that most instructions take clock, unconditional branches B BX LR take clocks, and conditional branches take clocks if the branch is taken and if the branch is not taken. Also assume that LDR takes clocks.
wintt sumUconst uintt xl uintt count
address of x in RO count in R return sum in R
sumJ:
MOV R R
MOV RO $
sumUoop:
CMP R $
BEQ sumUend
LDR RR #
ADD RO R R
SUB R R #
B sumloop
sumUend:
BX LR
Clock cycles
If the clock rate is GHz what is the execution time in nanoseconds?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
