lre.l~jive) - ceng2.ktu.edu.tr

2
Name, Lastname, Stu #: 1 2 3 4 5 6 7 8 Toplam 4 1 2 2 2 1 2 3 POC; KTU Faculty of Engineering, Dept. of Computer Engineering cowan, 2000 Mid-Term Exam 24.04.2017 1. List the sequence of micro-operations required forINC N instruction. /I INC N emrinin cahstrnlrnas: icln gereken mikro-operasyonlar dizisini listeleyiniz. DR 4- M[PC.] l1<..4-DR. PC-PC-+1 Dr<- - M [pc.] I\R -<t- bR vc .-PC +1- D~+-t\o\ [AR.} AC +-t>R Ac -+- AC + 1 PR+- AC 3. Which addressing mode should be used by an instruction to conditionally branch to an address. Explain your reason(s) in one sentence? Kosullu olarak bir adrese program akrsiru aktarmak icln bir emrin hangi adresleme modunu kullanmasi gerekir. Neden(ler)inizi bir curnle ile acrklayrmz. Gb'ce.ce.l; lRe.L~Jive) adrestelo1l\c l'Y\odt..t kullc"p"\I\I'Y\'1Ld,r, 13L.l o.dre.slelMe. YY\od.1..t. 1 OI.clres\ .pC' 'ji k!AlIc..V\~Y~k olt.ts~urdt..tjt.\ IS'V\. f(O~rrc,l'V\t~y-",\ her~QV\5i bir Ctdr~5e lj~k.k",-c:...b;(VV\e5iV\e. iz'IYi VO"ir (f2..el o c.o.+o./'\e) Explain in one sentence the reason to store not only the program counter as in suroutine calls but also all registers before an interrupt is serviced. /I Kesmeye servis verilmeden once neden alt program ~agnlannda olduqu gibi yalruz program sayaci deqll fakat diger turn kaydedici i~eriklerinin saklanrnasi qerektiqini bir curnle ile acrklayrruz. k_esY'l\e l\er') It') r'\e. z.o.YV\Qt'\ sdec.ej\ bi\j", "",ed'jl' iC;it"l, al+projV"ctl-V\ fClj(,iay,"\d ~ ~\duj~ 5ibi jCitVlI1.. 10(~j.(q~ SCtjQC.II1I \c..Dr\..1W10k ~cYine) j~leW\cil-\iV\ dIA.YL.(W14>\",1\ -tClYV\C,""'It'\ I l ~~VV\ k~d(c.(,c\ \eYI) 5'C(k..\o.""'CI k 3ere..k·I1·" CPUresets Enable Interrupt Flip-flop (ElF) after it acknowledges an interrupt before it is serviced. Explain in one sentence why it should be enabled in interrupt service routine. /I MiB kesmeyi kabule ettiqini onayladrktan sonra servis programma gitmeden once Kesmeyi Yetkilendir Bayraquu (ElF) siftrlar. Kesme servis programmda kesmenin neden yetkilendirdiqini bir curnle ile aoklayrmz. G de.'" )c:.esl'V'leY\I",) se.-rV:$ f'0j1"'Qt'>'Ilno.. J"dildij" ~V\d'l t.e.kvC((' k-esVY\eje nede/l'\ . OlV>-lqS''''Cl en5el olW\Ctk. i.:;.i'l) i;-\eV¥\c\ k..e5~e.'j; kqb4\ e..t\-ijil1c\e E-If- ''ji srl1rlqr. kesV\'1e servi'!>pr0T"QI't\\ i'7iY\de, c\qh~ ~tAk5ek.o'l1celikli k~~e\eY ;<;/f\ £1;: =~ j qplltt'-. Suggest an input output mode for a gigabit Ethernet card using 9000 byte jumbo packets for high efficiency and explain your reason in one sentence. /I Yuksek verim i~in 9000 byte'likjumbo paket kullanan bir Ethernet karti icin bir giri~ ~Ikl~ modu oneriniz ve gerek~enizi bir curnle ile acrklayiruz. G-\~o.6i t e.+hel'"\'\et Ic::ClrtlVllv\ be.\\e..j e. eVl ~'2.\, b ic;.i n'\ de. \C\J\lCA.~\ \h\CI 11Cllr. C p U I n'-lr1 o.i\\~ -\-al'v\r1)"'~ i Y I'l1de\c.'1 1000 ~0+e",k veri Ji C\kt~v-YV\ak.. tS--iV\ D05("lAdQII'I gellek Eri.fi"l'\i COMA) QYc.dat') ~JkC\nld'j' ~IA mod e", ~\2.\1 (SIt; '0. i'2;'" vcrir. 2. 4. 5. Priority of more than one peripheral sending interrupt request should be established by either an external hardware or through software. Explain in one sentence how priority is established by software among peripherals, P1, P2 and P3 where P1 has the highest and P3 has the lowest priority. /I Birden cok cevre cihazinm kesme isteqintn onceliqi ya dl~ bir donarurn ile veya yazrhm araCiligl ile saqlanabilir. P1'in en yuksek ve P3'in en dusuk onceliqe sahip olduqu P1, P2 ve P3 cevre cihazlannm arasmda yazrhrn ile onceliklerin nasil saglandlglnl bir curnle ile acrklayrruz. G\rde.1'\ Lok C.f..Vre.. c.i~Gi.z.,,,,"l ctra1ay,,,da. o'1ce\i\c. o\u.?+urt'Y\a.k is-i~) keSMe se~v;s fY'o<jravYl"'" d~ blA c.iha.zlc..YI"l is+e..~\e...•.. i ol1lc.ellk $lroSIr)C. 5 or <: te.s+ edjl"",~I,'c.hr, \So~\~ce Q,jlfll Ql"\da. \:e5r'\'ie ::J"rS'C,\ClY biL~ jlA~.r .. dc. Orlcel,lli cikClZ- oll1ce S'erv;S j6''Ci'UY'. 7. Computer performance can be improved by using more than one general purpose and/or input output processors. State the most important problem of multi processor systems and suggest a method to solve it in one sentence. /I Birden cok gene I amach ve/veya giri~ ~Ikl~ islerncisi kullanarak bilgisayarlarm basanmlari yukseltllebllir. Cok islemcili sistemlerin en onernll problemini belirterek cozurnu i~in onerdiqiniz bir yontemi bir curnle ile acrklayrruz. 6. ~ok. l'sleV\1c;\i si..s+cYI1/er-;" eVl OVlc.>"'" Ii fro~leW\i ;~lem~I'\er ~rc.sl 'nC{bl' •• 1~1W\echt"'. ( Of+~k fClj\Ot~I\ClI1 be..\\e.k. ~'2...erir1dL'" hCt/:'erle~l'Y1e i.~~¥ilne i~\eV\1c.ilc.r;V1. do 5 ("L-tdCtV1 ~o.\'~"'lef~S" it;. iY'l h\~11 Qr~~tAc\er ( \-IT ~~a.PI vb.) I<:uIIc,VI I Lr.

