Consider a 1GHz processor, and a hard disk that can transfer data at 16 MB/sec.
ID: 3837079 • Letter: C
Question
Consider a 1GHz processor, and a hard disk that can transfer data at 16 MB/sec. Take 1K = 1000, 1M = 10^6, and 1G = 10^9. Compute the fraction of CPU time consumed by disk interrupts for the following cases: (a) Case 1: Data is transferred in 8-byte chunks using interrupt-driven I/O. Assume the overhead of each interrupt is 500 clock cycles. (b) Case 2: Data is DMA transferred in 4 KB blocks. Assume a DMA setup and completion consumes 1000 cycles. (ii) Consider a 1GHz processor where an instruction that accesses memory and hits the cache takes 1 clock cycle to execute. If an instruction misses the cache, the miss penalty (including detecting the cache miss) is 100 clock cycles. Assuming the miss ratio is 3%, what is the average memory access time?Explanation / Answer
5.
(i) Given 1 GHz processor hence
Clock period is = 1 / 109 = 10-9 s = 1 ns = Cycle Time
(a)
We are transfering data in 8 byte chunks and given data transfer rate is 16MB /s
hence Data transfer time is = 8 B / 16 MBps
= 1 / 2 * 106
= 0.5 * 10-6
= 500 ns
Hence data transfer time is = 500 ns
Given overhead of each interrupt is = 500 cycles = 500 * 1ns = 500 ns
Hence interrupt overhead time is = 500 ns
Fraction of CPU time consumed is
= interrupt overhead time / (interrupt overhead time +data transfer time)
= 500 / (500+500)
= 500 / 1000
= 1/2 (50 %)
Hence 50 % of CPU time will be consumed.
(b)
We are transfering data in 4 KB blocks using DMA and given data transfer rate is 16MB /s
hence Data transfer time is = 4 KB / 16 MBps
= 1 / 4 * 103
= 0.25 * 10-3
= 250 microsecs
Hence data transfer time is = 250 microsecs
Given overhead of DMA is = 1000 cycles = 1000 * 1ns = 1 microsec
Hence DMA overhead time is = 1 microsec
Fraction of CPU time consumed is
= DMA overhead time / (DMA overhead time +data transfer time)
= 1 / (1+250)
= 1 / 251
= 0.39
Hence 0.39 % of CPU time will be consumed.
(ii)
Given 1 GHz processor and hence the clock period is = 1 ns
Hence tge clock cycle time is = 1 ns
Given Miss ratio is = 3 % = 0.03 implies Hit ratio is = 97 % = 0.97
Average Memory access time is = Hit ratio * 1 clock cycle + Miss ratio * 100 clock cycles
= 0.97 * 1 clock cycle + 0.03 * 100 clock cycles
= 0.97 * 1 ns + 0.03 * 100 ns
= 0.97 + 3
= 3.97 ns
Hence Average Memory access time is = 3.97 ns
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.