Cs Pre Gate 2020

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

PRE‐GATE‐2020

Computer Science Engineering


(Questions with Detailed Solutions)
The GA section consists of 10 questions. Questions 1 to 5 are of 1 mark each, and
Questions 6 to 10 are of 2 marks each.
01. Fill in the blank with an appropriate If you had gone to see him, he _______
phrase delighted.
Jobs are hard to _____ these days (A) Would have been
(A) Come by (B) Come down (B) Will have been
(C) Come of (D) Come from (C) Had been
01. Ans: (A) (D) Would be
Sol: ‘Come by’ means to manage to get 03. Ans: (A)
something. Ans: ‘A” conditional tense type 3 grammatical
code is
02. The question below consists of a pair of If +had+V3, would +have+V3
related words followed by four pairs of
words. Select the pair that best expresses 04. Which of the following options is closest
the relation in the original pair. in meaning to the underlined word?
MONKEY : TROOP: European intellectuals have long debated
(A) sheep : hard the consequences of the hegemony of
(B) elephant : Parliament American popular culture around the
(C) bacteria : Colony world.
(D) wolves : School (A) regimen
(B) vastness
02. Ans: (C) (C) dominance
Sol: Troop consists of monkeys just as a colony (D) popularity
consists of bacteria. 04. Ans: (C)
Sol: Dominance means influence or control
03. Choose the most appropriate word from over another country, a group of people
the options given below to complete the etc.
following sentence:
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 2 : PRE‐GATE_2020

05. How many one-rupee coins, 50 paise (A) Critical reading is a slow, dull but
coins, 25 paise coins in total of which the essential process.
numbers are proportional to 5, 7 and 12 are (B) The best critical reading happens at
together work ₹115? critical times in a person’s life.
(C) Readers should get in the habit of
(A) 50, 70, 120
questioning the truth of what they read.
(B) 60, 70, 110
(D) Critical reading requires thoughtful
(C) 70, 80, 90
and careful attention.
(D) None of these
06. Ans: (D)
05. Ans: (A)
Sol: Choice (A) is incorrect because the author
Sol: (51+70.5+120.25) x = 115 never says that reading is dull.
(5+3.5+3)x = 115 Choice (B) and (C) are not supported by
11.5x = 115 the paragraph.
x = 10 Choice (D) is correct as it is implied in the
entire passage.
 Number of one rupee coins
= 5x = 510 = 50 07. Anil’s house faces east from the back-side
Number of 5-paise coins of the house, he walks straight 50 metres,
= 7x = 710 = 70 then turns to the right and walks 50m again
Number of 25-paise coins finally, he turns towards left and stops after
= 12x = 1210 = 120 walking 25m. Now Anil is in which
direction from the starting point?
06. Critical reading is a demanding process. (A) South-east (B) South-west
To read critically, you must slow down (C) North-east (D) North-west
your reading and with pencil in hand, 07. Ans: (D)
perform specific operations on the text, Sol: The movement of Anil are shown in the
mark up the text with your reactions, adjoining figure
25m
conclusions, and questions, then you read, D C

become an active participant.


This passage best supports the statement
50m
that
B A

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 3 : Computer Science Engineering

He starts walking from back of his house 153


Profit of B =  254 = ₹76
(i.e) towards west now, the final position is 509

D, which is to the north west of his starting 196


Profit of C =  254 = ₹98
point A. 509

Hence option ‘B’ is correct.


08. A and B enter into a partnership, A puts in
₹50 and B puts in ₹45. At the end of 4 09. A sum of ₹25400 was lent out in two parts,
months, A withdraws half his capital and at 1
one of 12% and the other at 12 % of the
1 2
the end of 5 months B withdraws of his,
2
total annual income is ₹3124.2, the money
C then enters with a capital of ₹70 at the
lent at 12% is ____.
end of 12 months, the profit of concern is
(A) ₹15240 (B) ₹25400
₹254, how can the profit be divided among

A, B and C ? (C) ₹10160 (D) ₹31242

(A) ₹76, ₹80 and ₹98 09. Ans: (C)


Sol: Overall rate of interest
(B) ₹80, ₹76 and ₹98
3124.2
100  12.3%
(C) ₹76, ₹98 and ₹80 25400
2nd part
1st part
(D) None of these 1
12% 12 %
08. Ans: (B) 2

Sol: A’s share: B’s share : C’s share


(504+258): (455+22.57) : (707) 12.3%

400 : 382.5 : 490


0.3%
800 : 765 : 980 0.2%

160 : 153 : 196  The sum will be divided in the ratio


Total profit = ₹254 0.2:0.3 (or) 2:3

Profit of A 2
 The sum lent at 12% = 25400 
5
160 160
=  254   254 = ₹80
160  153  196 509 = ₹10160.

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 5 : Computer Science Engineering

10. The following question is to be answered (A) SELECT loan_number FROM loan
on the basis of the table given below. GROUP BY amount;
(B) SELECT loan_number FROM loan
Number of Number of
Category of SORT BY amount;
staff in the staff in the
personnel
year-1990 year-1995
(C) SELECT loan_number FROM loan
Data
18 25
preparation ORDER BY amount ASCENDING;
Data control 5 8
(D) SELECT loan_number FROM loan
Operators 18 32
ORDER BY amount;
Programmers 21 36
11. Ans: (D)
Analysts 15 31
Sol: The ORDER BY clause is used to sort list
Managers 3 3
items in ascending order by default. We
Total 80 135
also use DSC or ASC to sort the values in
What is the increase in the sector angle for descending or ascending order
operators in the year 1995 over the sector respectively.
angle for operators in the year 1990? Options (A) and (B) are incorrect since
(A) 4 (B) 3 (C) 2 (D) 1 option (B) generates the error message,
10. Ans: (A) SQL command not properly ended since
Sol: Sector angle for operators in the year 1990 SORT BY is not valid for this.
18 Option (A) also generates error message,
  360  81