Upload: others

Post on 05-May-2022

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: lRe.L~Jive) - ceng2.ktu.edu.tr

Name, Lastname, Stu # : 1 2 3 4 5 6 7 8 Toplam

4 1 2 2 2 1 2 3 POC;KTU Faculty of Engineering, Dept. of Computer Engineering

cowan, 2000 Mid-Term Exam 24.04.2017

1. List the sequence of micro-operations required forINC N instruction. /I INC N emrinin cahstrnlrnas: icln gereken mikro-operasyonlar dizisinilisteleyiniz. DR 4- M[PC.]

l1<..4-DR.PC-PC-+1Dr<- - M [pc.]I\R -<t- bR

vc .-PC +1-D~+-t\o\ [AR.}AC +-t>RAc -+- AC + 1PR+- AC

3.

Which addressing mode should be used by an instruction to conditionally branch to an address. Explain your reason(s) in one sentence?Kosullu olarak bir adrese program akrsiru aktarmak icln bir emrin hangi adresleme modunu kullanmasi gerekir. Neden(ler)inizi bir curnle ileacrklayrmz.

Gb'ce.ce.l; lRe.L~Jive) adrestelo1l\c l'Y\odt..t kullc"p"\I\I'Y\'1Ld,r, 13L.l o.dre.slelMe.

YY\od.1..t.1

OI.clres\ .pC' 'ji k!AlIc..V\~Y~k olt.ts~urdt..tjt.\ IS'V\. f(O~rrc,l'V\t~y-",\

her~QV\5i bir Ctdr~5e lj~k.k",-c:...b;(VV\e5iV\e. iz'IYi VO"ir (f2..eloc.o.+o./'\e)Explain in one sentence the reason to store not only the program counter as in suroutine calls but also all registers before an interrupt isserviced. /I Kesmeye servis verilmeden once neden alt program ~agnlannda olduqu gibi yalruz program sayaci deqll fakat diger turn kaydedicii~eriklerinin saklanrnasi qerektiqini bir curnle ile acrklayrruz.

k_esY'l\e l\er') It') r'\e. z.o.YV\Qt'\ sdec.ej\ bi\j", "",ed'jl' iC;it"l, al+projV"ctl-V\ fClj(,iay,"\d ~~\duj~ 5ibi jCitVlI1.. 10(~j.(q~ SCtjQC.II1I \c..Dr\..1W10k ~cYine) j~leW\cil-\iV\ dIA.YL.(W14>\",1\

