GATE 2007
184 questions
MCQ 1841-mark 184
Questions 61–65 of 184
Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?
Answer: (A)
The starting address .
First, find the block where the array starts: exactly, so the array begins at the start of block 68.
Array size , and . The array starts at a block boundary, so it needs 40 blocks: .
The first block maps to cache block , and after that the blocks are accessed in sequence.
The table below shows that line number to is replaced by the array in the second access.
Blocks 96 to 107 wrap around to lines 0 to 11. In the first pass, lines 4 to 11 first hold blocks 68 to 75 and are then overwritten by blocks 100 to 107.
In the second pass, lines 0 to 3 and 12 to 31 still hold the blocks that are needed (hits). Lines 4 to 11 hold 100 to 107 but now need 68 to 75, so these lines are replaced.
Answer: (A)
How many data cache misses will occur in total?
Answer: (C)
Number of bits in an address =
Each cache line bytes, so the offset needs
The cache has lines in total, so the line number needs
So, the tag bits
We have a and each of its elements has a size of
Total size of this array
So, the number of lines the array needs in the cache is
The start address is , a multiple of 64. So the array begins at a block boundary and needs the full 40 lines.
Starting address of the array
The group of bits in the middle gives the cache line number the array starts from cache line number .
We need cache lines to hold all the array elements, but we have only cache lines.
Split the array elements into those array lines. We call the first array line , and it has of its elements.
This line (a group of elements) of the array maps to cache line number , as found from the starting address of the array above.
This means that among those array lines, some array lines map to the same cache line, because there are just cache lines but array lines.
The mapping is like this:
The array is read in order, so each block is fully used before the next one is fetched.
First pass: each of the 40 blocks misses once, giving 40 compulsory misses. Lines 4 to 11 first get and are then overwritten by .
Second pass: miss again (8 misses), hit, and miss again (8 misses). That is 16 misses.
Total misses .
Answer: (C)
Answer: (D)
Find the number of sets first:
So the number of index (LINE) bits . The number of WORD bits , because the cache block (line) size is
So the number of TAG bits
Answer is choice (D)
Number of tracks = 500
Number of sectors/track = 100
Number of bytes /sector = 500
Time taken by the head to move from one track to adjacent track = 1 ms
Rotation speed = 600 rpm.
What is the average time taken for transferring 250 bytes from the disk ?
Answer: (D)
- Seek: the farthest seek is tracks. Take the average seek as half of this, tracks. At ms per track this is ms.
- Rotation: rpm is rotations per second, so one rotation takes ms. Average latency is half a rotation, ms.
- Transfer: a track has sectors, so one sector passes the head in ms. bytes is half a sector of bytes, so it takes ms.
Total ms.
Answer: (D)
Answer: (A)
The total number of sectors is so 19 bits are needed to point to one sector.
Answer: 256 Mbyte, 19 bits