80
not a GROUP BY expression.
Sector angle for operator in the year 1995
So options (A), (B) and (C) are incorrect.
32
  360 = 85.33 ≃ 85%
135
12. Let L1, L2, L3 be three languages
∴Required difference = 85– 81= 4
L1 = {an bn cm | m, n  1}
L2 = {an bm cm | m, n  1}
11. Which is the correct SQL command to
L3 = {an bn cn | n  1}
display the loan numbers of the customers
in ascending order of their loan amounts.
Choose the correct answer
Primary key is underlined in the schema.
(A) L1  L3 (B) L2  L3
loan(loan_number, branch_name, amount)
(C) L1  L2 (D) L3  L1
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 6 : PRE‐GATE_2020

12. Ans: (D) 14. Ans: (D)


Sol: L1 = {an bn cm | m, n  1} Sol: FIRST(S) = {a, b}
= {abc, abcc, aabbc, …….}
FOLLOW(B) = {b}
L2 = {an bm cm | m, n  1}
FOLLOW(S) = {$, b}
= {abc, aabc, abbcc, …….}
FOLLOW(A) = {a}
L3 = {an bn cn | n  1}
= {abc, aabbcc, …….}
L3  L1 and L3  L2 15. In a system using simple segmentation, the
No relation exist between L1 and L2 address space has 256 segments. Each
segment is offsetted by 12 bits. The size of
13. In Go-Back-N protocol, if the maximum logical address in bits is
window size is 256. What is the range of (A) 20 bits (B) 8 bits
sequence number? (C) 18 bits (D) 28 bits
(A) 0 to 257 (B) 1 to 257 15. Ans: (A)
(C) 0 to 256 (D) 1 to 256 Sol: Each Segment is addressed by 8 bits.
13. Ans:(C) Segment Offset is 12 bits. Hence adding
Sol: In GB-N, if maximum window size is N them together the size of LA is 20 bits
then we need N+1 sequence number i.e., 0
to N(0 to 256). 16. Which of the following is false in the case
of a spanning Tree of a graph G?
14. Consider the following Context-Free (A) It is tree that spans G
Grammar G = {{S,A,B},S,{a,b},P} (B) It includes every vertex of the G
where P is (C) It is a subgraph of G
S → AaBb (D) It can be either cyclic (or) acyclic
S → Bb 16. Ans: (D)
A →  | Sb
B→ Sol: Each spanning Tree of a graph is subgraph
Which of the following set does not of the graph and it includes every vertex of
contain ‘b’? graph. Spanning Tree is always acyclic
(A) FIRST(S) (B) FOLLOW(B)
(C) FOLLOW(S) (D) FOLLOW(A)

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 7 : Computer Science Engineering

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 8 : PRE‐GATE_2020

2 1 1  (A) Two input OR Gate


17. If A  0 1 0 then (B) Two input AND Gate
1 1 2 (C) Two input NAND Gate
Which of the following is not true? (D) Two input NOR Gate
S1: A has 3 distinct eigen values 18. Ans: (C)
S2: A has 3 Linearly independent eigen Sol: Given f(A,B) = [AB]  [A+B]
vectors = [AB] [A+B]+ [A  B][A  B]
(A) S1 is true and S2 is false
[ A  B =AB]
(B) S1 is false and S2 is true
 [A.B  AB][A  B]  [AB] [ A.B]
(C) Both S1 and S2 are true
(D) Neither S1 nor S2 is true  A.AB  0  0  AB.B  [AB  A B][ A B]
17. Ans: (B)  AB  AB  0  A B
Sol: The characteristic equation is |A– I | = 0  AB  AB  A B

2 1 1  AB  A[B  B]
 0 1  0 0
 AB  A [B  B  1]
1 1 2
 A  AB
 = 1, 1, 3
AB [ x  x y  x  y]
 S1 is not true
f  AB =two input NAND Gate
For  = 1, the eigen vectors are given by
(A – I) X = 0 A f  AB
x+y+z=8 B

 For =1, we have two Linearly



independent eigen vectors   sin  cos 4  d is
4
19. The value of
0
For  = 2 there exists only index eigen
vector, because 2 is a distinct eigen value. 32 3 2
(A) (B)
128 256
 S2 is true
3 3
(C) (D)
128 256
18. The simplified expression of
f(A, B) = [AB]  [A+B] represents

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 9 : Computer Science Engineering

19. Ans: (B) 21. Match List-I (types of cache misses) with
 List-II (solution to reduce miss of specific
  sin  cos  d
4 4
Sol:
0
type)
List-I List-II


  sin  cos  d
4 4
p. Conflict miss 1. Increase cache size
2 0
q. Capacity miss 2. Increase block size
 a a 
  0 x f x  dx  2 0 f  x  dx 
a
r. Compulsory miss 3. Increase associativity
  Codes
/2
p q r
   sin 4  cos 4  d
0 (A) 1 2 3
(B) 2 3 1
  2a f x dx  2 a f x dx if f 2a  x  f x
 0 0  (C) 3 2 1
(D) 3 1 2
(3.1) 3.1  21. Ans: (D)
 By Reduction formula