-tClYV\C,""'It'\ I l~~VV\ k~d(c.(,c\ \eYI) 5'C(k..\o.""'CI k 3ere..k·I1·"

CPUresets Enable Interrupt Flip-flop (ElF)after it acknowledges an interrupt before it is serviced. Explain in one sentence why it should beenabled in interrupt service routine. /I MiB kesmeyi kabule ettiqini onayladrktan sonra servis programma gitmeden once Kesmeyi YetkilendirBayraquu (ElF)siftrlar. Kesme servis programmda kesmenin neden yetkilendirdiqini bir curnle ile aoklayrmz.

G de.'" )c:.esl'V'leY\I",) se.-rV:$ f'0j1"'Qt'>'Ilno.. J"dildij" ~V\d'l t.e.kvC((' k-esVY\eje nede/l'\ .OlV>-lqS''''Cl en5el olW\Ctk. i.:;.i'l) i;-\eV¥\c\ k..e5~e.'j; kqb4\ e..t\-ijil1c\e E-If- ''ji srl1rlqr.kesV\'1e servi'!>pr0T"QI't\\ i'7iY\de, c\qh~ ~tAk5ek.o'l1celikli k~~e\eY ;<;/f\ £1;: =~ j qplltt'-.

Suggest an input output mode for a gigabit Ethernet card using 9000 byte jumbo packets for high efficiency and explain your reason in onesentence. /I Yuksek verim i~in 9000 byte'likjumbo paket kullanan bir Ethernet karti icin bir giri~ ~Ikl~ modu oneriniz ve gerek~enizi bir curnleile acrklayiruz.

G-\~o.6i t e.+hel'"\'\et Ic::ClrtlVllv\

be.\\e..j e. eVl ~'2.\, b ic;.in'\ de.\C\J\lCA.~\ \h\CI 11Cllr. C p U I n'-lr1

o.i\\~ -\-al'v\r1)"'~ iYI'l1de\c.'1 1000 ~0+e",k veri JiC\kt~v-YV\ak.. tS--iV\ D05("lAdQII'I gellek Eri.fi"l'\i COMA)

QYc.dat') ~JkC\nld'j' ~IA mod e", ~\2.\1 (SIt; '0. i'2;'" vcrir.

2.

4.

5.

Priority of more than one peripheral sending interrupt request should be established by either an external hardware or through software.Explain in one sentence how priority is established by software among peripherals, P1, P2 and P3 where P1 has the highest and P3 has thelowest priority. /I Birden cok cevre cihazinm kesme isteqintn onceliqi ya dl~ bir donarurn ile veya yazrhm araCiligl ile saqlanabilir. P1'in enyuksek ve P3'in en dusuk onceliqe sahip olduqu P1, P2ve P3 cevre cihazlannm arasmda yazrhrn ile onceliklerin nasil saglandlglnl bir curnle ileacrklayrruz.

G\rde.1'\ Lok C.f..Vre.. c.i~Gi.z.,,,,"l ctra1ay,,,da. o'1ce\i\c. o\u.?+urt'Y\a.k is-i~) keSMe se~v;s

fY'o<jravYl"'" d~ blA c.iha.zlc..YI"l is+e..~\e...•..i ol1lc.ellk $lroSIr)C. 5or<: te.s+ edjl"",~I,'c.hr,\So~\~ce Q,jlfll Ql"\da. \:e5r'\'ie ::J"rS'C,\ClY biL~ jlA~.r ..dc. Orlcel,lli cikClZ- oll1ce S'erv;S j6''Ci'UY'.

7. Computer performance can be improved by using more than one general purpose and/or input output processors. State the most importantproblem of multi processor systems and suggest a method to solve it in one sentence. /I Birden cok gene I amach ve/veya giri~ ~Ikl~ islerncisikullanarak bilgisayarlarm basanmlari yukseltllebllir. Cok islemcili sistemlerin en onernll problemini belirterek cozurnu i~in onerdiqiniz biryontemi bir curnle ile acrklayrruz.

6.

~ok. l'sleV\1c;\i si..s+cYI1/er-;" eVl OVlc.>"'" Ii fro~leW\i ;~lem~I'\er ~rc.sl 'nC{bl' •• 1~1W\echt"'.(

Of+~k fClj\Ot~I\ClI1 be..\\e.k. ~'2...erir1dL'" hCt/:'erle~l'Y1e i.~~¥ilne i~\eV\1c.ilc.r;V1. do5("L-tdCtV1

