Dynamic vs Static instruction count

梦想与她 提交于 2020-08-27 07:17:20

问题


What is the difference between dynamic and static instruction count?

a. Derive an expression to calculate the user CPU time as a function of following parameters: the dynamic instruction count (N), clock cycle per instruction (CPI) and clock frequency (f)

b. Explain the reason for choosing ‘dynamic’ instruction count as a parameter in Question 3a instead of ‘static’ instruction count


回答1:


The dynamic instruction count is the actual number of instructions executed by the CPU for a specific program execution, whereas the static instruction count is the number of instruction the program has.

We usually use dynamic instruction count as if for example you have a loop in your program then some instructions get executed more than once. Also, in the presence of branches, some instructions may not be executed at all.




回答2:


Execution time (ET) = clock cycles per instruction(CPI) * number of instruction(IC) * cycle duration (CD).

Since a cycle frequency/rate (CR) is simply the inverse of cycle duration I.e cycles per second- and vice versa

ET= (CPI *IC)/CR



来源:https://stackoverflow.com/questions/13458135/dynamic-vs-static-instruction-count

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!