GATE 2026 (Session 2)
65 questions
MCQ 35 · MSQ 11 · NAT 191-mark 30 · 2-mark 35
Questions 56–60 of 65
Consider a system with MB physical memory and a word length of byte. The system uses a direct mapped cache, with block numbers starting from . The word with physical address is mapped to the cache block number . The maximum possible size of the cache (in KB ) for this configuration is ________. (answer in integer)
Note: and
Note: and
Answer: 128
The 1 MB memory has bytes, so addresses have 20 bits:
(bits 19 down to 0).
.
Let the block offset have b bits and the index have L bits. The index field is bits to , and it must have the value 176. The cache size is bytes.
Find 10110000 in the address. It appears only at bits 13 to 6 (bit 13 = 1, bit 12 = 0, bits 11, 10 = 1, bits 9 to 6 = 0). So b = 6, a block size of 64 bytes.
The index may be wider than 8 bits if the extra top bits are 0. Bits 14, 15 and 16 are 0, so the index can grow to bits 16 to 6. Bit 17 is 1, so one more bit would change the index value. So (2048 lines), and the tag is bits 19 to 17, which is .
Largest cache size bytes KB.
Answer: 128 KB
(bits 19 down to 0).
.
Let the block offset have b bits and the index have L bits. The index field is bits to , and it must have the value 176. The cache size is bytes.
Find 10110000 in the address. It appears only at bits 13 to 6 (bit 13 = 1, bit 12 = 0, bits 11, 10 = 1, bits 9 to 6 = 0). So b = 6, a block size of 64 bytes.
The index may be wider than 8 bits if the extra top bits are 0. Bits 14, 15 and 16 are 0, so the index can grow to bits 16 to 6. Bit 17 is 1, so one more bit would change the index value. So (2048 lines), and the tag is bits 19 to 17, which is .
Largest cache size bytes KB.
Answer: 128 KB
A non-pipelined instruction execution unit that operates at GHz clock takes an average of clock cycles to complete the execution of an instruction. To improve the performance, the system was pipelined with a goal of achieving an average throughput of one instruction per clock cycle. However, it could operate only at GHz due to pipeline overheads. While executing a program in the pipelined design, of instructions encountered a stall of cycles due to pipeline hazards. The speed-up obtained by the pipelined design over the non-pipelined one for this program is ________(rounded off to two decimal places)
Note:
Note:
Answer: 2.3 to 2.4
Non-pipelined design: the time for one instruction ns.
Pipelined design: the cycle time ns. The ideal CPI is . But of the instructions get a stall of cycles.
So the average CPI cycles per instruction.
The average time for one instruction in the pipelined design ns.
The speedup .
Answer: 2.34
Pipelined design: the cycle time ns. The ideal CPI is . But of the instructions get a stall of cycles.
So the average CPI cycles per instruction.
The average time for one instruction in the pipelined design ns.
The speedup .
Answer: 2.34
Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at KB, the maximum segment size (MSS) is KB, and the slow start threshold for TCP congestion control is KB. Assume that there are no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the congestion control algorithm of the TCP connection to reach the congestion avoidance phase is ________. (answer in integer)
Note:
Note:
Answer: 4
In TCP slow start, begins at MSS ( KB) and doubles after every round trip. This goes on until it reaches the slow-start threshold ( KB). Then slow start stops and congestion avoidance (growth by 1 MSS per round) takes over. The receiver window of 48 KB is larger than all these values, so it does not limit the sender.
Count each round as one transmission of a full window:
In round , is exactly KB, which equals . So rounds of transmission are needed for the connection to reach the point where congestion avoidance begins.
Answer: 4
Count each round as one transmission of a full window:
In round , is exactly KB, which equals . So rounds of transmission are needed for the connection to reach the point where congestion avoidance begins.
Answer: 4
Consider the digital circuit shown below with two input lines and , two select lines and , and an output line . The blocks and represent active high decoder and -to- multiplexer, respectively. Out of possible input combinations, the number of combinations that produce is ________ (answer in integer)
Note: One input combination is an instance of [].
Note: One input combination is an instance of [].
Answer: 6
In the figure, A and B are the inputs of the 2:4 decoder Q, and S1, S0 are the select lines of the 4-to-1 multiplexer M. The mux inputs are: input 0 = D0, input 1 = 0, input 2 = 1, input 3 = D3. Taking A as the high bit, the decoder outputs are and .
Go through the select values:
: . This is 1 only for : 1 combination.
: : 0 combinations.
: for all 4 values of AB: 4 combinations.
: . This is 1 only for : 1 combination.
Total: .
Answer: 6
Go through the select values:
: . This is 1 only for : 1 combination.
: : 0 combinations.
: for all 4 values of AB: 4 combinations.
: . This is 1 only for : 1 combination.
Total: .
Answer: 6
Consider the following ANSI-C program.
Note: Assume that the program compiles and runs successfully.
#include <stdio.h>
int main(){
int *ptr, a, b, c;
a=5; b=11; c=20;
ptr=&a; *ptr=c; ptr=&c;
a=*(&b); c=*ptr-a;
printf("%d",c);
return(0);
} The output of this program is ________ . (answer in integer) Note: Assume that the program compiles and runs successfully.
Answer: 9
Go through the program one line at a time:
Start with the values: .
Next, (ptr now points to ).
Then → this sets , since ptr points to and we assign it the current value of , which is .
After that, (ptr now points to instead).
Then → this sets , so it overwrites the earlier .
Then → here is itself, since ptr points to . Its value is still , as it has not changed since it was first set, so .
The call prints the final value of , which is .
Answer: 9
Start with the values: .
Next, (ptr now points to ).
Then → this sets , since ptr points to and we assign it the current value of , which is .
After that, (ptr now points to instead).
Then → this sets , so it overwrites the earlier .
Then → here is itself, since ptr points to . Its value is still , as it has not changed since it was first set, so .
The call prints the final value of , which is .
Answer: 9