8 .6 .4 .2 2

3 2 22. 127.0.127.195 is a
=
256 (A) Limited Broadcast Address
(B) Direct Broadcast Address
20. Choose the wrong statement (C) Multicast Address
(A) the class of all formal languages is (D) Loop Back Address

countably infinite 22. Ans: (D)


Sol: Any IP Address which have 1st octet value
(B) the set of all primes is countably
as 127 is called as Loop Back Address.
infinite
(C) the class of all DCFLs is countably 23. Which of the following is NOT a
infinite necessary condition for deadlock in a
(D) the class of all regular languages is multi-programmed O.S?
countably infinite (A) Circular wait (B) Bounded wait
20. Ans: (A) (C) Preemption (D) Both (B) and (C)
Sol: “Set of all formal languages” is 23. Ans: (D)
uncountable Sol: Non-Preemption is a necessary condition.
Whereas Bounded Waiting is a
requirement of CS Problem
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 11 : Computer Science Engineering

24. Consider an open statement P(x, y): (y – x (A) S1 and S2 (B) S2 and S3
2
= y + x ) where the universe of discourse is (C) S3 and S4 (D) S1 and S4
set of all real numbers. Consider the 24. Ans: (C)
following statements. Sol: S1 is false. For example when x=1, there
S1: x y P(x, y) exists no integer y which makes S1 true
S2: y x P(x, y) S2 is false. For example when x=1, there

S3: y x P(x, y) exists no integer y which makes S1 true

S4: x y P(x, y) S3 is true for all y if we choose x = 0

Which of the above statements have truth S4 is true, If we choose x = 0

value true?

25. The minimum number of 2-input NAND, NOR Gates required to Design a Half substractor
respectively are
(A) 4, 4 (B) 4, 5
(C) 5, 5 (D) 5, 4
25. Ans: (C)
Sol: A Difference [D]=AB
Half subtractor
B Borrow [B]= A B

Half subtractor using NAND Gates


A A.AB

AB  AB =AB=Difference
A AB
B

A B=Borrow

B.AB
Hence 5 NAND Gates are required

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 12 : PRE‐GATE_2020

Using NOR:
A  A  B  A B  Borrow

A AB AB  AB =AB=Difference
B

Hence 5 NOR Gates are required


Conclusions 27. Consider the following schemas:
Min Number of employee (empid, empname, deptid,
NAND NOR salary, address, phone_no,
Half Adder 5 5 date_of_joining)
department (deptid, deptname, location,
Half Subtractor 5 5
manager)
Full Adder 9 9
Consider the following query on the above
Full Subtractor 9 9
relation:
SELECT empname, deptname
26. Which of the following is True about
FROM employee, department
Topological sort? WHERE salary>10000 and
(A) Topological sort starts from a node location='Kolkata';
which has maximum degree The optimized relational algebra for the
(B) Topological sort starts from a node given query will be which of the
which has minimum degree following?
(C) Topological sort starts from a node (A) empname,deptname(location=‘Kolkata’salary>10000
which has any degree (employee⋈department))
(D) Topological sort starts from a node (B) empname,deptname((salary>10000(employee))⋈
which has zero degree department)
(C) empname,deptname((location=‘Kolkata(empname,salary,
26. Ans: (D) ⋈(salary>10000(deptname,dept
deptid(employee)))
Sol: Topological sort start from a node which id,location(department))))

has zero degree. If we have multiple nodes (D) empname,deptname((salary>10000(empname,salary,dept


with zero degree then we can start from id(employee))) ⋈(location=‘Kolkata’(deptname,dep
any node whose degree is zero. tid,location(department))))

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 13 : Computer Science Engineering

27. Ans: (D) 28. Ans: (D)


Sol: If we perform employee ⋈ department, Sol: S1 : Let us denote the vertices by a, b, c, d,

then we obtain a relation with non-required e, f, g, h so that


attributes. Performing selection and deg(a) =1, deg(b) =1, deg(c)=1, deg(d)= 2,
projection early reduces size of relation to deg(e) = 3, deg(f)=4, deg(g)= 5, deg(h) = 7
be joined. So, the attributes empname, Since deg(h)=7, h is adjacent to all of other
salary, deptid from relation employee and vertices.
attributes deptname, deptid, location from Vertex g cannot be adjacent to only of
relation department are taken by projection the vertices a, b and c.
operation first. Then the tuples from
deg(g) cannot be 5
employee are selected using select
S1 is false
operation where salary>10000. Similarly,
S2: Let each person represent a vertex in a
tuples from relation department having
location='Kolkata' are selected. Now join graph. If two persons shake hands then we

is performed between these reduced data- draw an edge between the corresponding
sets and finally empname and deptname vertices. Now, there would be a graph with
attributes are obtained by project 15vertices and degree of each vertex 3.
operation. Hence option (D) is the correct By sum of degree theorem, such a graph
option that follows the said process of does not exist.
optimization. S2 is false.

28. Consider the following statements.


29. The 7’s and 8’s complement of
S1: There exists a simple graph with 8
[3 0 5 7 0 0]8 respectively are
vertices with degree sequence
(A) 472077, 472101
{1, 1, 1, 2, 3, 4, 5, 7}
(B) 472000, 472100
S2: There are 15 people at a party and each
(C) 472077, 472100
person shook hands with exactly 3 others.
(D) 472077, 472000
Which of the above statements are true?
29. Ans: (C)
(A) S1 is true and S2 is false
Sol: Given number  N = [3 0 5 7 0 0]8
(B) S1 is false and S2 is true
Here radix = r = 8
(C) Both S1 and S2 are true
(D) Both S1 and S2 are false
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 14 : PRE‐GATE_2020

