Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q 5 : Compute the run time of the following program Line No Interpretation Program Instructions Number of cycles per instruction 1 Initialization Index =
Q: Compute the run time of the following program Line No Interpretation Program Instructions Number of cycles per instruction Initialization Index cycle A Label; not an instruction Label: Start cycle Lines are a FOR LOOP If Index then cycle Sum Sum Index; cycle Index Index ; cycle GoTo Label cycle End a Find the no of cycles required for the First iteration of the For loop. pts Note you have to include the cycle count of Initialization. No of cycles for first iteration of FOR loop for initializationfor if condition comparisonfor calculating sumfor updating index variablefor going back to label cycles b What is the total number of cycles used by the above program? pts Total no of cycles no of cycle for initialization of index variable no of iterations of FOR loop number of cycles in one iteration FOR loop cycles cycles c Calculate the time taken by above program in nano seconds for Ghz GHz and MHz CPUs? pts i Time taken in GHz CPU time taken to complete one cycle total no of cycles nanoseconds seconds approx ii Time taken in GHz CPU nanoseconds seconds approx iii Time taken in MHz nanoseconds seconds approx
Q: Compute the run time of the following program
Line No Interpretation Program Instructions Number of cycles per instruction
Initialization Index cycle
A Label; not an instruction Label: Start cycle
Lines are a FOR LOOP If Index then cycle
Sum Sum Index; cycle
Index Index ; cycle
GoTo Label cycle
End
a Find the no of cycles required for the First iteration of the For loop. pts
Note you have to include the cycle count of Initialization.
No of cycles for first iteration of FOR loop for initializationfor if condition comparisonfor calculating sumfor updating index variablefor going back to label cycles
b What is the total number of cycles used by the above program? pts
Total no of cycles no of cycle for initialization of index variable no of iterations of FOR loop number of cycles in one iteration FOR loop cycles cycles
c Calculate the time taken by above program in nano seconds for Ghz GHz and MHz CPUs? pts
i Time taken in GHz CPU time taken to complete one cycle total no of cycles nanoseconds seconds approx
ii Time taken in GHz CPU nanoseconds seconds approx
iii Time taken in MHz nanoseconds seconds approx
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started