~o.\'~"'lef~S" it;. iY'l h\~11 Qr~~tAc\er ( \-IT ~~a.PI vb.) I<:uIIc,VI I Lr.

Page 2: lRe.L~Jive) - ceng2.ktu.edu.tr

8. From Wikipedia, the free encyclopedia: Heart rate is the speed of the heartbeat measured by the number of contractions of the heart perminute (bprn), Design a microprocessor based portable heart rate monitor to display instantaneous (beats per minute upscaled from the last1.875 second) heart rate every 1.875 second (1875 ms) by updating its display. You may assume that an interrupt generating source sendsperiodic request signals every 125 ms to be used as an interrupt driven timer. Audible heartbeat signal acquired by a microphone from astethoscope is amplified, sampled at 100 Hz and digitized by an 8-bit AID converter before reading in programmed I/O mode. AID convertersupplies End Of Conversion (EOC)signal to indicate that a converted sample is ready to be read. A heart beat pulse value above half of the fullscale of the AID converter (256/2) is assumed to be a contraction of the heart. You should state other assumptions you have to make in orderto design portable heart rate monitor. Hints: (1) Heart rate is often measured by counting beats for 15 seconds and multiplying the number ofbeats by 4. (2) 60 s = 32 x 1.875 sand 1.875 s = 15 x 125 ms. /I Vikipedi, bzgOr ansiklopedi'den: Kalp atirn hrz: (nabiz), dakikada kalbin kasilmasayrsi ile olculen hrzrdtr. Her 1.875 saniyede bir (1875 ms) gbstergede anhk (son 1.875 saniyelik dbnemde olculenden hesaplanan dakikadaki)kalp ans hizrm gbstergede gOncelleyerek gbsteren rnikrolslemdli portatif bir nabiz oleum sistemi tasarlaymrz. Kesme ile surulen bir zarnanlayroyapmak i~in 125 ms'de bir kesme istegi gbnderen bir kaynaqm bulunduqunu varsayabilirsiniz. Steteskopdan mikrofonla alman duyulabilir sessinyali yOkseltilip 100 Hz'de brneklendikten sonra proqrarnh G/C; modunda okunan AID donusturucu ile sayrsallastmlrnaktadrr. AIDdonusturucunun verinin okunmak uzere ham olduqunu gbsteren donusturrne bitti EOCisaretini islernciye iletmektedir. Kalp anrru darbesininAID dbnO~ti.irOcOtam skalasrru yarrsmdan fazla (256/2) degeri kalbin kasilmast olarak kabul edilebilir. Tasarlarken yapmak zorunda kaldrqiruzdiger varsayrrnlan belirtmeniz gerekmektedir. Yol gbsterme : (1) Nabiz genellikle 15 saniye sOresince kalp anslanru sayarak bu sayrrun 4 ilecarpirm sonucunda bulunur. (2) 60 s = 32 x 1.875 sand 1.875 s = 15 x 125 ms

a. Draw the flowchart to compute heart rate in bpml/ Kalp ans hrztm hesaplayan akrs ~izgesini cizlnlz.

, \'2 S ""$ k.~s~e 5eY'vis "1.• rroJr'lt\1 I Bs Q~ o.~If- SClJ'If+ i [ EOC.' ~!0 k.u

\

b. Code heartrate algorithm in any high level language. /I kalphtzt alqoritrnastm herhangi bir yOksek seviyeli dil ile kodlayrruz.void N\oi", lvo i d)

l "-ILtj(elt)

t w~i\e. \. _;"p (EOC) ==)elI);

d~cr::: _in? (~) ;

if (de3UOo;> 128 ~& o'1"\ccki {,\2S')

CAh""-t-+ ;O·l\cek..i::: d~3er;

1

void

Jc. Code heartrate algorithm in assembly language. /I kalphrzi alqoritrnastru Assembly dili ile kodlayiruz.

tIMer_is\", froc

\V'\c <;'Cl~o.C.

CV\o\p 5o.~C1C, t 5

Jl O\.tlo.'('0 ~ 0..-\:\"", 5coil rril'\~f o+,V\'\

r'Y'IOV S''\J ~CI ¢rY\ OV 0<..1-1' ~ I (1

Cl \-\ Cl·. '(' d:

bl'V\er_lsr C2l1dproc

Nob o ] d.e-jer ve,b t {)11 cek...i ckj.::rd;Y".n qbi z p roc

B~lde.~ i", <:\\, ':=OCj7= be-lde\1"\ a \, AIr>t.'M? Q\,f2.g

J~ yokCWlp b~,12gj<j JOk

inc o.~lW\30\c.·· rY'lQV b~,o..t

J~f be.~\e.

nabi'2: e", d pY'o C.