For 7’s [r–1] complement subtract each bit Step1: Assume that Base address of array
of a given number from 7[r–1] is 100 and integer occupies ‘2’ bytes.
7 7 7 7 7 7 Array name always holds base address of
N= 3 0 5 7 0 0 array
7’s complement of N = 4 7 2 0 7 7 Step2: P = a+5 means
For 8’s [r] complement, write zero bits as P = 100+(52)
it is then subtract 1st Non zero LSB bit P = 110
from 8[r] and remaining bits from 7[r–1] Now ‘P’ is pointing to the address 110
7 7 7 8 Step3: Now P[–2] value is 40
N= 3 0 5 7 0 0 and 3[a] value is 40
so the result of P[–2] + 3[a]
as it is
8’s complement of N = 4 7 2 1 0 0 = 40 + 40 = 80

30. void main() 31. Let S = Set of all +ve integers. The

{ smallest positive integer m such that any

int a[10] = {10, 20, 30, 40, 50, 60, 70, subset of S with m elements contain atleast

80, 90, 100} 3 elements x, y and z which leaves same

int *P; remainder upon division by 10

P = a+5; is_________.

printf(“%d”, P[–2]+3[a]); 31. Ans: 21

} Sol: Let us apply pigeonhole principle. If we

The output of the above program divide only +ve integer with 10 the

is _________ possible remainders are {0, 1, 2, …., 9}

30. Ans: 80 Number of pigeonholes = 10 (= n say)

Sol: The minimum number of pigeons required


to ensure that atleast k+1 pigeons belong to
0 1 2 3 4 5 6 7 8 9
same pigeonhole = kn+1 where k+1 = 3
a 1 2 3 4 5 6 7 8 9 10
and n = 10
100 102 104 106 108 110 112 114 116 118 = 2(10)+1 =21
m = 21

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 15 : Computer Science Engineering

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 16 : PRE‐GATE_2020

32. Assume that for a certain processor a read 34. Consider the following DAG
request takes 16 nanoseconds as average *
memory access time. A read request which –
causes cache hit, takes 10nsec and a read +

request which causes cache miss, takes


50nsec. The cache miss ratio (in
*
percentage) is ___________.
32. Ans: 15 a b
Sol: Assume hit ratio is h The minimum number of variables
Hence 16 = h*10+(1–h)*50 required in equivalent 3-Address code for
h = 0.85 the above DAG is ____________.
miss ratio = (1–h) = 1–0.85 = 0.15 15% 34. Ans: 2
Sol: a=a*b
33. In the expansion of (v + w + x + y + z)16. b=a+a
The coefficient of wxy13z is________. a=b–a
33. Ans: 3360 a=b*a
Sol: Multinomial theorem: Minimum 2 variables are required to
For positive integers n and t, the represent 3AC for given DAG.
coefficient of x1n1 . xln2 ........ xtnt in the
35. int f(int *P, int n)
expansion of {
n! static int s;
(x1 + x2 + ........+ xt)n is
n1 !. n2 !. nt ! if (n < = 0)
where each ni is an integer with 0  ni  n return 1;
for all 1  i  t and n1 + n2 + ........ + nt = n if (n  3)
By multinomial theorem, the coefficient of {
16 s = *P;
v0 w1 x1 y13 z1  return(s + f(P+1, n–1));
0.1.1.13.1
}
return(s+f(P+1, n–1));
= (14).(15).(16)=3360
}
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 17 : Computer Science Engineering

void main () Since final value of ‘s’ is 12


{ So in every return statement we have to
int a[5] = {10, 12, 14, 16};
replace ‘s’ by 12
printf(“%d”, f(a,4));
}
The output of above program is _______. 36. If tag-comparator size required for direct
35. Ans: 49 mapping, set-associative mapping and
Sol: Step 1: When n = 4 fully associative mapping are D, S, F-bits
*P value is 10
respectively, then which of the following is
and s value is 10
correct?
Step 2: When n = 3
*P value is 12 [Note: Assume main memory address,
and s value is 12 cache size and block size remain same for
Step3: When n = 2, n =1 all mappings].
value of s = 12 (A) D > S > F (B) D > S = F
0 1 2 3
(C) F > S > D (D) F > S = D
a 10 12 14 16
36. Ans: (C)
100 102 104 106
P P P P Sol: Number of tag-bits are maximum in fully
100 102 104 106 associative mapping and minimum in
f(100, 4) direct mapping
s
49 Size of comparator required = Size of tag
0
Hence size of tag comparator
return (12 + f(102, 3))
 Maximum size in fully associative
37 mapping
 Minimum size in direct mapping
return (12 + f(104, 2))
For example:
25
Main memory address = 32-bits
return (12 + f(106, 1)) Cache size = 128 KB
Block size = 32 B
13

return (12 + f(108, 0))

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 18 : PRE‐GATE_2020

4-way set Fully Step2: First call abc (&x, y); passing
Direct
associative associative Global variable ‘x’ address and Global
Mapping
mapping mapping variable ‘y’ value.
Tag size Tag size Tag size In called function, the formal
= 15-bits = 17-bits = 27-bits parameter ‘P’ is holding address of
Global variable ‘x’ and formal
15-bit tag 17-bit tag 27-bit tag
parameter ‘x’ is holding value of
comparator comparator comparator
global variable ‘y’
Step3: x = *P + y means x = 5 + 6
37. int x, y;
 Local variable x = 11 and
