Computer Science & Engineering: A (Mark)

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

GATE- I Q91

COMPUTER SCIENCE & ENGINEERING


----- ---~

PART· A ( 74 Marks ] ~vii) The mmtmum number of


comparisons required to sort 5
dements is _ __
I, Fill in the blanks: (viii) Tbe weighted external path length of
( 15 s2 = 3()) the binary tree in Fig. 1 i.s _ _

(i)

.
Ft>r the digital circuit in Pig. I the
expression fonhe outpU1 I is
...

... .....
CiT) ln interleaved metnOI)' organiwtion.
{h:) if the binary tree in Fig. 3 is
consecutive words are stored in
traversed in inorder. th~n the order in
c.onsecmive memory modules in
which lhe nodes wil l be visited is
interleaving. whereas
consecurive words are stored within
lhe module in imerleaving.

(iii) Consider the number given by th"


decimal expression
I(11 + 9 + 162 + 7 + Hi + 5 + 3
The number of I 'S in tlJe unsigned
binary n::pres~ntation or tl:te uwnbcr
is
(iv) Using the 8087 arithmetic processor (X) Consider tl1e R>llowing recursive
whh tlte 8086 Ct>U requires that the delinilion tJffib:
8086 CUL' js operated _ _ llh (/1) :. = tl n • O ..._ 1
.... iln =-- 1""-1
~ v) When two 4-bit binury number A = .... fib (n- t ) -+ lib fn- 2)
BtBzlltllo and 13 z b, bl btbn are
multiplied the digit c l oF1he pt·odtJCt The numbet· of times fib s called
C b giv~n by___ (Including U1e first cal l) for an
evaluation ~ r lib (7) is -------
(vi) Consider the following Pascal
program segment: {xi\ Titc.nritiJmetic e"1Jression:
al-a · •- <•+b) • c - d/e;o/
......
...., l >rao •
l : -e l . . 2 :
Is to be evaluated on a two-address
machine, where each operand is

...,W l ... I ..; > O - I : •t-1


