GATE 2011
81 questions
MCQ 811-mark 40 · 2-mark 41
Questions 21–25 of 81
An 8KB direct mapped write-back cache is organized as multiple blocks, each of size 32-bytes. The processor generates 32-bit addresses. The cache controller maintains the tag information for each cache block comprising of the following. 1 Valid bit 1 Modified bit As many bits as the minimum needed to identify the memory block mapped in the cache. What is the total size of memory needed at the cache controller to store metadata
(tags) for the cache?
Answer: (D)
Steps:
- Number of blocks = 8 KB / 32 B = 256 so index = 8 bits and offset = 5 bits
- Tag bits = 32 8 5 = 19 bits
- Bits for each block: 19 + 1 (valid) + 1 (modified) = 21 bits
Total size = 256 21 = 5376 bits
Answer: 5376 bits
- Number of blocks = 8 KB / 32 B = 256 so index = 8 bits and offset = 5 bits
- Tag bits = 32 8 5 = 19 bits
- Bits for each block: 19 + 1 (valid) + 1 (modified) = 21 bits
Total size = 256 21 = 5376 bits
Answer: 5376 bits
An application loads 100 libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random location is given as 10ms. Rotational speed of disk is 6000rpm. If all 100 libraries are loaded from random locations on the disk, how long does it take to load all libraries? (The time to transfer data from the disk block once the head has been positioned at the start of the block may be neglected)
Answer: (B)
The disk spins at 6000 rpm so one full rotation takes 10 ms. The average rotational latency is 5 ms.
Time for each library: 10 ms (seek) + 5 ms = 15 ms. For 100 libraries the total is 1500 ms, which is 1.5 s.
Answer: 1.5 s
Time for each library: 10 ms (seek) + 5 ms = 15 ms. For 100 libraries the total is 1500 ms, which is 1.5 s.
Answer: 1.5 s
On a non-pipelined sequential processor, a program segment, which is a part of the interrupt service routine, is given to transfer 500 bytes from an I/O device to memory.
Initialize the address register
Initialize the count to 500
LOOP: Load a byte from device
Store in memory at address given by address register
Increment the address register
Decrement the count
If count != 0 go to LOOP
Assume that each statement in this program is equivalent to a machine instruction which takes one clock cycle to execute if it is a non-load/store instruction. The load-store instructions take two clock cycles to execute.
The designer of the system also has an alternate approach of using the DMA controller to implement the same transfer. The DMA controller requires 20 clock cycles for initialization and other overheads. Each DMA transfer cycle takes two clock cycles to transfer one byte of data from the device to the memory.
What is the approximate speedup when the DMA controller based design is used in place of the interrupt driven program based input-output?
Initialize the address register
Initialize the count to 500
LOOP: Load a byte from device
Store in memory at address given by address register
Increment the address register
Decrement the count
If count != 0 go to LOOP
Assume that each statement in this program is equivalent to a machine instruction which takes one clock cycle to execute if it is a non-load/store instruction. The load-store instructions take two clock cycles to execute.
The designer of the system also has an alternate approach of using the DMA controller to implement the same transfer. The DMA controller requires 20 clock cycles for initialization and other overheads. Each DMA transfer cycle takes two clock cycles to transfer one byte of data from the device to the memory.
What is the approximate speedup when the DMA controller based design is used in place of the interrupt driven program based input-output?
Answer: (A)
Program-driven I/O: one byte takes load (2) + store (2) + increment (1) + decrement (1) + branch (1), which is 7 cycles.
Total for 500 bytes: 500 7 + 2 (initialisation) = 3502 cycles
DMA: 20 + 500 2 = 1020 cycles
Speed-up = 3502 / 1020 3.4
Answer: 3.4
Total for 500 bytes: 500 7 + 2 (initialisation) = 3502 cycles
DMA: 20 + 500 2 = 1020 cycles
Speed-up = 3502 / 1020 3.4
Answer: 3.4
A computer handles several interrupt sources of which the following are relevant for this question.
Interrupt from CPU temperature sensor (raises interrupt if CPU temperature is too high)
Interrupt from Mouse (raises interrupt if the mouse is moved or a button is pressed)
Interrupt from Keyboard (raises interrupt if a key is pressed or released)
Interrupt from Hard Disk (raises interrupt when a disk read is completed)
Which one of these will be handled at the HIGHEST priority?
Interrupt from CPU temperature sensor (raises interrupt if CPU temperature is too high)
Interrupt from Mouse (raises interrupt if the mouse is moved or a button is pressed)
Interrupt from Keyboard (raises interrupt if a key is pressed or released)
Interrupt from Hard Disk (raises interrupt when a disk read is completed)
Which one of these will be handled at the HIGHEST priority?
Answer: (D)
If the CPU gets too hot, the hardware can be damaged. So this interrupt needs the quickest response. The disk, keyboard and mouse interrupts can wait for a short time.
Answer: Interrupt from CPU temp sensor
Answer: Interrupt from CPU temp sensor
Consider an instruction pipeline with four stages (S1, S2, S3 and S4) each with combinational circuit only. The pipeline registers are required between each stage and at the end of the last stage. Delays for the stages and for the pipeline registers are as given in the figure.
What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation?
What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation?
Answer: (B)
Non-pipelined: there are no pipeline registers, so one instruction takes the sum of the stage delays: 5 + 6 + 11 + 8 = 30 ns.
Pipelined: every stage must fit in one clock, and each stage is followed by a register. So the clock period is the slowest stage plus the register delay: 11 + 1 = 12 ns. One instruction takes 4 12 = 48 ns from start to end, but in steady state one instruction is completed every 12 ns.
Speed-up =
Answer: (B)
Pipelined: every stage must fit in one clock, and each stage is followed by a register. So the clock period is the slowest stage plus the register delay: 11 + 1 = 12 ns. One instruction takes 4 12 = 48 ns from start to end, but in steady state one instruction is completed every 12 ns.
Speed-up =
Answer: (B)