GATE 2008
185 questions
MCQ 1851-mark 52 · 2-mark 133
Questions 66–70 of 185
Consider a machine with a 2-way set associative data cache of size 64Kbytes and block size 16bytes. The cache is managed using 32 bit virtual addresses and the page size is 4Kbyts. A program to be run on this machine begins as follows:
The total size of the tags in the cache directory is
double ARR[1024][1024];
int i, j;
// Initialize array ARR to 0.0
for(i = 0; i < 1024; i++)
for(j = 0; j < 1024; j++)
ARR[i][j] = 0.0; The size of double is 8Bytes. Array ARR is located in memory starting at the beginning of virtual page 0xFF000 and stored in row major order. The cache is initially empty and no pre-fetching is done. The only data memory references made by the program are those to array ARR The total size of the tags in the cache directory is
Answer: (D)
Number of sets , so the index needs 11 bits.
A block has 16 bytes, so the offset needs 4 bits.
Tag bits .
Number of cache blocks .
Total tag size .
Answer: (D)
A block has 16 bytes, so the offset needs 4 bits.
Tag bits .
Number of cache blocks .
Total tag size .
Answer: (D)
For inclusion to hold between two cache levels L1 and L2 in a multi-level cache hierarchy, which of the following are necessary?
I. L1 must be a write-through cache
II. L2 must be a write-through cache
III. The associativity of L2 must be greater than that of L1
IV. The L2 cache must be at least as large as the L1 cache
I. L1 must be a write-through cache
II. L2 must be a write-through cache
III. The associativity of L2 must be greater than that of L1
IV. The L2 cache must be at least as large as the L1 cache
Answer: (A)
Inclusion means every block present in L1 must also be present in L2.
I is not needed. Inclusion is about which blocks are present, not how L1 handles writes. A write-back L1 can also keep inclusion.
II is not needed. It decides when L2 writes reach memory, which has no effect on which blocks L2 holds.
III is not needed. L2 does not need higher associativity. Inclusion can be kept by removing the L1 copy whenever L2 evicts that block.
IV is needed. L2 must be able to hold every block that L1 holds, so L2 must be at least as large as L1.
Answer: (A)
I is not needed. Inclusion is about which blocks are present, not how L1 handles writes. A write-back L1 can also keep inclusion.
II is not needed. It decides when L2 writes reach memory, which has no effect on which blocks L2 holds.
III is not needed. L2 does not need higher associativity. Inclusion can be kept by removing the L1 copy whenever L2 evicts that block.
IV is needed. L2 must be able to hold every block that L1 holds, so L2 must be at least as large as L1.
Answer: (A)
For a magnetic disk with concentric circular tracks, the seek latency is not linearly proportional to the seek distance due to
Answer: (B)
To move from one track to another, the arm must first speed up, then slow down and stop exactly on the target track. This start and stop time (inertia) is a fixed cost. For short seeks the arm never reaches full speed, so the seek time does not grow in proportion to the distance. That is why seek latency is not linearly proportional to seek distance.
(A) and (D) change which requests come and in what order, not how long the arm takes to move a given distance.
(C) Track capacity affects the transfer time, not the arm movement.
Answer: (B)
(A) and (D) change which requests come and in what order, not how long the arm takes to move a given distance.
(C) Track capacity affects the transfer time, not the arm movement.
Answer: (B)
Which of the following statements about synchronous and asynchronous I/O is NOT true?
Answer: (A)
In both synchronous and asynchronous I/O, the device raises an interrupt when the transfer finishes, and an ISR runs. The two differ only in what the calling process does.
(B) is true: an ISR is invoked on completion in both cases.
(C) is true: a synchronous call blocks the process until the I/O is done; an asynchronous call returns at once.
(D) is true: in synchronous I/O the ISR wakes the blocked process.
(A) is false: it says no ISR is invoked in asynchronous I/O. The ISR still runs; it then notifies the process (by a signal or callback) instead of waking a blocked one.
Answer: (A)
(B) is true: an ISR is invoked on completion in both cases.
(C) is true: a synchronous call blocks the process until the I/O is done; an asynchronous call returns at once.
(D) is true: in synchronous I/O the ISR wakes the blocked process.
(A) is false: it says no ISR is invoked in asynchronous I/O. The ISR still runs; it then notifies the process (by a signal or callback) instead of waking a blocked one.
Answer: (A)
A non pipelined single cycle processor operating at 100 MHz is converted into a synchronous pipelined processor with five stages requiring 2.5 nsec, 1.5 nsec, 2 nsec, 1.5 nsec and 2.5 nsec, respectively. The delay of the latches is 0.5 nsec. The speedup of the pipeline processor for a large number of instructions is:
Answer: (C)
A single-cycle processor does a whole instruction in one clock, so its cycle time comes from the clock frequency:
In the pipelined processor the clock must fit the slowest stage plus the latch delay:
For a large number of instructions, in both cases, so
Answer: (C)
In the pipelined processor the clock must fit the slowest stage plus the latch delay:
For a large number of instructions, in both cases, so
Answer: (C)