void abc (int *P, int x)
y = x+ *P means y = 11 + 5
{ Global variable y = 16
x = *P + y; Step4: printf(“%d”, y) will print global
y = x + *P; variable value as 16.
} Step5: Second call abc(&x, y); passing
void main()
global ‘x’ address and global ‘y’
{
variable value.
x = 5;
Step6: x = *P + y means x = 5+16
y = 6;
local variable x = 21
abc (&x, y);
y = x + *P means y = 21+5
printf(“%d”, y);
y = 26
abc(&x, y);
Step 7: printf(“%d”, y) prints result as 26
printf(“%d”, y);
} The output is 16, 26
What is the output of the above program?
(A) 16, 26 (B) 16, 16 38. Construct the LALR(1) sets of items for
(C) 10, 20 (D) 10, 10 the grammar:
S → SS + | a
37. Ans: (A)
Then, identify, in the list below, one of the
Sol: Step1: From main(), we assigned global
“LALR(1) sets of items” for this grammar.
variables x, y values as 5,6 respectively. (A) [S→SS+., $|+] (B) [S→a.,+|a]
x 5 y 6 (C) [S→a., $|a] (D) [S→a., $|+|a]

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 19 : Computer Science Engineering

38. Ans: (D)


Sol: Total 6 LALR(1) sets of items are present
S
(6 states)
S→SS.+, $|a S→SS.+, a|+
S 1
S →S., $, S→.SS+,a|+ S S→S.S+, a|+ S S→S.S+, a|+
S1→.S, $ S→.SS+, +|a S→.SS+, +|a
S→.SS+, $|a S→S.S+, $|a S→.a, a|+
a S→.a, +|a S→.a, +|a
S→.a, $|a S→a., $|a|+ a
+ +
S→SS+., $|a|+
a

39. Consider the following code on Binary tree If the invocation is Do(a, 0, t) on the above
tree, then the following values of array are
void Do(int a[ ], int level, BTNode *t) displaced. Choose the correct option
{
if (!t)
(A)
return;
0 1 2 3
a[level] + = t → data ;
a 0 0 0 0
Do(a, level+1, t → left);
Do(a, level+1, t→Right);
} 0 1 2 3
(B)
t → 15 a 15 30 25 20

10 30

25 (C)
5
0 1 2 3
20
a 15 20 30 40
Initial values of array
0 1 2 3
(D)
a 0 0 0 0
0 1 2 3
a 15 40 30 20

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 20 : PRE‐GATE_2020

39. Ans: (D)


Sol: Tracing
t
0 1 2 3
0 0 0 0 15
+15

0 1 2 3 10 30
15 0 0 0
+10
+30

0 1 2 3
15 40 0 0 5 25
+5
+25

0 1 2 3
20
15 40 30 0
+20

40. Two computers A & B are configured as follows A has IP Address 200.197.17.157 and net mask
255.255.128.0. B has IP address 200.192.192.201 and Net mask 255.255.192.0. Which one of the
following statement is True?
(A) A and B both assume they are on same network.
(B) B assume A is on same network but A assume B is on different network.
(C) A assume B is on same network, B assume A is on different network.
(D) A and B both assume they are on different network

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 21 : Computer Science Engineering

40. Ans: (D)


Sol:
A B
IPA : 200.197.17.157 IPB : 200.192.192.201
SMA : 255.255.128.0 SMB : 255.255.192.0
IPA : 200.197.17 .157 IPB : 200.192.192.201
AND AND AND AND
SMA : 255.255.128. 0 SMB : 255.255.192.0
NIDAA = 200.197. 0 .0 NIDBB = 200.192.192.0
IPB : 200.192.192.201 IPA : 200.197.17.157
AND AND AND AND
SMA : 255.255.128. 0 SMB : 255.255.192.0
NIDBA = 200.192.128. 0 NIDAB = 200.192. 0 . 0
NIDAA ≠ NIDBA NIDBB ≠ NIDAB
A assumes B is on the different B assumes A is on the different
network network

41. int f(int n) n


(C) f    1 (D) f(n–1) + n
{ 2
41. Ans: (D)
if (n = = 0)
Sol: Let f(n) = maximum number of pieces of
return 1;
cake made by ‘n’ straight cuts.
else
In order to get maximum number of pieces
return (_________); of cake, the nth straight cut must intersect
} remaining (n–1) straight cuts at (n – 1)
If the return value is maximum number of distinct points, so that the nth straight cut
pieces of cake made by ‘n’ straight cuts will add extra ‘n’ pieces to the number of
then which of the following is suitable pieces obtained upto (n – 1) cuts.
f(n) = f(n – 1) + n
statement in the blank provided in the
Ex: n=1 n=2 n=3
above program?
n
(A) f(n–1)+1 (B) f    n
2
f(n) =2 f(n) =4 f(n) =7
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 22 : PRE‐GATE_2020

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 23 : Computer Science Engineering

