• Status: Solved
• Priority: Medium
• Security: Public
• Views: 487

# Computer Organization Polling

Suppose that a 1GHZ processor needs to read 1000 bytes of data from a particular I/O device. The I/O device supplies 1 byte of data every 0.02ms. The code to process the data and store it in a buffer takes 1000 cycles.
. if the processor detects that a byted of data is ready through polling, and a polling iteration takes 60 cycles, how many cycles does the entire operation takes?
. if instead, the processor is interrupted when a byte is ready, and the processor spends the time between interrupts on another task, how many cycles of this other task can the processor complete while the I/O communication is taking place? the overhead for handling an interrupt is 200 cycles

Thnx
krithi
0
krithi
1 Solution

Commented:
. if the processor detects that a byted of data is ready through polling, and a polling iteration takes 60 cycles, how many cycles does the entire operation takes?

Depends on what you mean exactly.  If "entire operation" means reading the whole 1000 bytes, that's going to take 1000 * 0.02ms, or 20 msec, which is 20 million cycles.  It doesnt matter how long the polling takes, as the polling loop has to wait for each byte.

If "entire operation" means reading one byte, that takes 1000 cycles, plus 60 cycles per loop, which again is easier to calculate in terms of the .02 msec pace.

. if instead, the processor is interrupted when a byte is ready, and the processor spends the time between interrupts on another task, how many cycles of this other task can the processor complete while the I/O communication is taking place? the overhead for handling an interrupt is 200 cycles

0.02 msec is 20,000 CPU cycles, and the I/O takes 1000 + 200 cycles, so there's 18,800 cycles left for other tasks
0

Commented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
Accept: grg99 {http:#13958536}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

mbizup
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.