GATE 2018
65 questions
MCQ 41 · NAT 241-mark 30 · 2-mark 35
Questions 61–65 of 65
A processor has 16 integer registers (R0, R1,...,R15) and 64 floating point registers (F0, F1,...,F63). It uses a 2-byte instruction format. There are four categories of instructions: Type-1, Type-2, Type-3, and Type-4. Type-1 category consists of four instructions, each with 3 integer register operands (3Rs). Type-2 category consists of eight instructions, each with 2 floating point register operands (2Fs). Type-3 category consists of fourteen instructions, each with one integer register operand and one floating point register operand (1R+1F). Type-4 category consists of N instructions, each with a floating point register operand (1F).
The maximum value of N is __________.
The maximum value of N is __________.
Answer: 32
An integer register needs 4 bits, an FP register needs 6 bits, and the instruction is 16 bits. Use expanding opcodes:
- Type-1 (12 operand bits): opcode is 4 bits, takes 4 of 16 codes.
- Type-2 (12 bits): opcode is 4 bits, takes 8 codes 4 remain.
- Type-3 (10 bits): opcode is 6 bits: 4 4 = 16 codes, takes 14 2 remain.
- Type-4 (6 bits): opcode is 10 bits: 2 = 32.
Answer: 32
- Type-1 (12 operand bits): opcode is 4 bits, takes 4 of 16 codes.
- Type-2 (12 bits): opcode is 4 bits, takes 8 codes 4 remain.
- Type-3 (10 bits): opcode is 6 bits: 4 4 = 16 codes, takes 14 2 remain.
- Type-4 (6 bits): opcode is 10 bits: 2 = 32.
Answer: 32
Given a language L, define as follows:
for all
The order of a language L is defined as the smallest k such that . Consider the language L1 (over alphabet 0) accepted by the following automaton.
The order of L1 is ______
for all
The order of a language L is defined as the smallest k such that . Consider the language L1 (over alphabet 0) accepted by the following automaton.
The order of L1 is ______
Answer: 2
Reading the automaton, we get (empty string or an odd number of 0s).
- (it has no even lengths except 0)
- For : an odd length plus an odd length gives every even length, so
-
The smallest k with is 2.
Answer: 2
- (it has no even lengths except 0)
- For : an odd length plus an odd length gives every even length, so
-
The smallest k with is 2.
Answer: 2
Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders (numbered as 0, 1, ... , 199), and 256 sectors per track (numbered as 0, 1, ... , 255). The following 6 disk requests of the form [sector number, cylinder number, platter number] are received by the disk controller at the same time:
[120, 72, 2] , [180, 134, 1] , [60, 20, 0] , [212, 86, 3] , [56, 116, 2] , [118, 16, 1]
Currently the head is positioned at sector number 100 of cylinder 80, and is moving towards higher cylinder numbers. The average power dissipation in moving the head over 100 cylinders is 20 milliwatts and for reversing the direction of the head movement once is 15 milliwatts. Power dissipation associated with rotational latency and switching of head between different platters is negligible.
The total power consumption in milliwatts to satisfy all of the above disk requests using the Shortest Seek Time First disk scheduling algorithm is _______.
[120, 72, 2] , [180, 134, 1] , [60, 20, 0] , [212, 86, 3] , [56, 116, 2] , [118, 16, 1]
Currently the head is positioned at sector number 100 of cylinder 80, and is moving towards higher cylinder numbers. The average power dissipation in moving the head over 100 cylinders is 20 milliwatts and for reversing the direction of the head movement once is 15 milliwatts. Power dissipation associated with rotational latency and switching of head between different platters is negligible.
The total power consumption in milliwatts to satisfy all of the above disk requests using the Shortest Seek Time First disk scheduling algorithm is _______.
Answer: 85
Only cylinders count here. SSTF order from 80: 86 (6), 72 (14, reverse), 116 (44, reverse), 134 (18), 20 (114, reverse), 16 (4).
Head movement = 200 cylinders 2 20 = 40 mW. Reversal power = 3 3 15 = 45 mW.
Sum = 85 mW
Answer: 85
Head movement = 200 cylinders 2 20 = 40 mW. Reversal power = 3 3 15 = 45 mW.
Sum = 85 mW
Answer: 85
Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header and a 40-byte TCP header. The packet is forwarded to an IPv4 router that supports a Maximum Transmission Unit (MTU) of 600 bytes. Assume that the length of the IP header in all the outgoing fragments of this packet is 20 bytes. Assume that the fragmentation offset value stored in the first fragment is 0.
The fragmentation offset value stored in the third fragment is _______.
The fragmentation offset value stored in the third fragment is _______.
Answer: 144
Data in the packet: 4500 20 = 4480 bytes. Space for data in each fragment: 600 20 = 580 bytes. This is rounded down to a multiple of 8, so it becomes 576 bytes.
Fragment offsets (in units of 8 bytes): fragment 1 = 0, fragment 2 = 576/8 = 72, fragment 3 = 1152/8 = 144.
Answer: 144
Fragment offsets (in units of 8 bytes): fragment 1 = 0, fragment 2 = 576/8 = 72, fragment 3 = 1152/8 = 144.
Answer: 144
Consider a simple communication system where multiple nodes are connected by a shared broadcast medium (like Ethernet or wireless). The nodes in the system use the following carrier-sense based medium access protocol. A node that receives a packet to transmit will carrier-sense the medium for 5 units of time. If the node does not detect any other transmission in this duration, it starts transmitting its packet in the next time unit. If the node detects another transmission, it waits until this other transmission finishes, and then begins to carrier-sense for 5 time units again. Once they start to transmit, nodes do not perform any collision detection and continue transmission even if a collision occurs. All transmissions last for 20 units of time. Assume that the transmission signal travels at the speed of 10 meters per unit time in the medium.
Assume that the system has two nodes P and Q, located at a distance d meters from each other. P starts transmitting a packet at time t=0 after successfully completing its carrier-sense phase. Node Q has a packet to transmit at time t=0 and begins to carrier-sense the medium.
The maximum distance d (in meters, rounded to the closest integer) that allows Q to successfully avoid a collision between its proposed transmission and P's ongoing transmission is _____.
Assume that the system has two nodes P and Q, located at a distance d meters from each other. P starts transmitting a packet at time t=0 after successfully completing its carrier-sense phase. Node Q has a packet to transmit at time t=0 and begins to carrier-sense the medium.
The maximum distance d (in meters, rounded to the closest integer) that allows Q to successfully avoid a collision between its proposed transmission and P's ongoing transmission is _____.
Answer: 50
Q carrier-senses from t = 0 to t = 5. It would begin sending at t = 6. To avoid a collision, Q must detect P's signal while it is still sensing. So the signal must reach Q by t = 5:
m
Answer: 50
m
Answer: 50