42. The probability that a process spends its T2 reads the value written by T1 and is
time in performing I/O operations is ‘P’. In committing after T1 then the schedule is
a multi programmed O.S environment, if recoverable and also cascading rollbacks
there are ‘n’ processes in memory at once, possible, if T1 fails just before it commits
then the probability that all processes are need to rollback both T1 and T2.
waiting for I/O & the systems utilization is
respectively 44. Match the following:
n n n
(A) 1/P, P (B) P , 1–P OSI Layer
(C) P, Pn (D) 1/Pn, 1–Pn 1. Network Layer
42. Ans: (B) 2. Transport Layer
Sol: The probability that all processes goes for 3. Data Link layer
I/O is P*P*..*P for n processes i.e Pn 4. Session Layer
Hence the Probability of CPU Utilization 5. Physical Layer
n
will be 1–P
Responsibility
43. Consider the following schedule P. Transmission mode
R1(A), W1(A), R2(A), W2(A), R1(B), Q. Feed back Message
W1(B), C1, R2(B), W2(B), C2 R. Segmentation & Reassembly
(i) Schedule is conflict serializable S. Dialog Control
(ii) Schedule is recoverable T. Access Control
(iii) Schedule is Cascade less
(A) (i) only Codes
(B) (i) and (ii) only 1 2 3 4 5
(C) (ii) and (iii) only (A) Q P T S R
(D) (i), (ii), and (iii) (B) Q R T S P
43. Ans: (B) (C) Q R T P S
Sol: The precedence graph for the schedule do (D) Q R P T S
not have cycles and the schedule is conflict
serializable.

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 24 : PRE‐GATE_2020

44. Ans:(B) 45. Ans: (A)


x
Sol: 1. Network Layer is responsible for Sol:
2
feedback message main ()
2. Transport Layer is responsible for
segmentation & reassembly
3. Data Link Layer is responsible for f(2) f(13)
access control a y b
5 2 6 y b
4. Session Layer is responsible for dialog 13 6
control
x=a+b+y x= a+b+y means
5. Physical layer is responsible for
here x = 5+6+2 x=18+6+13=37
transmission mode i.e. Simplex, Half
x=13 and a =a+x=18+37=55
duplex or Full duplex. and a= a+x printf(“%d%d”, x, a)
so a= 5+13=18 will print 37, 55
45. int x = 2; printf(“%d%d”, x,a)
void f(int y) will print 13, 18
{
static int a = 5; 46. Let f: Z → N be defined by
int b = 6; 2 x  1 , if x  0
f (x )  
x = a + b + y;  2 x , for x  0
a=a+x; Which of the following is true?
printf(“%d%d”, x, a); (A) f is 1–1 but not on-to
} (B) f is on-to but not 1–1
void main () (C) f is a bijection
{ (D) f is neither 1–1 nor on-to
f(x); 46. Ans: (C)
f(x); Sol: Let x1, x2  Z and f(x1) = f(x2). Then with
} f(x1) and f(x2) are both even or both odd.
What is the output of the above program? Case1: If both are even
(A) 13, 18, 37, 55 (B) 13, 18, 24, 29 then f(x1) = f(x2)
(C) 13, 18, 13, 18 (D) 13, 18  –2x1 = –2x2
x1 = x2
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 25 : Computer Science Engineering

Case2: If both are odd then Sol: Given fSPOS (A,B,C,D) =


f(x1) = f(x2) M [3,7,10,11,15] + d [1,6,9]
2x1–1 = 2x2 – 1 fSSOP (A,B,C,D) =
x1 = x2 m [0,2,4,5,8,12,13,14] + d [1,6,9]
 f is 1–1
To prove f is on-to function
CD
Let n  N AB 00 01 11 10
n 00 1 X 1
Case1: If n is even, then Z and 0 1 3 2
2
A D  01 1 1 X
n 4 5 7 6
  <0
 2  1 1 B D
11 1
12 13 15 14
n n
and f   = –2   =n X
 2   2  10 1
8 9 11 10
n 1
Case 2: If n is odd then Z and
2
C
 n  1
  >0 fSOP  C  A D  B D
 2 
 n  1  n  1
and f   =2   –1 = n 48. Which of the following is True about
 2   2 
sorting algorithms ?
 f is on–to. I. Merge sort, Quick sort are stable
sorting algorithms
47. Consider the following Boolean function II. Worst case Time complexity of
mergesort is O(nlogn) and Quicksort
f(A,B,C,D) = M [3,7,10,11,15] + d
has worst case time complexity O(n2)
[1,6,9]
III. If the input array elements are already
Here M = Max terms; d = don’t cares in the increasing order then Mergesort
The simplified expression of “f ” in SOP takes O(nlogn) and Quicksort takes
form is O(n2) time for sorting that array
elements
(A) C  A D  BD (B) C  A D  BD
(A) only I, II (B) only II, III
(C) C  A D  BD (D) C  AD  BD (C) only I, III (D) I, II and III
47. Ans. (B)

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 26 : PRE‐GATE_2020

48. Ans: (B) 49. A datagram of 7000 Byte (20 Byte IP


Sol: Header) + (6980 Byte IP payload) reach at
 Only mergesort is stable sort but a router and must be formed to a link with
Quicksort is not stable sort a MTU of 1200 byte. What is the offset
 Worst case time complexity of value, MF value, total length of the last
mergesort O(nlogn) and Quicksort is Fragment?
O(n2) (A) MF = 1, total length = 1200, offset = 735
 If input array elements are already in the (B) MF = 0, total length = 1196, offset = 735
increasing order then Quicksort takes (C) MF = 0, total length = 1120, offset = 735
O(n2) and mergesort takes O(nlogn) (D) MF =0, total length =1120, offset = 5880

49. Ans: (C)


Sol:

MTU
6980 20 =1200

110 2 1176 2 1176 2 1176 2 1176 2 1176 2


MF
0 1 1 1 1 1

11765
 735 Offset
8

1120 Total
Length

50. What is the output of the following x – –;


