Gate 2001
Gate 2001
·:.~r
c. Botli S 1 and S2 are correct
cl None ofS I and S2 is col'l'lXlt
29. Seven (distinct) car accidents occuned in a
week. Whal is the -probabilfly !hat tJ1ey nll
o<Jcorred on !he srune day 7 c
a. Jn 7 Consider d1tf fcllowi.11g timu1g disgr>l!lls <lf
X !llld C; the d ock period of C ~ 40
b. tn•
nanosecond Whicll one IS the correct plot
c. J/21 ofY?
c1 7tz7
10. Comider a DPA over· L: = (u,. b)
aoocptit~g all s11in~ wlricllliavc number of
a's di\~s ihle by 6 and number c.f b"s
divisible by 8. What is the min.i.nJUIII
number of statesdJattlte DFA wi.ll luwe? a.
5 of Ill
IH~----t-
37 C(>nsider IJ>e clreuit £iven bei0\1 wi th
Initial state; Q0 = I. Q1 = ~~ = 0 The; .slate
of the circuit is given by th~ val u~ 4Q:
b. 2Q, Qu.
-tll-+---+--
d
Which one of tho following is the ~orrcot
___._~_l-----1L sune ~quem:e. ,.,flhe circuit?
34. Which os the most nppro,-iale mulch lbr a. 1.3.4.6.1.5.2
the olcms in the lirst column wi th t·hc item ~ b. 1.2.5.3.7.6,4
in the .sccom..l column?
c. 1.2.7,3.5.6.4
X, lmlirect Addressing
d. 1.6,5.7.2.3.4
Y , lnde,.ed Addressing
38. Consider U1e following dalapatlt ul u
Z.. 13ase Register Addressit•l! >iruple non-pipollnod CPU. Tbc registers
t Anay impleruentaliou A. B. A,. A,. MDR.. the bus und the' ALU
n. Writing relocotoble oodc arc 8-bot wide. SP UJld MAR :tre [(,..bit
rel/)sters. The MU X is of size 8 x (2 : I)
Ut Pn~si "ll ~n'!ly '"' J~orumeler ~nd ~te DEMUX ~~ of size 8 x (1 : 2).
IL (X. Ill). (Y. 1). (Z. II ) Each memorv operation rakes 2 CJ'U cluck
b. (X, II J, (Y, III), (7. I) cycles :111tl uses MAR (Men>ory Address
Register) and MDR (MemO!)' Data
c. tX. I U~ (Y.II~ (Z.. IJ Reg1ste• ). S P Cllu be decremented ICI"'llly
d. (X, I), (Y. U[), (Z.. I[)
35. The 2's complement represent:otiool M (·
5.l9) in hesadecimol is
a. ABE
h. nne
c. OE5 The CPU i11~1nultion ·•push C. where r ~ 1\
d. 9E7 or B. hus Ute specilicsrion
36. Cousoder tJ>c Circuit 5hown below. Tho M [ SP]<-r
(lltlpur of s 2: I Mux is l!I\'Cn by tlto SP.....SJ>-1
Junction (nc' - be), How mnny CPU clock cycles UN ne0l!ed
• tr>c)(ecute tl1e "pusb r'' instruction?
1-
~. 2
0 b c
b. 3
c. 4
Wbicb M tbe following Is true'/ d. 5
u, r=sl'- -a 39 Ctm!Sider un untlirectt.-d unweighted _gruph
b. t' - xl ' x2 1 J<lx2' 0. Lttt. a breudth-t:irsl 1roversul of G be
done >1nniug from a node r. Let d(r.u) nnd
c.. f = slx2 + x l·a·
d(r,,,J he the longtbs .,r the shorrcst paths
d. r- xl ~ x2' from r U> 11 and v r~spectivel y in G. If u IS
11isited betore ,, duriJlg tl>e breudtlHirst
6ol 10
IJ'tlvcrsal. which of Ute following 1'21 ... •& ( - 1
sllltcmunls is oorrecl'l I
.......
.,. .....
n. d(r.u) < d(r.v)
b. d(r.u) ' d(r,v)
..... ,..
c. (l(r,u)S<~r,v)
d. Nouo <>f tl"' above .... ,..,
,. = ,..., _ _ _ lk
·10. !-low many undirected graphs (not
!lcocssarily corUiecled) can l)e constructed
· -10;
out or"
vct1ices?
given set v ~ l v., v,, ..... v,. I o( u -""'
WhiQh of the nbove lhr.:e functions nre
8. n(n· l )12 likely to eonse prohlems 1\ith pointcn<?
b. 1' •· OnlyP3
o. nl b. C)nf)' Pl nnd P3
d. t'IJ>·l• 2 c. Only Pl nnd P2
41 "1tat i~ tlte minimum numher of slack.• of d. Pl. P2. and P~
size n required to irnplemo:nl ;, !JUt!Ue of ~4 . Comider the foUowing prognun.
size n? .._n
. . . :lot;
a. Cine
..... 2
•wt••:la)
.....
-
b. Two
a • s+li
c. Tiu-ee
d. Four
-1:1.. Wb~t i> printed by !be print s!alements In
the prog.nun PI-assuming <>ull by N f =
pttnsn~c:tcr vms~ing?
J'nlcr-PI()
I lletla
... 't. ..... P1
...
lt • 10; ft • tO;
0;
'Y - 3;
f'unel( f , X, X);
print x; If litelt11tg~gc has dyuumic >coping and
Frillt y; prunmeler:. ore pnl!Sed by retbrenC<:. 1\ilnl
will be printed by the progrom?
• . 10
fuocl( " · ,, " )
I b. II
c. 3
l d None of the above
~5. Wlucb of the foUowing doe> not interrupt
n. 10. 3
a running process?
b 31. J
11. A device
0. 27. 7 b, Timer
,1, None of lhe above
c. Scheduler process
-13. Consider Ure following Uuve C functions.
d Power failure
trl) .... , , _ ,
I
Conside.· ~ maobine \~iUl 64 MB physi~l
m<~mory nod n 32-bil virtual uddress spa~e.
If the J>rl~c size is .IKB, wh:~t is lhc
npprox<rnote size of ll1e pnge tahle?
7 elf I 0
a. 16MB Wllic.ll of the following is poss:ible if a
b. 8MB tuple (x,y) i$ deleted?
c. 2 Ml:l a. A tuple (Z, w) with :t > y is deleted
d. 24MB b. A 111ple (:r., w) with r. > xis deleted
47, Consider Peterson's algod~ur1 for mutual c. A tuple (z. w) with w < x.is deleted
exclusion between concurrent
two d, The deletion of (x; y) is prohibited
-___
pfOC<J$Ses i and j , The prog:rum executed
by process iis shown below.
.. lil · -
- ·.1:.
-(Pl.. _ ,..... ____ _ SECTION 8
Pl¥2 MAIUCS QUESnOifS (51 & 7 0)
11111- -----
1111{11 • -
--1"1
geq.oTll y ify <: X-
(• l'*Ff IOilllill
.. .... IMilllllll
follows.
X · Given a Turing machlne M over L and
any word w E L:*, does M l oop tocever on
pria!Yb:ytJ W'/
lo<cipi;oy(ob)IUfa ..... JIIIGGdelolo ....... )
8ofJ IJ
You may assume ilJul tll• hulling prnblem d. Hmv many uddrll.'ls biu; ure rllquired W
or Turing muohino is uodt>ciduhle but lind tho byte oO:<et within a cuch<>
pnrtittlly decidable. block'!
n. Show dtat X is undecidable. e. What Is Ute total amount of extra
memo~ (In byt~s) req11lred t(>r the lug
(>. Show lhul X is not cv~n purtiull)·
decidable. bfts?
56. Consider u <It~~ with fbllnwlns 58. Ao.•wcr rho folio"~ Ill!
SJ'Ie·Cilicatilln~; 20 surface"' 1000 a. Is U1e 3-vuriablc function I' = ~ ( 0, I.
tm<>kSJsurlb~e. 16 secl~rsi tr:tck. dakl 2• .J) its scif-dunl? Jus tif) vour answer.
densil) IKB/st.'Ctor. roL~Iion sp;:ed 3000 IJ. Give n minimal pruduct-u(~~i\1111 forut
rpm . The opcroring >'Y~tcm iuitiutes- the of the b, output of Llt< following
l'rnnsfer between the dis~ und the m~m•JIJ excess.-3 1o DCD couvet1er.
sector-wise. Once tile hcnd hns heen
placed on the right LnJcl:. t.hc disk reads u
sector in a single scan . ll read• bit;; fr<•n• IW:<a•J
lite $0Clor while ~'" head is f"lliSing over To
lite sector The read bits ore ft>mtcd into BCD
by1es in a serial-in-pnrullel-out bufter und
each byte ts then trJnsfctTcd to memOI)'. 59. /1 ~equenttul circ~il tnkc>S uu mput Strt!a ltl
The disk \vriting IS exactly o
complementary prO<:css.
of o·s
and I '~ and produces an output
s1renm of 1)'5 and i's. lnrtlally It replicates
For pans (c) rmd (d) below. a."<Sttmc the input un it~ ')utput until twv
memory rcnd·writc: li mo - 0.1 mioro consecutive ()'s nrc oncountcNd un the
secondlbytc. mtcmtpt driven tmnslcr has input. From then onword it produces an
au mtcrrupl ovt:rheatl = ().4 tnicro-seconcl, output stre:uu whi"h is the bit-ll'ise
UJc DMA iuitialitJltiolt nnd lonuuwtiou cmnpleme1H uf IIIIHII strenm until u
ol'crhcocl "' ocgligibk oomP"rcd to tlto encounters two consecutive l"s, whe.n:upon
totnl sector trutL•fer time. DMA requests U1e prucess n:pe:il>. Au cx11uple ..,( i11pu1
ore uh1 uys grauteJ. and output weam i~ ~lll>\l'tl below
a. Who! is 1hc tntul ca.pacity oft~o disk?
· ··- JO II OOI OtOOt l tt! Otl
b. What is the dntn tronsJilt· rate? no......., I 0 II OOjt 0 tl 0 I 0~0 I t
e. Whnt is the l"'reentago l•f time tl•c S-K master-sial~ l1 ip-llops ora tCI be used
Cl"ll is required for this disk tlo tl>r to desig n the Clrcuh.
bylc . . wisc interrupt driven lrun.stcr'f a. Give Ute smle transition dingram .
cL Wltru i~the ntll.~IUUUI f"'TCenllJge (tf ll. Gh'e the minlmized sum-ot~rrl>duct
time tltc CPU is held up For this disk expressions for J <illd K inputs of ono
iro for cyclc-stoul i ng DMA tmnsfc.r? of its state !lip-Oops.
A CPU bas 32-bit memory address und o 60. Consider u 5smgc pipeline - IF ( ln.~lntction
256 KB coche memol)'. l'he cache is Fetch ~ 10 (Instruction Dccooc and register
orgnliiled as a 4-way scL;\ssociative ~chc rcnd1 EX tJ;xccuto ~ MEM ( Memory). and
with t.uche hind.. Nizcof Hi hytes. WU ( WrJ IO back), AJI ( IIICIIIO'Y Ill n:gis(cr)
n. Whnl Is the num~r <>f sets w the rends tnke place iu Ill< sccoud phase o f u
cuche? clock oycl ~ aod writes occur 111 Lhe li rsl
b. Wbul ts tho si.<e (in bits) ol the lag phase of Oto clock cycle. Consider tlto
lieiJ ptlf cnche block? exe<>ution of the foll,llvi ng tnstructiou
S(..-"l.JllCI\Ce~
c. What is the number and <i<e of
comparators rcquircuJ ror tllg
II : oob r:!. rl . l'l: ,. a._ rl - .C •1
12 : ... 14. r2. I(); ,. 14 ~ r:!.-tl •t
OJ31Chlllg'/ D : "' r2.1CIO!tll ,. Nlrl • lOili o- t! •1
....... 13. ....~ ,. 13 ... ~ -a •t
9 of l O
a, ShOI~ all da~. depeltdettL11!S oetweeJI n6, 3), (Jl2, n4, 4), (n2, n5, 12), (Jt3, n4, 7),
dte four instruction!<, (n4, n5, 9), (n4, n6, 4)). The third qalue in
b. ldenti!)r the data hazards. each t·•q,le rt.<presenrs lhe weiehl of lhe
edge speci tied in the lnple, -
c. Can all the ltazards be avoided by
forwaJ'ding in tlris case? a. List the edges of a mirumom ~pannins
tree of the graplL
6 1.
...........
Consider the following C program!
I
~
w~~"W> .....-.r.
b. How lnany distinct minimum spanuing
trees does this grnph have?
*'C.t+l)t c. Is lhe ntininlllll1 nmong the ed'ge
llbo(a + I );
...~.oflll)o
weights of 11 mulimwn spamcing lree
un&que over all possible minimum
spmming ~ >Jf a graph?
d. is the ma:cimum runong the edge
weights of a minimiJJII spanning h:ee
a. What will be Ote oulpu1 of ~1e ~nique over all JlOssible minimum
progrartt'l spanning trees of a graph7
b. lf abL{s) is caDet! with a nuH- 6<1. C'ousidlll' llte following grammar wiOt
ll>rmin"ted string s ,,r lellJ.!Ih 11 lemtinal alphabet !: = {a, (,), ~, •· } and
characters (not comrting the null ('\0") simi sym~ol A. The production n~es of lite
character), how many characters will grammar are ~
be printed by abc{s)? E4aA
62. An::wer tlle foUowing ; E4(E)
a. I.Jt.'<ldt the foDowillg keys oue hy one A~+E
in to • b inary .s~¢arcll lree in U1e order
sveci fied. A4*E
15, 32, 20. 9. 3, 25, 12, I A4s
Show the final binary search tree after a. Compute the FIRST and FOLLOW
tlte· insertions. sets forE and A.
b. Draw the binarv search lrec after b. Compute the LL( I) parse mble for cl1e
deleting 15 ftum ft. gT\IITlffiaJ',
~. Ce>mplete the statement.• S I, 82, and 65. Tlte synlal\ oftlie repear-w1til statement is
S3 in tl1e following timed on so rhallhe given by the following grammal'
function compnte$ lhe depltl of ~ S ~ repe<Jt S 1 unfU E
____
llu1ary trlle rooted al L
c:noW_ _ ,
,,_
......,
!OIIoor.,
where E stands fur expressions, S and S1
stand tor statements. The non· terminals S
and S 1 have an a tlribute code Omt
represents generated code. The non·
-.·,cm.o tenninal B has two attnoutcs. The attribute
I cod.e represents generated code to evaluate
llla.r. the e:q,>t·ession arul slote its truth value irt n
l( p- ~-o.
•.•,.u,......,.,. distinct variable, and tlte attribute
sI ~ voo"a:me contaitJS tho name of the Vlltiable
lnwltich lhe lraUt value is sl\:lred. The. trutl1
S2: ·if~'(:>y) retum _ __ value stored in lhe variable is I if 1: is lme,
S3 : elsor<.1Um._ _ _ __ OifEi• fulse.
} Give a zyn:tax-direcl:ed defullti011 Jo
generate three-address code for lhe repeat·
63. Consider a weighted w1dU·ooted graph with
l UJtil statemeu~ Assume J.hat you can caJJ a
vert'ex set V = {ul , u2, n3, n4., p5, ·~6) and
fimction, newlabel( ) tlwt returns a distinct
edg~sel E = {(111 , 112, 2). {nl , n3, 8), (nl ,
llloflll
label lbr 3 stnttm~nL Use the operator "I ' 100. The time hl move th~ heaJ between
10 concatcnstc lWu strings aild thu twu suctc;smvc tracks is 0.2 millisecond.
fuu.;tiuu ~en(s) to generule n line a. Consider ~ set of disk requeMs to reoo
ootllaining the st.riug s. data !rom truckc• 32. 7. 45, 5. :md I0.
1]{1. Answonhc ft>ll11wi ng : Assuming that the a1cvut<)t' ulguridt111i~
a. Remove lcl\-rocursiou from tho used IP schedule disk requests. nnd tho
following gratmnnr hcnd is in1tin11y at track 25 moving up
( 10\l'ard,; larger track numbcl'll). whut is
S- >Sa l Sb l a l b t·he totnl seek lime lor servicing tho
b. Consjdc.r the LOilowi11g_ g_.naumtut: requtSLi?
S ~ aSbS bSaS I r. b. Consider au iniUal set ut' 100 urbtl!OJ')'
di!-i:l.: reque-sts ruJd assume L.hat no uew
ConstrUct all possible parse trees for the
disk r.:quests unive while servicing
~1ting abab. Is U1c grammar ambiguous'/
1hcse requests. lllhc head is initially a t
67. Two coocummt processc.~ PI and 1'2 watrl tmck 0 and the de~ator algorithm is
to usc two resources &I ""d R2 in u ltsed Ill schedule disk t'equest>. lllutt is
mutually cxclu.o;i ve munncr. Initially. R I Ute wurst case tiutt to complete all lht
and R2 me tree. Tlte rrngroms oxccuted by t·eques{!;'!
'lhe two rrncesses arc given helow
69 Consider lhc relution e)(llmincc(regno,
l'rogmm tllr 1'1: name. some). where regno is tho pnniary
Sl: Wle (IUI&...,) do - key und score is a real number.
sz, 5rt IU +-boom
S3: Wk(Jt11o lotoly) do - a. Write a relationa l a.Jg~bra quc.."f) USIR£.
S4: Soltt! +- _ , (IT. o. p. • ) to find 11tc list oJf n•m•s
ss: llOo 11.1 ood 112;
which apJl""r more tlltlll once in
se: .. Ill +- fi'eo:
$7: SoiiU +- Inc; e)wminoc.
b. Write an SQI. query to lis1 the regno of
Prog:rom for 1'2:
t.1xwnwocs who tul\lc u sc,m;. greater
Ql: WliiD(Itllo...,) • - d1a11 d1e average sc()rc.
Q,2: Sot IU._ '-r.
Ql; - (JII II "'"tl doo....,: c, Suppose tl1e relation appeurs( regno.
Q4; Sa . .... boor. oentr code) speoities tbe centre whore
~ U..lti •U2;
Qlc Slllt2 ..., _ an exatntnce ap~s. Write an SQL
Q7: kii U ..,._ quc.ry to list tl1e centr_code havln!l :Ill
e>Uullinee uf s<:ure greuter tbau 80.
:1. Is wutw~ ll.xclusiuu guw·:mtect.l for Rl
und R2? If not, sb11w u IX>o"lible 70. \Vc wish hl constmc1 a B- irue with fon·
imerle<Jving of the statemeots of PI (lUI(lite lllllllbc:r uf [X>intCr:> por ll<!UC)
und P2 such that mutool oxclusion is eqool to J for the f<'llo\\ing set n t key
vinlurL'<l (i.e., both P I und P2 u~e R1 or val ue~:
R2 ut tlte sawc tinoe), 80. 50, I0. 7\J, 31), I0[), \10
b. Can dendlnck occur in the above Assume Owt lhe rrec is 1nirially empty nnd
prngratn'l If ,VOl< show u jl(>ssiblo 1hc ' 'a lites oro nJdcd in thb urdcr g~vcn .
interleaving (If the stnte111ents <>I f' I
a. Show the tree allcr mscrtion ol' 10.
ond P2 lca.Ji n~ to deadlock
:Jtler iusetrion of30, ~hHI after 111~r1 iou
c. Exobange U1c s tmements Ql anJ Q3 of 90. lllltnnediato lr- ueet.l not be
ond statements Q2 und Q4. Is tlllltltn.l shmvu.
exclush>n guarunlee.J rluw'J Cnu
deudlook occur'/ b. The key vutues 3\l UJ1d l (/ u.-.: """'
deleted from tlte tree in dull order.
Cnn.<>t.lcr u diak with 1h" 100 IT:lclts Shmv the tree after each delctiun.
numbered from 0 10 9'1 rt,t:uting u l 3000
rpm. The number of :scet<>rs pcor tmck ss