. . , : •i-2
eiUter a register or a memory
location.
With tl1e minimum nwnber of
/In approprime toop-ln1•arinm tbr the IJlemory ~ccesses of 11perands. the
while-loop is _ _ _
2 of8
number of resi!t<'t'S retluroed to (P ) U~eJ by processor for holdiog
~vniWitc this e;q>ressilm i< _ _ I'he the b11.~ foe con~ecutlve
number ormemory occc..~es or it1~truetitm cycles
opcr.nds is _ _.
(Q) u~od for extending Ute m~mncy
or 1/0 cycl~ limes
(xli) A given ~•! of pro.:.esses cru1 b" (R) Used for g"tting bo ld of
irnpl~'tDcmt~d by using onl) proccssnr bu!l in ma.ximwn bus
porl!egin. p•!Cild <lobsment, if the mDde
prlleedence grnph of these processes
i&_ __ (S) Uwd lot requesting pruce~sor
bus in ruinimwn bus mode
(xiil) 'lho llJlmber -of iolegeNri pl"'" (l j, k)
(iii) (i\) Buddy ~Y$tem
with I ~ i, j , k ~ 30(\such th3t i l- j -
k is divisible by .:1 is _ __ (13) lnt.,rprellltion
(:dv\ If the \ong.,st cbaln In • pn.rtiol urder (C) \ ' irt1L1l memory
la nf length ir d1en the pmial o rder II)) I\) inter type
can be written a•. a (!I' n
tmticlutins . (]") Run-time 'YP" speeificotion
(.w) f bo muimum numbllt of pa~Sibla (Q) Segmenlotlon
edge<> i n ;n undirected graph with n
( R) Mernocy ollucaLI<Jn
\'llrlicoes and. k components IS _ __
(Sl G•rbage col!oction
2. !\•latch tho pain; in tho following quel;twns
by writing the corresp onding letters only:. (tV) (A) "J'he number of distmct bimll)'
treei with n nodes
(4 X 2 = 8)
(B) 1llc number af binury sll:ings 1>f
(i) (1\) !Eiill4~8
leqgth 2n with an equal number
(B) IY.EF.7% oro·~ nnd 1'~
(C) l££E696 (C) The oumb~r of oven
pcmmtalions of n o bjects
(0) .RS2J2-C
(P) ! Jlecilles tlt.o interface tor
(I)} ·n,., numbl:1' or binnry string~.
of lengn, 6n u lticlt ttt'e
conuoo&lng il sin.gltJ dv"\•ice
polindromt:S \\ iUt 2l1 0'•
tQl •pecifics the bn.~ • tandard fvr
Ill
Cl)nnt<:t )ng a CQmpUIJ;r I() mhe< (l'l 2
dd\'lecs mduding CPU's
(R) ~eciJics the s l<lndard for •n
ms trumentation bw; (QJ (~" J
(S) spooifics the bus staudat'd Jbr
tbu ·'bacl.:plruu:" bull c.1Ucd
.Mult.ibus
(R) C"l
IS) - '- ( 21i)
Ill) For tb" 8086 microprocessor. n+ J rr I

(A) RQ IGT 3 Choose Ute com>:! allematinl~ (more than


one may be correll!) ond \Wile U1~
ffil LOrK corrc•ponding ltllm's only:
( C') II0 W ( 14 x 2 ='2N)
(D) READY
3 of8
(i) Tbe u.dvanrage Qf CMOS technology (C) httt'h Ute 8 hit< qf address lir1es
overn MOS is: !\D7-ADO into an extenrul
latch
(A) lower powC{"diJ;sip~ti.on
(D) lind dta interrupt enable stiltus
(13) greater speed
of the TRAP .inte.rropt
(C) smaller cltip size (E) none of !he above;
(0) Ft~we.rma~kR for fabrii."lltion
(~i) Kruskal.-& alg<iritbm for finding. a
(E) JlC!Ile of fue above. u.ti.nimruo spantl.LUg tree ofa weighted
grnplt 0 witlLn vertices and ttl edges
(ii) Advantage t>f sy:nehronous sequeuliaJ
has tlte ti.Jne-.:onqJl cxily of:
cifC\litli over l!SyliC:Itrqnous ones ]s;
(A) O(n')
tA) taster operation
(B) O(mn)
(B) ea<e of avojdlng {'roblem• due
l" lmzarils. (C) O(,m t n)
~C) lower hardware requirement (D) 0 (rr1log n)
(D) bclter noise i mmunily (E) O(m\
(E) ooue of the above. fVi:i) The f<>llowing seqn~nce or Opet'llt:ionB
(Iii) 1'11a loml i>'tZe of address spa~ in a
is pcrfooncd on a stack:
virhml memory- system is limited l>y; PUSH (10), PUSH (20). POP- Pt!SB
(10), PUSH (20) POP POP, POP,
(A) dto leugtlt ofMAR
PUSH(20). POP.
(B) the nvaiJallie •eCQndrny l!tor;~ge
'llle sequence <>fv-ahles poppcd 0111 Is:
(C) the availableJnainml'!ltlOJY
(A) 20. J0·. 20. 10. 20
(D) all of the above
CB) 20. 20. 10_10. 20
(E) tton0 oftlte above.
(C) I0. 20, '20 10. 20
(iv) The 1'RAP interrul)t nu!clmnilau oftlu! 00) 20. 20. 10. 20_Jp
8()8S mierQprocessor;
(e) no11e ofOte abov\1.
{A) executes an RSTby hardware

............
(\>iil)C0113iaer thltfoUowing Pascal fiutction!
ex.ecutes m in&tmcti.on •nPJ>lied
_ _.IJ',,._),......,,
(B)
by an e.xteroa1 device lhrough
UtelNTA si~al
_
(C) ex~1es an iu•lru<·libn from f:•t :
.... ,.• <·•••:•'+•·

mem01y location 20R
I X:•i
(D) executes a NOP
()!) none of tlu~ above. The 6m~tinn onl.l 'X(N), i f N i•
positive, will retwn

(V) TI1e ALE llne of mt 8085 (A) L.JiVJ


