CS501 Current Assginment Solution
Page 1 of 1 • Share
CS501 Current Assginment Solution
1. What percentage of time will a 20 MIPS processor spend in the busy wait
loop of 65-character line printer when it takes 3 m-sec to print a character
and a total of 457 instructions need to be executed to print 65 character
lines? Assume that 4 instructions are executed in the polling loop?
Solution:
Out of the total 457 instructions executed to print a line, 65x4=260 is required for polling.
For a 20MIPS processor, the execution of the remaining 197 instructions takes 197/
(20x10
6
) = 9.85 sec.
Since the printing of 65 characters takes 65*3 msec, (195 – 0.00985) = 194.99 msec is
spent in the polling loop before the next 65 characters can be printed. This is 194.99/195
= 99.99 % of the total time
2. Suppose that a certain program takes 500 seconds of elapsed time to execute.
Out of these 500 seconds, 280seconds is the CPU time and the rest is I/O time.
What will be the elapsed time?
Solution:
Elapsed time = CPU time + I/O time.
This gives us the I/O time = 500 – 280 = 220 seconds at the beginning, which is 44 % of
the elapsed time.
[You must be registered and logged in to see this image.]
loop of 65-character line printer when it takes 3 m-sec to print a character
and a total of 457 instructions need to be executed to print 65 character
lines? Assume that 4 instructions are executed in the polling loop?
Solution:
Out of the total 457 instructions executed to print a line, 65x4=260 is required for polling.
For a 20MIPS processor, the execution of the remaining 197 instructions takes 197/
(20x10
6
) = 9.85 sec.
Since the printing of 65 characters takes 65*3 msec, (195 – 0.00985) = 194.99 msec is
spent in the polling loop before the next 65 characters can be printed. This is 194.99/195
= 99.99 % of the total time
2. Suppose that a certain program takes 500 seconds of elapsed time to execute.
Out of these 500 seconds, 280seconds is the CPU time and the rest is I/O time.
What will be the elapsed time?
Solution:
Elapsed time = CPU time + I/O time.
This gives us the I/O time = 500 – 280 = 220 seconds at the beginning, which is 44 % of
the elapsed time.
[You must be registered and logged in to see this image.]
Admin- Y-Nots!
- Posts : 624
Join date : 2011-02-08
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Mon Apr 22, 2024 11:23 am by Joshuaadam
» Aloha Planner - Note-Taker
Thu Apr 11, 2024 4:52 pm by ali001
» Streaming Guide Film TV Series
Tue Apr 09, 2024 9:39 pm by ali001
» Apricot Tree Problems & Solutions ????|خوبانی کے پھل کو کیڑا لگنےسے بچانے کا طریقہ ????
Sun Apr 07, 2024 6:28 am by Zamaan Khan
» خوبانی کے پودے کی کاشت گرم علاقوں میں کرنی چاہیے یا نہی
Sun Apr 07, 2024 6:24 am by Zamaan Khan
» New Here
Sun Apr 07, 2024 6:15 am by Zamaan Khan
» Bajta Hua Sochoon Main Koi Saaz Na Aaye Naat
Sun Apr 07, 2024 6:14 am by Zamaan Khan
» Woh Pagal Si Episode 52 to 62 - Top Pakistani Drama
Sun Apr 07, 2024 6:06 am by Zamaan Khan
» Woh Pagal Si Episode 42 to 51 - Top Pakistani Drama
Sat Apr 06, 2024 4:50 pm by Ch. Ehtisham Gujjar