program? printf(“%d”, a);
main() }
{ (A) 6, 4 (B) 4, 5
int x = 5; (C) 6, 5 (D) 5, 5
if (fork = = 0) 50. Ans: (A)
x++; Sol: The Child Process will increment x by 1
and Parent will decrement it by 1 from its
else original value.

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 27 : Computer Science Engineering

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 28 : PRE‐GATE_2020

51. Consider the following sequence of 3. If neither the condition in 1 or 2 occurs,


actions: then and only then execute the W_item(X)
r1(A); r2(B); w1(C); w3(B); r3(C); w2(B); operation of T and set W_TS(X) to
w3(A); TS(T)
Assume that the read and write-
timestamps of A, B, and C are each 0 prior 52. For A = {a, b, c, d, e, v, w, x, y, z},
to execution of these actions. For which consider the poset [A;R] Whose hasse
initial timestamps of the transactions T1, diagram is shown below
T2 and T3 will no transaction abort, using z
time stamping protocol with Thomas write y
x w
rule?
e
(A) T S(T1) =100; T S(T2) = 300; T S(T3) = 200 v
(B) T S(T1) =300; T S(T2) = 200; T S(T3) = 100 d
c b
(C) T S(T1) =100; T S(T2) = 200; T S(T3) = 300
(D) None of the above
a
51. Ans: (C)
Which of the following is not true?
Sol: Thomas Write Rule does not enforce
(A) Complement of b = x
Conflict Serializablity but rejects fewer
(B) Complement of d = x
Write Operations by modifying the check
(C) Complement of c = y
Operations for W_item(X)
(D) Complement of b = w
1. If R_TS(X) > TS(T), then abort and
52. Ans: (C)
rollback T and reject the operation.
Sol: The given poset is a lattice, with upper
2. If W_TS(X) > TS(T), then don’t
bound z and lower bound a.
execute the Write Operation and continue
(A) lub of b and x = z
processing.
glb of b and x = a
This is a case of Outdated or Obsolete
complement of b = x
Writes. Remember, outdated writes are
ignored in Thomas Write Rule but a
(B) lub of d and x = z
Transaction following Basic TO protocol
glb of d and x = a
will abort such a Transaction.
complement of d = x
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 29 : Computer Science Engineering

(C) c is related to y (C) S→SaS|b


 lub of c and y = y (not z) (D) S→SS|
y is not a complement of c 54. Ans: (C)
(D) lub of b and w = z Sol: Operator grammar “should not have any
glb of b and w = a production which contain 2 consecutive
 complement of b = w non terminals” and also “should not have
null productions in it”.
S→SaS|b is operator grammar
53. Consider f(n)  3 n log 3 n
, g(n) = 2n n

h(n) = n!
55. Consider the languages
which of the following is True?
2

(A) h(n) = O(f(n)) (B) h(n) = O(g(n)) (i) {a n | n  20}


(C) f(n) is not O(g(n)) (D) f(n) = O(g(n)) 2
(ii) {a n | n  20}
53. Ans: (D)
(iii) {an | n is prime  210}
f (n )
Sol: If Lt  c [ a finite c>0] then (iv) {w (0+1)* | n10(w) = n01(w)}
n  g(n )
Which of the above languages are non
f(n) = O(g(n))
regular?
Now we have f (n )  3 n log 3 n
(A) Only (i)
n
 3log 3 n (B) (ii) & (iv)
b (C) (iii) & (iv)
=n n
[ a log a  b]
(D) Only (ii)
f (n ) n n 1
Now Lt  Lt   c for some 55. Ans: (D)
n   g(n ) n   2n n
2
finite c > 0
Sol: (i) a n2

| n  20 is finite language, so
regular
f(n) = O(g(n))
Since f(n) = g(n)  h(n) (ii) a n2

| n  20 is infinite language and

So we have f(n) = O(g(n)), g(n) = O(f(n)) Not regular


and f(n) = O(h(n)); g(n) = O(h(n)) (iii) {an | n is prime  210} is finite
54. Identify operator grammar. language
(A) S→SS|a (iv) {w  (0+1)*| n01 (w) = n10(w)} is
(B) S→SaS| regular language
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 31 : Computer Science Engineering

56. Let L1= {0n+m 1n 0m | n, m > 0}, L2 and L3 are not CFLs
n+m n+m m
L2 = {0 1 0 | n, m > 0} and L1  {0n  m 1n 0m | n , m  0} is DCFL, so CFL.
L3 = {0n+m 1n+m 0n+m | n, m > 0}   
Which of these languages are NOT Push Pop Pop
context free? 0' s 0' s 0' s
L2 ={0 1 0 | n, m>0} = {0i 1i 0j | i >
n+m n+m m
(A) L1, L2 only (B) L1, L3 only
j, i, j>0} is not CFL
(C) L2, L3 only (D) L3 only
L3 = {0n+m 1n+m 0n+m | n, m>0} = {0k 1k 0k |
56. Ans: (C)
k>1} is not CFL
Sol: L1 is CFL

57. Consider the following Sequential circuit

1
J1 Q1 J2 Q2 J3 Q3

K1 K2 K3 Q3

Clock

Assume initially Q1 Q2 Q3 = 000 then Modulus of the above counter is _________.


57. Ans: 6 Clock J1 K1 J2 K2 J3 K3 Q1 Q2 Q3

Sol: JK Flip-Flop Table 0 - - - - - - 0 0 0

J K Qn+1 1 1 1 0 0 0 0 1 0 0

0 0 Qn 2 1 1 1 1 0 1 0 1 0
0 1 0 3 1 1 0 0 0 0 1 1 0
1 0 1 4 1 1 1 1 1 1 0 0 1
1 1 Qn 5 1 1 0 0 0 0 1 0 1

From the circuit →Initial


6 1 1 0 1 0 1 0 0 0 State is
J1=1; J2= Q1 Q3 ; J3= Q2 Q1 Repeating

K1= 1; K2 = Q1 ; K3= Q1 Initial state is repeating after “6” clock


pulses. Hence It is a MOD-6 counter

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 33 : Computer Science Engineering

58. Consider a system using segmented-paging  x  E(X 2 )  E(X) 2


architecture with a V.A of 23 bits. The
segment table has 32 entries and page table  17  16  1
of segment is indexed with 9 bits. The size
of largest segment is______KB. 60. Consider the following relation schema
58. Ans: 256
R(A,B,C,D,E,F,G) with FD set {AB→C,
Sol: The size of VA is 23 bits. There are 32
AC→B, AD→E, B→D, BC→A, E→G}.
entries in segment table. Hence the VAS
The relation R is subdivided into following
has 32 segments which requires 5 bits to
access them. The remaining 23 – 5 = 18 relations R1(ABC), R2(ABCD),
bits are used to access the segment. This R3(ABCEG). The number of sub relations
implies the max segment size is 256KB. that are in BCNF is ______________
60. Ans: 1
59. An urn contains 5 chips numbered 1, 2, 3, Sol: R1(ABC) contains AB→C, AC→B, and
4 & 5. When 2 chips are drawn (without BC→A, as Every LHS is super key R1 is
replacement) from the urn, the random in BCNF. R2(ABCD) contains AB→C,
variable X records higher value. Standard AC→B, B→D, and BC→A, Because B is
deviation of X = _____. not a super key in B→D, R2 is not in
59. Ans: 1 BCNF.
Sol: Let X = higher value of the 2 chips R3(ABCEG) contains AB→C, AC→B,
X has the following probability E→G, and BC→A, Because E is not a
distribution super key in E→G, R3 is not in BCNF.
X 2 3 4 5
P(X) 1/10 2/10 3/10 4/10 61. Consider the following graph
2
b c
1 2 3 4
E(X)  2   3   4   5  4 1 3 10
 10   10   10   10 
=4 a 2 g 2 d
1 2 3 4 8
E(X 2 )  22    32    42    52   4
 10   10   10   10  5
6
= 17 1 e
f

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 34 : PRE‐GATE_2020

If we run Disjkstra’s algorithm on vertex 62. void Do(char *P)


(b) then the shortest path cost from (b) to {
(f) is ________. if (P(0)= = ‘\0’)
61. Ans: 6 return;
Sol: Do(P+1);
a c g d e f Do(P+1);

{b}  2 1*    Do(P+1);
printf(“%c”, P[0]);
{b,g} 3 2* 1* 3 5 9
}
{b,g,c} 3* 2* 1* 3 5 9
void main()
{b,g,c,a} 3* 2* 1* 3* 5 8
{
{b,g,c,a,d} 3* 2* 1* 3* 5* 8
Do(“ab”);
{b,g,c,a,d,e} 3* 2* 1* 3* 5* 6*
}
{b,g,c,a,d,e,f} 3* 2* 1* 3* 5* 6* In the above program,
The number of times printf statement will
Shortest path cost from ‘b’ to ‘f’ is ‘6’ be executed is _________.
and we can have path as b →g→e→f

62. Ans: 4
Sol:
main() ‘a’ ‘b’ ‘\0’
100 101 102

Do(100)
pf(a)
Do(101) Do(101)
Do(101)

pf(b) pf(b)
Do(102) Do(102) Do(102) pf(b)
Do(102) Do(102) Do(102) Do(102) Do(102) Do(102)

Number of Times printf executed = 4

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 35 : Computer Science Engineering

63. Number of equivalence classes with


respect to the language, 6 + 3x + 5 = 32-bits
L = (a+b)*abb over = {a,b} is ________. x = 7 bits
63. Ans: 4 Maximum number of registers= 27 = 128
Sol: L= (a+b)*abb is regular language.
Every regular language has finite number 65. If an = The number n-digit quaternary (0, 1,
of equivalence classes. 2, 3) sequences in which there is never a3
Number of equivalence classes = Number any where to the right of a0, then a5 =
of states in min DFA __________.
a 65. Ans: 648
a b b Sol: Case1: If the first digit is not 0, then we
can choose first digit in 3 ways and the
a a
b remaining digits in an–1 ways.
b The number of quaternary sequences in
L has 4 states in equivalent min DFA. this case is 3an–1
So, 4 equivalences exist for L.
64. A process has 45 distinct instructions. A Case 2: If the first digit is 0, then each of
32-bit instruction has an opcode, 3-register the remaining digits we can choose in 3
operands and a 5-bit immediate operand. ways.
Maximum number of registers the CPU
The number of quaternary sequences in
can have is_______.
64. Ans: 128 this case is 3n–1

Sol: Number of Instructions = 45  opcode The recurrence relation for an is


bits = log2 45 = 6-bits an= 3an–1+ 3n–1 where a1 = 4
Instruction format: [Assume x-bits a2 = 3a1+ 31 = 15
required for register reference] a3 = 3a2+ 32 = 54
a4 = 3a4+33 = 189
32-bit Instruction
Immediate a5 = 3a4 + 34 = 648
Opcode Reg.1 Reg.2 Reg.3
operands
6 x x x 5

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad


: 36 : PRE‐GATE_2020

ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad

You might also like