nricroprooossor is used to:
(A) latch fue output of an. J/0 (B) lv'NI-t
instmclion intt~ u.n e~temal
lirtcll rq r.JiVl
dcacfivat~ lhe chip-select signal
(B)
ITommemol)l devices ro) r.JNl+'
I ut R
(B) None of the obo• e of on mdlvisible m.>chine-
fnstruction. such as tcst-Jmd-Het.
(ilt) A ..linR editor" is .a pro!!film I hot:
CCI 'llle IJ.~o of moniton; c n~urcs
(A) mntcltcs tb~: pornmel<n< of tho
tbat n() de.1tl· lock• will be
mnorq ddin~ion witlt loc.stion•
l:at~~etl.
of the parnmeters of ~1e macro
eoU (D) Th~: l.RU p>g.,-ropla.,.,nJonl
policy mil.y I!DU•u thmsbln~ I or
(B) mntches cxkmnl nomll5 of om:
some I)T• ofprograms
program with their locahons in
other prognun" (,E) The best-Iii teclmiqucs J'm
mente!)' a.U0<:3tion Cll!lurcs Otot
(C) mutclti!> the ~or>meh:r; of
•Uhroutlne dcfiniti<m wiih th~ me mory wtl.l " "''"" be
t'rngmented,
locations of l'"rnmetcrs nf the
subroutine call (xii) If f t· F2 nnd F, arc propvsitinual
(0) >Cb M ~ link between text
fonnul•e suolt U10rFt 1', - > F, and Ft
edit<)r and the u~er F1 t .F1 a.ro botlt t;mtolosia.s. tl1en
wbjoh of tbe following i.• t.rne:
(E) •cts as • link 1>ctwccn cOJDpikr
ond 11~cr program . fA) Botl11>1 and F~ ore uuwlogies

(;«) .tndicale nil the true statements lrom (B) Tho ootlj~toct1on F1 P~ i~ not
t11e fuUowiiiJ!: soti;fi3ble
(A} RcoUBive descant pomn& (C") Noithcr is llt UtOhl¥tlll•
cannot be used for grammars (D) Neitb<"'' i• ~nlislinble
wiOl lell recursion.
(E) Non.• of U1e •llwe.
(B) The intct'rucdi• te fnnn for
(Xiii)L~ r 1 (1 + 0)••• l l "O >llJt • 1•0
rep.uentin.ll e~pres~ions which
i.~ bc;st ~uited for CQde be three regular exprassiooL Which
011timi.zation Is tho po$tfil( one of the follmvmg is true'/
iorm. !Al Lis) Lit) •nd L\s) \ L(l}
1C') '\ prOgrttmming langu~&c n(Jt (B) L(r) = L (s) ~od L(&) ~ L( t)
s upJli,lrting cilltef re.,ur~it)n '"
pointer typ<:o! <lOCI! nol need the (C) L(.s) =L(t) and L(s) ,;: L(r )
•np(l(frt nr dyn~mic memor}
(I)) l. (t) - I, (•) :tnd J ,(~) - q r)
oiiOil.'ltion,
(£) Nlltlc of Ut<- abuw
(D) Altltougll C doo~ not ~upport
call·by·nnmo pnrnmeter (xiv) \Vh,ch one of the rollowing i~ the
pnssing, the effect can be strongest corre~t statement about a
cot~lly simulated :in C. finir.e l3llguogo over sumo fitlile
(E) No fc:~ture of P>S<:Al vlolot.a olpbabol ~?
strons typmg in Paso~ I. (AI It could tx: undeoidahle
t.<i) lndicate Jill the flllsc st.atcmonL• li mn (!:!) It is "ruring-mochine
the stotcm<lnL~ gken below: recogniz!tble
(AI The amount or virtual m<:nHll)' (C) It i• n context-sensitive
•vaiiAble L• limited by tl•" language
•v•il•bility tof $<'C<lttd o.l)
~tomge,
(D) rt is a rogular language
(R) Non• qfU1e ·~()ve,
(8) Anv implen>ent.ation nf n
critical section roiJUOO tho usco. ~. {,jj\le ~hQrt DOS\I'Cli! hi the 1\llliiW in!4
q~~tslions:
jut M
(4 x 2 ~ 8) \Yib}re 111 w1d d denote tlte
·mintcmJ$ und don· ! earll)i,
(i) Coll\"<rl the ti>llowing Pascnl
rcspoclivcly.
stulcmClll 111 11 aiugle n.~sigmnent
s tntcmonl; (4)

