Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 40: Review Session #2 Reminders –Final exam, Thursday 3:10pm Sloan 150 –Course evaluation (Blue Course Evaluation) Access through.

Similar presentations


Presentation on theme: "Lecture 40: Review Session #2 Reminders –Final exam, Thursday 3:10pm Sloan 150 –Course evaluation (Blue Course Evaluation) Access through."— Presentation transcript:

1 Lecture 40: Review Session #2 Reminders –Final exam, Thursday 12/18/2014 @ 3:10pm Sloan 150 –Course evaluation (Blue Course Evaluation) Access through zzusis 1

2 Problem #5 Suppose we have two different I/O systems, A and B. A has data transfer rate: 5KB/s and has access delay: 5 sec. While B has data transfer rate: 3 KB/s and has access delay: 4 sec. Now we have a 3MB I/O request, taking performance into consideration, which I/O system will you use? What about for a 3KB request? 2

3 Solution #5 3M request –Case 1: t (in sec) = 5 + (3 * 1024 * 1024 ) / (5 * 1024) = 5 + 614.4 = 619.4 –Case 2: t (in sec) = 4 + (3 * 1024 * 1024) / (3 * 1024) = 4 + 1024 = 1028 So system 1 will be chosen. 3K request –Case 1: t (in sec) = 5 + (3 * 1024) / (5 * 1024) = 5.6 –Case 2: t (in sec) = 4 + (3 * 1024) / (3 * 1024) = 5 So system 2 will be chosen. 3

4 Disk Storage Nonvolatile, rotating magnetic storage 4

5 Disk Sectors and Access Access to a sector involves –Queuing delay if other accesses are pending –Seek: move the heads –Rotational latency –Data transfer –Controller overhead 5

6 Problem #6 Suppose we have a magnetic disk with the following parameters: (a) What is the average time to read a single sector? (b) What is the average time to read 8 KB in 16 consecutive sectors in the same cylinder? (c) Now suppose we have an array of 4 of these disks. They are all synchronized such that the arms on all the disks are always on the same sector within the track. The data is striped across the 4 disks so that 4 logically consecutive sectors can be read in parallel. What is the average time to read 32 consecutive KB from the disk array? 6 Average seek time12 ms Rotation rate3600 RPM Transfer rate3.5 MB/second # sectors per track64 Sector size512 bytes Controller overhead5.5 ms

7 Solution #6 (a) –Disk Access Time = seek time + rotational delay + transfer time + controller overhead –Thus, 12 + (0.5*60*10 3 /3600) + (512/(3.5*2 20 ))*1000 + 5.5 = 25.97 ms (b) –Only the transfer time gets changed. –Disk Access Time = seek time + rotational delay + transfer time + controller overhead –Thus, 12 + (0.5*60*10 3 /3600) + (8*1024/(3.5*2 20 ))*1000 + 5.5 = 28.07 ms (c) –Since 4 logically consecutive sectors can be read at once, we can read off 2 KB at once (each sector is 512 bytes). To read 32 KB, we need to read 16 sectors on each disk. So, the time taken is the same as in (b) 7

8 Set Associative Cache Organization 8

9 Problem #7 Consider a 64-byte cache with 8 byte blocks, an associativity of 2 and LRU block replacement. Virtual addresses are 16 bits. The cache is physically tagged. The processor has 16KB of physical memory. What is the total number of tag bits? 9

10 Solution #7 The cache is 64-bytes with 8-byte blocks, so there are 8 blocks. The associativity is 2, so there are 4 sets. Since there are 16KB of physical memory, a physical address is 14 bits long. Of these, 3 bits are taken for the offset (8- byte blocks), and 2 for the index (4 sets). That leaves 9 tag bits per block. Since there are 8 blocks, that makes 72 tag bits or 9 tag bytes. 10

11 Problem #8 Assume the following 10-bit address sequence generated by the microprocessor: The cache uses 4 bytes per block. Assume a 2-way set associative cache design that uses the LRU algorithm (with a cache that can hold a total of 4 blocks). Assume that the cache is initially empty. (a) determine the TAG, SET, BYTE OFFSET fields and fill in the table above. (b) In the figure below (for initial state and accesses 0 to 7), clearly mark for each access the TAG, Least Recently Used (LRU), and HIT/MISS information. (c) Derive the hit ratio for this access sequence! 11 Time01234567 Access 1000110110110010101111111000110010011100111010011111111011101001 TAG SET OFFSET Initial Block 0 Block 1 Set 0 Set 1

12 Solution #8 (a) (b) –In the following each access is represented by a triple: (Tag, LRU Bit, Hit Bit) –LRU bit = 1 if the current block is the least recently used one. Hit Bit = 1 if the current reference is a hit 12 Time01234567 Access 1000110110110010101111111000110010011100111010011111111011101001 TAG 1000110110101111000110011111011111111101 SET 10111010 OFFSET 01101100 011001 Initial Block 0 Block 1 Set 0 Set 1 Access 0 Block 0 Block 1 Set 0 Set 110001,0,0 Access 1 Block 0 Block 1 Set 010110,0,0 Set 110001,0,0 Access 2 Block 0 Block 1 Set 010110,0,0 Set 110001,1,0 10111,0,0

13 Solution #8 (Cont’d.) 13 Access 3 Block 0 Block 1 Set 010110,0,0 Set 110001,0,1 10111,1,0 Access 4 Block 0 Block 1 Set 010110,0,0 Set 110001,1,0 10011,0,0 Access 5 Block 0 Block 1 Set 010110,1,0 11101,0,0 Set 110001,1,0 10011,0,0 Access 6 Block 0 Block 1 Set 010110,1,0 11101,0,0 Set 111111,0,0 10011,1,0 Access 7 Block 0 Block 1 Set 011101,0,0 Set 111111,0,0 10011,1,0 (c) The hit ratio for the above access sequence is given by : (1/8) = 0.125


Download ppt "Lecture 40: Review Session #2 Reminders –Final exam, Thursday 3:10pm Sloan 150 –Course evaluation (Blue Course Evaluation) Access through."

Similar presentations


Ads by Google