操作系统第1章习题答案_第1页
操作系统第1章习题答案_第2页
操作系统第1章习题答案_第3页
操作系统第1章习题答案_第4页
操作系统第1章习题答案_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1.1 Memory(contentsinhex):300:3005;301:5940;302:7006 Step1:3005IR;Step2:3AC Step3:5940IR;Step4:3+2=5AC Step5:7006IR;Step6:ACDevice61.2 1. a. ThePCcontains300,theaddressofthefirstinstruction.ThisvalueisloadedintotheMAR. b. Thevalueinlocation300(whichistheinstructionwiththevalue1940inhexadecimal)isloadedintotheMBR,andthePCisincremented.Thesetwostepscanbedoneinparallel. c. ThevalueintheMBRisloadedintotheIR. 2. a. TheaddressportionoftheIR(940)isloadedintotheMAR. b. Thevalueinlocation940isloadedintotheMBR. c. ThevalueintheMBRisloadedintotheAC. 3. a. ThevalueinthePC(301)isloadedintotheMAR. b. Thevalueinlocation301(whichistheinstructionwiththevalue5941)isloadedintotheMBR,andthePCisincremented. c. ThevalueintheMBRisloadedintotheIR. 4. a. TheaddressportionoftheIR(941)isloadedintotheMAR. b. Thevalueinlocation941isloadedintotheMBR. c. TheoldvalueoftheACandthevalueoflocationMBRareaddedandtheresultisstoredintheAC. 5. a. ThevalueinthePC(302)isloadedintotheMAR. b. Thevalueinlocation302(whichistheinstructionwiththevalue2941)isloadedintotheMBR,andthePCisincremented. c. ThevalueintheMBRisloadedintotheIR. 6. a. TheaddressportionoftheIR(941)isloadedintotheMAR. b. ThevalueintheACisloadedintotheMBR. c. ThevalueintheMBRisstoredinlocation941.1.3 a. 224 b. (1) Ifthelocaladdressbusis32bits,thewholeaddresscanbetransferredatonceanddecodedinmemory.However,sincethedatabusisonly16bits,itwillrequire2cyclestofetcha32-bitinstructionoroperand. (2) The16bitsoftheaddressplacedontheaddressbuscan'taccessthewholememory.Thusamorecomplexmemoryinterfacecontrolisneededtolatchthefirstpartoftheaddressandthenthesecondpart(sincethemicroprocessorwillendintwosteps).Fora32-bitaddress,onemayassumethefirsthalfwilldecodetoaccessa"row"inmemory,whilethesecondhalfissentlatertoaccessa"column"inmemory.Inadditiontothetwo-stepaddressoperation,themicroprocessorwillneed2cyclestofetchthe32bitinstruction/operand. c. Theprogramcountermustbeatleast24bits.Typically,a32-bitmicroprocessorwillhavea32-bitexternaladdressbusanda32-bitprogramcounter,unlesson-chipsegmentregistersareusedthatmayworkwithasmallerprogramcounter.Iftheinstructionregisteristocontainthewholeinstruction,itwillhavetobe32-bitslong;ifitwillcontainonlytheopcode(calledtheopcoderegister)thenitwillhavetobe8bitslong.1.4 Incases(a)and(b),themicroprocessorwillbeabletoaccess216=64Kbytes;theonlydifferenceisthatwithan8-bitmemoryeachaccesswilltransferabyte,whilewitha16-bitmemoryanaccessmaytransferabyteora16-byteword.Forcase(c),separateinputandoutputinstructionsareneeded,whoseexecutionwillgenerateseparate"I/Osignals"(differentfromthe"memorysignals"generatedwiththeexecutionofmemory-typeinstructions);ataminimum,oneadditionaloutputpinwillberequiredtocarrythisnewsignal.Forcase(d),itcansupport28=256inputand281.5 Clockcycle= Buscycle=4125ns=500ns 2bytestransferredevery500ns;thustransferrate=4MBytes/sec Doublingthefrequencymaymeanadoptinganewchipmanufacturingtechnology(assumingeachinstructionswillhavethesamenumberofclockcycles);doublingtheexternaldatabusmeanswider(maybenewer)on-chipdatabusdrivers/latchesandmodificationstothebuscontrollogic.Inthefirstcase,thespeedofthememorychipswillalsoneedtodouble(roughly)nottoslowdownthemicroprocessor;inthesecondcase,the"wordlength"ofthememorywillhavetodoubletobeabletosend/receive32-bitquantities.1.6 a. WhentheCPUhasdatatosendtotheteletype,itchecksFGO.IfFGO=0,theCPUmustwait.IfFGO=1,theCPUtransfersthecontentsoftheACtoOUTRandsetsFGOto0.TheteletypesetsFGIto1afterthewordisprinted. b. Theprocessdescribedin(a)isverywasteful.TheCPU,whichismuchfasterthantheteletype,mustrepeatedlycheckFGIandFGO.Ifinterruptsareused,theteletypecanissueaninterrupttotheCPUwheneveritisreadytoacceptorsenddata.TheIENregistercanbesetbytheCPU(underprogrammercontrol)1.7 Ifaprocessorisheldupinattemptingtoreadorwritememory,usuallynodamageoccursexceptaslightlossoftime.However,aDMAtransfermaybetoorfromadevicethatisreceivingorsendingdatainastream(e.g.,diskortape),andcannotbestopped.Thus,iftheDMAmoduleisheldup(deniedcontinuingaccesstomainmemory),datawillbelost.1.8 Letusignoredataread/writeoperationsandassumetheprocessoronlyfetchesinstructions.Thentheprocessorneedsaccesstomainmemoryonceeverymicrosecond.TheDMAmoduleistransferringcharactersatarateof1200characterspersecond,oroneevery833µs.TheDMAtherefore"steals"every833rdcycle.Thisslowsdowntheprocessorapproximately1.9 a. Theprocessorcanonlydevote5%ofitstimetoI/O.ThusthemaximumI/Oinstructionexecutionrateis106 b. ThenumberofmachinecyclesavailableforDMAcontrolis 106(0.055+0.952)=2.15106 IfweassumethattheDMAmodulecanuseallofthesecycles,andignoreanysetuporstatus-checkingtime,thenthisvalueisthemaximumI/Otransferrate.1.10 a. b. Thetenaccessestoa[i]withintheinnerforloopwhichoccurwithinashortintervaloftime.1.11 Define Ci = Averagecostperbit,memoryleveli Si = Sizeofmemoryleveli Ti = Timetoaccessawordinmemoryleveli Hi = Probabilitythatawordisinmemoryiandinnohigher-levelmemory Bi = Timetotransferablockofdatafrommemorylevel(i+1)tomemoryleveli Letcachebememorylevel1;mainmemory,memorylevel2;andsoon,foratotalofNlevelsofmemory.Then ThederivationofTsismorecomplicated.Webeginwiththeresultfromprobabilitytheorythat: Wecanwrite: WeneedtorealizethatifawordisinM1(cache),itisreadimmediately.IfitisinM2butnotM1,thenablockofdataistransferredfromM2toM1andthenread.Thus: T2=B1+T1 Further T3=B2+T2=B1+B2+T1 Generalizing: So But Finally1.12 a. Cost=Cm8106=8103 b. Cost=Cc8106=8104¢=$800 c. FromEquation1.1: 1.1T1=T1+

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论