_,,_.... ,
11 >1' - , !- - - (c) l'tnd U1t maximum clock Ircqucnc')
>•t 1\ hkh the ~<)Uuter iu fig. 5 ~nu
be operute<i Assume tiJal tlte
Jlrupogntion delay t.brouglt eucb
(ii J Couvert the Pasc;~l st:Jtcmc nl n:pcat Oip-Oor and euob AND guw is 1\1
S uoti l l:l; mlo on "'luivalent f'ascnl ns. Also nssume thut tb" wtup time
statement that uses the. wltilc for tl•~ . I K inpuu. •lf tho Oip·Jl~p~
COnS'truCL 1$ negligible.

(iii) Ol)wjn the optimal hi1ml)' $ellrch


tre~ with c'<Jl,lal probabilitios for tl10
identifier set (a 1, n,, 3 )) - (If; stnp,
while).
(1v) If a finite u.~iom ~yst.,ut A fot• u
theol) is complefc rutcl cousis tem, (2)
I h~o is .Jvery ~ubsy~ldJJt ot: A
(a) US~og f) nift'Oilp$ und ,gates,
complete and consistent? Ec~:plaiu
tlu1;lgn u pdnJIJ~I-in,scriul -()ut shill
bncn~.
rogis tcr th<lt shiflll dnto from Jolt to
right with th~ fnlloni ug tor u1 li n~!.•'
PART·B ( 126 Marks J til ulook CL.K
(iiJ tul\!e J111l;llllel dato inputs A, ll, C

(0) Anal~ s.o th~ei'l'Ouit in Fig. 4 nnd (iii) serial inputS


• omplcto the followi ng mhlc; (1•) cuutro l input LOIIDISHIFT
I
I
•• (S)
I

•' (IJ) Design u 1024-bit ~·n•l·ttl s•rhtl-


out uuidlre'-'tLuuul sltill registar
using u I K x l bit RAM with duk1
Input 0 ;,. • dnlll o utput D••, and
O<lntrol input RF.AD/ff7UTE . You
n111y nsstm•~ thil uvnitnbility of
~landnrd SSI ond MS I t o mponoots
such os gates. registers and
countcnL
(5)

7. 11 h rcq ulrud lo d¢sign u hutdwir\ld


<:<introll~r
to hundl~ tho tiMh ~yela i'f u
(b) J'lnd the mln.unum sum-of-rrodncls single nddrcss Cl'IJ with n 16-bit
J\Jmt of the logi<J>- 1\utctiou lil$1rucdon leogth. The effecti\•e a~dress of
t{A.U,C.D )- ~m(0,2,S, l 0, I 5 lt :m mdcx.:d instructio n s ho uld bi; d .:nvcd
~d(~.ll. 12. I.J) ln tb" lo!cb uyele [!soli: Assume thai tl"'
o ofI!
lower· o.rder B bns of nn l nsttuotlon Wntc a shon program seynent whtch
constotute the operand field performs a 200H byte programmed l/0
data transfer to the device from memory
(a) Gwe the "~SI Ster trausfer sequence address 340011
tbr realising thl' above lnslruction
fetcb cycle, (6)

(h) Draw the log:tc ilchemnll<" of the


hardwired controller rncludrns the
(4)
-
...,.
I

data paib

s. (a) Consrder an 8085·based sySlem ~·


upetatin,g wrth the followrug f,J, (a) Consider the followmg pseudo-

__.. ,,....
specJficatrons: code. (all d311t items arc or type
mtegcr)
Crystal frequency 6 MHz.. ~) ;

ROM map:
RAM mup .
0000 through 07FF,
I 000 through 17FF
ROM reqt~ires one watt ~tate
.....• :•2 ;
e!•• + • :
{,):

• := t:
RAM reqwres no wait state.

..
F! •S ;

.,,.,.
'"' t-..·
Determrne the rnS1ruct10n cycle time for z := tOO ;
e8ch of tbu following lnstrucliuns
(l)
(li)
ORI r\ , 22
OCR M
... .... ;
.-.-~ -·. 1)

Oetermmc lts outpuL if ~te parameters ..-e


-

pas!;l!d 10 the proc~dure I' by (i\ \'lllue, (11)


Assume rhe follnwin~ rnitiai conditions -
of the CPU regrstcrs (iu hex) for• each of reference and I itt) name
the mstnrctions (6)
i\ 55. B~i\A_ C> F7, D 10. II I!), V.Ff, (b) For the fol1owmg pseudo-code,
lndicato the output, i C (I) static
PC= 0200, SP = 17 PO.
·scope rules and (ii) dyn;unoc scope
(4\ rules are Used.
(b) Develop 3n output port interti!ce (draw a .,., •. b : htteoe,.1

block schcmauc) iOr an 8085-based system


...-,.. , ,
e := S t b t• to
w tlh a dcmultr ploxcd address bus wbtch
- (P}:
mcorpo rates. a handshake prolocol a• per
.....-o:
the tJmmg dmgram _g,ven 1n F1g. (), The. ..,.,., b ! lntept ;
intcrofuco should rnclude a statu~ mpm pon. P:
at 1/0 address 401-1 whrc,h reads the - 101 :
INTERRUPT and BUFPULL srgnals ......
· ~ =- 1 ; b ;.c t :

-
through the most stgniftcrutl bit <~nd the
01
least signilicant btL respectively. The twlf• t·. -'• •. 'b =- •• bl
output data port Is nt the same 1(0 address
-101-1 and is acuvated by a write operation
Assume Ute availauil.ity of SSI. and MSJ (4)
level compenents Qrtly
7 n[l!
10. Consider tb~ follo\\1ng grUituttor ror (u) D•~ tlli• }ic~e111e ensure ntuluul
urithmelic express•••••q u.<tng bin•!) ex.olusioo in 1he critlrul .>ecli1111'l
Qperotors and 1,1hicb o.re not assooiutive: Brielly ~xplnin.
li 4 E- 1~T (5)
I'~TI-' F (b) Is there n ~ituotion in wlu~>h n
waiting process can never enter the
f'-+(6) i d critical HCCt'iNJ'l U' ~ ~"\plnin 1111d
tJ: os 1be stan •Ymbol ) s uggest modifications to ~Jc c.odc
l'.' oolve this Pfl)blem
(u) Is lb1s .srruwnar un:uubis,9us'l lf so,
what is the n:l•live pn:cedoucc (5)
between ~und 1'1 u: not. gtve en 12. SuppQSil, u dnht bu•c consi.qt, ~f lhe
unamblgous grammar lhul rollbwing TCiulionR:
gives! precedence o'"er-
S\JPPIJE.R (SCODE, SNAME, CfTY)
(21
PART (PCODE. PNAM I!, PDBSC. cn·Yl
ib) Does ~~•
grn,nmur allmv
exprossoons wid1 redundant PROJECTS (PRCODI!, I'RNAMI!., CITY)
JJ<Itcothescs us in (id i u) nr in ld- SPPR (SCODI!. PCODE. PRCODE.
(idtid)? U: so, convcJ1 ll1c grammar Q'J'Y) ,
iuto o ne which db~:$ uol genomic
e~pressious with rcdund1wt (u} Write SQL progr•ms
parentheses. Do Utis whb minimwu currespoudinji to Ute following
number of changes to lhc given quencs;
l)rtllluutiun rules t\J\J uJJing ttl fi) Print PCODE values lp r
most une murl! ·pn•ducli()n rule. parts supphcd let nny
(4) project In DELl 0 b) a
supplier m 1)1\LIII
(o) Convel1 H1e grnmmnr Qbtamed in
is not loti
( b ) inln one ll>ut I tt / Prtut all tci pl"" (CITY.
rtoursivc. I>COD!c:. CITY ~ such thnt a
suppltcr in the U I'St ci.ty
H) ~uppJi<l.$ t be spt'Cwed pat1
II Cunsirlet the lilllml "'$ sobcme IC.It h> u project iu th~ second
iJnplotllculiull- u. c:rilje<u section iu a ci ty. but do not print triples
silualiuu \\itiJ Um:c: processes P 1• P" and in which lhe two CITY
Pli. volucs are the same.
,,
-_.......
. .. Cif=::l-
..... cn-- -.. w.•
1 (b) Write ul!!ebrruu solmiun$ ~co
(6)
the

