4. [15 points.] A 1 GHz processor needs to read 1000 bytes of data (one byte at
ID: 3699140 • Letter: 4
Question
4. [15 points.] A 1 GHz processor needs to read 1000 bytes of data (one byte at a time) from an IO device. The IO device supplies 1 byte of data in 0.02ms. The processor takes 1000 clock cycles to process each byte of data after it is completely transferred from the IO device. Also the processor takes 100 clock cycles to request the transfer of a byte from the IO device. Suppose the processor detects if a byte has arrived from the device through polling, and a polling iteration takes 60 cycles. Assume that processor neither polls nor initiates transfer of a byte while processing the data. What is the minimum number of cycles that the processor takes to read 1000 bytes of data from the IO device?. What is the ratio of the IO time to the processor time, for reading one byte?Explanation / Answer
Solution:
given,
time taken by I/O to supply 1 byte of data= 0.02 sec
processor frequency= 1 GHz
clock cycle time of the processor= 1/10^9= 1 ns
to transfer 1 byte from I/O
(60 cycles of polling + 100 for I/O request + 1000 for processing) = 1160 cycles
time= 1160 * 10^-9 sec= 1160 ns
to read 1000 bytes of data from I/O
1000 * 1160 ns = 1.16 ms
the processor time will be
0.02 ms * 1000= 20 ms, 1000 is for 1000 bytes, and 100 clock cycle is required by the processor
The ratio will be
=> 20/1.160= 17.2413793103
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.