GATE 2015 (Session 2)
64 questions
MCQ 42 · NAT 221-mark 29 · 2-mark 35
Questions 41–45 of 64
Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate of 50x bytes/sec. If the average seek time of the disk is twice the average rotational delay and the controller's transfer time is 10 times the disk transfer time, the average time (in milliseconds) to read or write a 512-byte sector of the disk is ______.
Answer: 6.1 to 6.2
Go through each value in turn:
- One rotation takes 60 / 15000 s = 4 ms the average rotational delay is 2 ms
- Seek time = 2 2 = 4 ms
- Disk transfer time = 512 / (50 ) = 0.01024 ms
- Controller time = 10 0.01024 = 0.1024 ms
Total time = 4 + 2 + 0.01024 + 0.1024 6.11 ms
Answer: 6.11 (6.1 to 6.2)
- One rotation takes 60 / 15000 s = 4 ms the average rotational delay is 2 ms
- Seek time = 2 2 = 4 ms
- Disk transfer time = 512 / (50 ) = 0.01024 ms
- Controller time = 10 0.01024 = 0.1024 ms
Total time = 4 + 2 + 0.01024 + 0.1024 6.11 ms
Answer: 6.11 (6.1 to 6.2)
A computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit, three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is _____ bits.
Answer: 36
Work through the steps:
- Number of frames = so 19 bits are needed for the translation
- Size of one PTE = 19 + 1 + 1 + 3 = 24 bits = 3 bytes
- Number of entries = 24 MB / 3 B = 8M = pages
Virtual address length = 23 + 13 = 36 bits
Answer: 36
- Number of frames = so 19 bits are needed for the translation
- Size of one PTE = 19 + 1 + 1 + 3 = 24 bits = 3 bytes
- Number of entries = 24 MB / 3 B = 8M = pages
Virtual address length = 23 + 13 = 36 bits
Answer: 36
Consider the intermediate code given below.
(1) i = 1
(2) j = 1
(3) t1 = 5 * i
(4) t2 = t1 + j
(5) t3 = 4 * t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j5 goto (3)
(10) i=i+1
(11) if i5 goto (2)
The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are
(1) i = 1
(2) j = 1
(3) t1 = 5 * i
(4) t2 = t1 + j
(5) t3 = 4 * t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j5 goto (3)
(10) i=i+1
(11) if i5 goto (2)
The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are
Answer: (B)
Leaders are (1), (2) (jump from 11), (3) (jump from 9) and (10) (comes after a jump).
Blocks: B1 = {1}, B2 = {2}, B3 = {3-9}, B4 = {10, 11}, and also Entry and Exit 6 nodes.
The edges are: EntryB1, B1B2, B2B3, B3B3, B3B4, B4B2, B4Exit 7 edges.
Final answer: 6 and 7
Blocks: B1 = {1}, B2 = {2}, B3 = {3-9}, B4 = {10, 11}, and also Entry and Exit 6 nodes.
The edges are: EntryB1, B1B2, B2B3, B3B3, B3B4, B4B2, B4Exit 7 edges.
Final answer: 6 and 7
The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0+1)*(10) is __________.
Answer: 3
The language is all strings that end in "10". Use three states:
- A: no progress (start, or the string ends in 0 but not in 10)
- B: the last symbol is 1
- C: the string ends in 10 (accepting)
Transitions: A on 0 stays in A, on 1 goes to B. B on 0 goes to C, on 1 stays in B. C on 0 goes to A, on 1 goes to B.
The 3 states are distinguishable: the empty string separates C (accepted) from A and B, and the string "0" separates B (goes to C, accepted) from A (stays in A, rejected). So the minimal DFA has 3 states.
Answer: 3
- A: no progress (start, or the string ends in 0 but not in 10)
- B: the last symbol is 1
- C: the string ends in 10 (accepting)
Transitions: A on 0 stays in A, on 1 goes to B. B on 0 goes to C, on 1 stays in B. C on 0 goes to A, on 1 goes to B.
The 3 states are distinguishable: the empty string separates C (accepted) from A and B, and the string "0" separates B (goes to C, accepted) from A (stays in A, rejected). So the minimal DFA has 3 states.
Answer: 3
Which of the following languages is/are regular?
is the reverse of string w
is the reverse of string w
Answer: (A)
is regular. If a string is , its first symbol and last symbol are the same (the first symbol of ), and its length is at least 3. Conversely, a string of length at least 3 that starts and ends with the same symbol has the form with and non-empty. So .
is not regular. If it were, its complement intersected with would be regular. That set is , which is not regular (pumping the 's of breaks the equal count).
is regular. It is the language of .
Answer: (A)
is not regular. If it were, its complement intersected with would be regular. That set is , which is not regular (pumping the 's of breaks the equal count).
is regular. It is the language of .
Answer: (A)