GATE 2015 (Session 3)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 46–50 of 65
In the network 200.10.11.144/27, the fourth octet (in decimal) of the last IP address of the network which can be assigned to a host is ____________.
Answer: 158
A /27 prefix blocks of 32 addresses. The address 144 falls in the block from 128 to 159.
The address 159 is the broadcast address. So the last address that can go to a host is 158.
Answer: 158
The address 159 is the broadcast address. So the last address that can go to a host is 158.
Answer: 158
Consider a network connecting two systems located 8000 kilometers apart. The bandwidth of the network is 500x bits per second. The propagation speed of the media is 4x meters per second. It is needed to design a Go-Back-N sliding window protocol for this network. The average packet size is bits. The network is to be used to its full capacity. Assume that processing delays at nodes are negligible. Then, the minimum size in bits of the sequence number field has to be ___________.
Answer: 8
Find the two delays:
- Propagation delay: s
- Transmission delay: s
The window size needed to use the link fully is . Go-Back-N needs at least W + 1 = 202 sequence numbers.
Sequence number bits: 8 bits
Answer: 8
- Propagation delay: s
- Transmission delay: s
The window size needed to use the link fully is . Go-Back-N needs at least W + 1 = 202 sequence numbers.
Sequence number bits: 8 bits
Answer: 8
Consider the following reservation table for a pipeline having three stages S1,S2 and S3.
The minimum average latency (MAL) is ________.
The minimum average latency (MAL) is ________.
Answer: 3
From the table, S1 is used at times 1 and 5 (gap 4), S2 at times 2 and 4 (gap 2), and S3 only once. So the forbidden latencies are {2, 4}.
The collision vector has one bit for each latency 4, 3, 2, 1, with 1 meaning forbidden: . Any latency of 5 or more is always allowed.
For each allowed latency, shift the state right by that many places and OR with 1010:
- From 1010, latency 1: 0101 OR 1010 = 1111
- From 1010, latency 3: 0001 OR 1010 = 1011
- From 1111, only latency 5 or more is allowed, which gives 1010
- From 1011, latency 3: 0001 OR 1010 = 1011 again; latency 5 or more gives 1010
Cycles: (3) has average 3. (1, 5) has average . Others such as (3, 5) give 4 and (5) gives 5.
No cycle can average less than 3. A cycle without latency 1 uses only latencies of 3 or more. A latency 1 is always followed by one of 5 or more, so each such pair adds up to at least 6 over 2 latencies.
MAL = 3
Answer: 3
The collision vector has one bit for each latency 4, 3, 2, 1, with 1 meaning forbidden: . Any latency of 5 or more is always allowed.
For each allowed latency, shift the state right by that many places and OR with 1010:
- From 1010, latency 1: 0101 OR 1010 = 1111
- From 1010, latency 3: 0001 OR 1010 = 1011
- From 1111, only latency 5 or more is allowed, which gives 1010
- From 1011, latency 3: 0001 OR 1010 = 1011 again; latency 5 or more gives 1010
Cycles: (3) has average 3. (1, 5) has average . Others such as (3, 5) give 4 and (5) gives 5.
No cycle can average less than 3. A cycle without latency 1 uses only latencies of 3 or more. A latency 1 is always followed by one of 5 or more, so each such pair adds up to at least 6 over 2 latencies.
MAL = 3
Answer: 3
Consider the following code sequence having five instructions I1 to I5. Each of these instructions has the following format.
OP Ri, Rj, Rk
where operation OP is performed on contents of registers Rj and Rk and the result is stored in register Ri.
I1: ADD R1, R2, R3
I2: MUL R7, R1, R3
I3: SUB R4, R1, R5
I4: ADD R3, R2, R4
I5: MUL R7, R8, R9
Consider the following three statements.
S1: There is an anti-dependence between instructions l2 and l5
S2: There is an anti-dependence between instructions l2 and l4
S3: Within an instruction pipeline an anti-dependence always creates one or more stalls
Which one of above statements is/are correct?
OP Ri, Rj, Rk
where operation OP is performed on contents of registers Rj and Rk and the result is stored in register Ri.
I1: ADD R1, R2, R3
I2: MUL R7, R1, R3
I3: SUB R4, R1, R5
I4: ADD R3, R2, R4
I5: MUL R7, R8, R9
Consider the following three statements.
S1: There is an anti-dependence between instructions l2 and l5
S2: There is an anti-dependence between instructions l2 and l4
S3: Within an instruction pipeline an anti-dependence always creates one or more stalls
Which one of above statements is/are correct?
Answer: (B)
Anti-dependence (WAR) means a later instruction writes to a register that an earlier instruction reads.
- S1: I2 and I5 both write R7. This is output dependence, not anti-dependence False
- S2: I2 reads R3 and I4 writes R3 This is anti-dependence True
- S3: In an in-order pipeline, WAR does not cause a stall False
Answer: Only S2 is true
- S1: I2 and I5 both write R7. This is output dependence, not anti-dependence False
- S2: I2 reads R3 and I4 writes R3 This is anti-dependence True
- S3: In an in-order pipeline, WAR does not cause a stall False
Answer: Only S2 is true
Consider the following two C code segments. Y and X are one and two dimensional arrays of size n and nxn respectively, where . Assume that in both code segments, elements of Y are initialized to 0 and each element X[i][j] of array X is initialized to i+j. Further assume that when stored in main memory all elements of X are in same main memory page frame.
Code segment 1:
S1: Final contents of array Y will be same in both code segments
S2: Elements of array X accessed inside the for loop shown in code segment 1 are contiguous in main memory
S3: Elements of array X accessed inside the for loop shown in code segment 2 are contiguous in main memory
Code segment 1:
//initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j
for(i = 0; i < n; i++)
Y[i] += X[0][i]; Code Segment 2: //initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j
for(i = 0; i < n; i++)
Y[i] += X[i][0]; Which of the following statements is/are correct? S1: Final contents of array Y will be same in both code segments
S2: Elements of array X accessed inside the for loop shown in code segment 1 are contiguous in main memory
S3: Elements of array X accessed inside the for loop shown in code segment 2 are contiguous in main memory
Answer: (C)
Check each statement:
- S1: segment 1 adds X[0][i] = i. Segment 2 adds X[i][0] = i. So Y is the same True
- S2: X[0][0], X[0][1], ... lie in one row, so they are contiguous in row-major order True
- S3: X[0][0], X[1][0], ... are n elements apart False
Answer: Only S1 and S2 are correct
- S1: segment 1 adds X[0][i] = i. Segment 2 adds X[i][0] = i. So Y is the same True
- S2: X[0][0], X[0][1], ... lie in one row, so they are contiguous in row-major order True
- S3: X[0][0], X[1][0], ... are n elements apart False
Answer: Only S1 and S2 are correct