·-.....--···1
tn llcl\viug.
h•..,rn e..
( i) (Jel SCODJ; vnlues f<>r
. .. t4t•W.t
~uppli¢~ who supply 1u

-................
,
. . t4h--- ixlth projects PR I nnd E'B2.

...,.. .....
·~ ·-··1 ~ -
,...
, ;
,
(ii) Get PRCODE 'olue" for
projects supplied by nl lea<l
one supplier not 10 the
.... , h . ...

---
---
..... ............ ,f
. . (11 ; - .... ,

.... ; ~
13.
Srune cit)
(-I I
01ve dn optlmul ulgoritlllll Ill p:<eudC>-Il<><lc
t'or SQrtmg a sequence of n mtmbers which
ha.• only k disti nct numbers (k i> llol
~ ofl>
C..t..) ctt• fi (A1Y) A (Arr O:rHflb.f)- - - {f•'H
~nown • lllll!OI G,;e • bnef llnuly>O~ far,
"' ._.,, ' ">') c.v• Ul <..: ;t,.. 111 ,,, ,, - 111 ,. , ,,.
the ume-comple\l t)' of )(lur ni!!Qnthm I\ IA.d - 1(.4 11~
110) (A - uniHTsal qunnufict dni.l I' -
14 tXISI<ntial quamiliet)
Whttl Jlntctun: ,. I"CJ'fC>Cnlttl b) Does 11 hn• e finite model•?
the bu1~ lf'ee..,
Is n sansf111ble' If so, ~·e a
Ill countable model fN n~
tbl Gt~C me dtll'~enl >ICps for dcleltnll (51
the node .,;,h ~ey S "" rh31 rhe I(> lot Fmd !he number of b!nal') stnR!I>
ilTUCIUI-c r• fl<"-"""' cd " o f l~n~th 2n \\lUI 1111 cquol
(l) number or 1-s and O's. and the
propal)' !hal c.-cry ~lh or w luu
ttl Outhnc o proe:~urc m pscud~t at leas~ u.< orumy ll's rs. I'>
w dd<t< nn atbttnl1) node frocn
wch a hrnal') 1m: wuh n nodes thlll (SI
"''"'"!\cot:. 1hc ~tnu:tur~ Whnt ,, 1h" tbl Sh"" lhot all •nile~ tn 011
\\C>I'SI<tb< tunc-comple~uy llfyuur
undirected fioue j,traplt cannot hn• •
proccdurc'l
di•noa d~ if tile 11mph lm~ pt
(3) lcu.'a hHJ ''Mt«:~.
(51
1 7~ (U) Sho\\ thm I urutg on!IChoneo. \\ hldo
have a read-<»tly Input tape and a
constnnl-•izc \Vat k· tape. rcllOjlno""
po'l>CtS<lly the ch.ss of resu1nr
lanb'llages.

15 Ia)
. ..
Show that the product ol the letbt
(b) Let 1. b~ Lhc htnguaj,!e oll btiiUI)
>tnu~ "' •\'luch 1he Lhlrrl onll(ol
or
'>
(51

common rnuluplo nn<l the and tlte rrom !he nghr IS 1) 1 Oh e • 11011-
determinislic fi nile antomntoo 1ha1
lt'feiH~t COIItmUII d t\ t"()t nf l'\0
rccogntto> 1 111N muny <tutu'
JX'ICiiCI\C IUIU~t.:r' ft und b IS t1 ' h
docs the uu..nJm.szrd cqun:alcru
15) deterministic fimtc 8UIOinAton
lonlildcr the folhmrn~ litSl-otucr hO• <'~ Jtt,lll) ) our"'""' c• bncOy
fomJUla (51

You might also like