The fundamental performance equation CPU time = Instruction Count× Cycles Per In
ID: 3616150 • Letter: T
Question
The fundamental performance equationCPU time = Instruction Count× Cycles Per Instruction × Clock Cycle Time
needs to be revised in some circumstances.
(a) How should the formula be modified if the clock rate islowered to reduce power consumption while the program isrunning?
Some newer processors will alsoraise the clock rate if it seems advantageous, and if it (probably)won't affect power consumption much. Note that heatdissipation and power consumption are closely related.
(b) How should the formula be modified if the program usestwo threads, that can execute on one or two cores?
On one core, the threads take turns; on two cores, if they areavailable, the threads execute simultaneously. For thisproblem, you can ignore techniques like Intel's HyperThreading,which allows two threads to run on one core almost simultaneously,and you can ignore the operating system's overhead costs to managethe threads. CPU time = Instruction Count× Cycles Per Instruction × Clock Cycle Time
Some newer processors will alsoraise the clock rate if it seems advantageous, and if it (probably)won't affect power consumption much. Note that heatdissipation and power consumption are closely related.
Explanation / Answer
(a) Technically, you don't need to make any changes for part(a) because the Clock Cycle Time would change if the Clock Ratechanges since Clock Cycle Time = 1 / Clock Rate But, if you know the CPU Time and its associated Clock Ratefrom sometime before the change and you know the new Clock Rate,then you can simply multiply the old CPU Time by (Old Clock Rate /New Clock Rate) to get the new CPU Time. For explanation asto why, see end of post.(b) The program is guaranteed to be using two threads. Basically the # of threads isn't really the most importantpart. You only need to know how many cores are being used bythe program, which is dependent on more than the number of threads. Thus, since you know that there is always two threads, youhave: CPU time = Instruction Count * Cycles Per Instruction *Clock Cycle Time / # of cores being used by the program This is because, if two threads are running on the same core,it doesn't change the CPU time since nothing is runningsimultaneously. The only time it changes is if commands areexecuted simultaneously.
WORK for part (a) old time = ins count * cycles per ins * old clock cycletime
old clock cycle time = 1 / old clock rate new clock cycle time = 1 / new clock rate
old time = ins count * cycles per ins * 1 / old clock rate, soto get new time = ins count * cycles per ins * 1 / new clock ratefrom the equation for the old time, you simply multiply the oldtime by (old clock rate / new clock rate) (a) Technically, you don't need to make any changes for part(a) because the Clock Cycle Time would change if the Clock Ratechanges since Clock Cycle Time = 1 / Clock Rate But, if you know the CPU Time and its associated Clock Ratefrom sometime before the change and you know the new Clock Rate,then you can simply multiply the old CPU Time by (Old Clock Rate /New Clock Rate) to get the new CPU Time. For explanation asto why, see end of post.
(b) The program is guaranteed to be using two threads. Basically the # of threads isn't really the most importantpart. You only need to know how many cores are being used bythe program, which is dependent on more than the number of threads. Thus, since you know that there is always two threads, youhave: CPU time = Instruction Count * Cycles Per Instruction *Clock Cycle Time / # of cores being used by the program This is because, if two threads are running on the same core,it doesn't change the CPU time since nothing is runningsimultaneously. The only time it changes is if commands areexecuted simultaneously.
WORK for part (a) old time = ins count * cycles per ins * old clock cycletime
old clock cycle time = 1 / old clock rate new clock cycle time = 1 / new clock rate
old time = ins count * cycles per ins * 1 / old clock rate, soto get new time = ins count * cycles per ins * 1 / new clock ratefrom the equation for the old time, you simply multiply the oldtime by (old clock rate / new clock rate) (a) Technically, you don't need to make any changes for part(a) because the Clock Cycle Time would change if the Clock Ratechanges since Clock Cycle Time = 1 / Clock Rate But, if you know the CPU Time and its associated Clock Ratefrom sometime before the change and you know the new Clock Rate,then you can simply multiply the old CPU Time by (Old Clock Rate /New Clock Rate) to get the new CPU Time. For explanation asto why, see end of post.
(b) The program is guaranteed to be using two threads. Basically the # of threads isn't really the most importantpart. You only need to know how many cores are being used bythe program, which is dependent on more than the number of threads. Thus, since you know that there is always two threads, youhave: CPU time = Instruction Count * Cycles Per Instruction *Clock Cycle Time / # of cores being used by the program This is because, if two threads are running on the same core,it doesn't change the CPU time since nothing is runningsimultaneously. The only time it changes is if commands areexecuted simultaneously.
WORK for part (a) old time = ins count * cycles per ins * old clock cycletime
old clock cycle time = 1 / old clock rate new clock cycle time = 1 / new clock rate
old time = ins count * cycles per ins * 1 / old clock rate, soto get new time = ins count * cycles per ins * 1 / new clock ratefrom the equation for the old time, you simply multiply the oldtime by (old clock rate / new clock rate)
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.