




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
ComputerEnglish計算機專業(yè)英語2-2Requirements:1.Termsofcomputerhardware2.Organizationofcomputersandtheirfunctions3.掌握專業(yè)詞匯的構成規(guī)律,特別是常用詞綴及復合詞的構成
計算機專業(yè)英語2-3NewWords&Expressions:Inputdevices輸入設備 outputdevices輸出設備busn.總線 mainmemory主存儲器addressbus地址總線databus數(shù)據(jù)總線Controlbus控制總線arithmeticlogicunit算數(shù)邏輯單元registern.寄存器2.1BasicOrganizationofComputersCPU(CentralProcessingUnit)中央處理器
I/O(Input/Output)輸入輸出(設備)計算機專業(yè)英語2-42.1BasicOrganizationofComputersFig.2-1Genericcomputerorganization計算機專業(yè)英語2-52.1BasicOrganizationofComputers大多數(shù)計算機系統(tǒng),從汽車和日用電器中的嵌入式控制器到個人計算機和大型主機,都具有相同的基本組成。其基本組成包括三個主要部件:CPU、存儲器子系統(tǒng)和I/O子系統(tǒng)。這些部件的一般組成如圖2-1所示。計算機專業(yè)英語2-6圖2-1所示的系統(tǒng)包括三組總線。最上面的是地址總線。當CPU從存儲器讀取數(shù)據(jù)或指令,或寫數(shù)據(jù)到存儲器時,它必須指明將要訪問的存儲器單元地址。CPU將地址輸出到地址總線上,而存儲器從地址總線上讀取地址,并且用它來訪問正確的存儲單元。每個I/O設備,比如鍵盤、顯示器或者磁盤,同樣都有一個唯一的地址。當訪問某個I/O設備時,CPU將此設備的地址放到地址總線上。每一個設備均從總線上讀取地址并且判斷自己是否就是CPU正要訪問的設備。與其他總線不同,地址總線總是從CPU上接收信息,而CPU從不讀取地址總線。2.1.1SystemBuses計算機專業(yè)英語2-7數(shù)據(jù)是通過數(shù)據(jù)總線傳送的。當CPU從存儲器中取數(shù)據(jù)時,它首先把存儲器地址輸出到地址總線上,然后存儲器將數(shù)據(jù)輸出到數(shù)據(jù)總線上,這樣CPU就可以從數(shù)據(jù)總線上讀取數(shù)據(jù)了。當CPU向存儲器中寫數(shù)據(jù)時,它首先將地址輸出到地址總線上,然后把數(shù)據(jù)輸出到數(shù)據(jù)總線上,這樣存儲器就可以從數(shù)據(jù)總線上讀取數(shù)據(jù)并將它存儲到正確的單元中。對I/O設備讀寫數(shù)據(jù)的過程與此類似。2.1.1SystemBuses計算機專業(yè)英語2-8CPU控制整個計算機。它從存儲器中取指令,提供存儲器需要的地址和控制信號。CPU對指令譯碼并且控制整個執(zhí)行過程。它執(zhí)行一些內部操作,并且為存儲器和I/O設備執(zhí)行指令提供必要的地址、數(shù)據(jù)和控制信號。除非CPU激發(fā),否則,計算機什么事情都不會發(fā)生。2.2CPUORGANIZATION計算機專業(yè)英語2-9CPU內部有三大分區(qū),如圖2-3所示。寄存器區(qū),顧名思義,它包括一組寄存器、一條總線或其他通信機制。微處理器指令集結構中的寄存器就屬于CPU的這一分區(qū)。系統(tǒng)的地址和數(shù)據(jù)總線與寄存器交互。此分區(qū)還包括程序員不能直接訪問的一些寄存器。相對簡單CPU含有寄存器用以鎖存正在訪問的存儲器地址,還有暫存器以及指令集結構中沒有的其他寄存器等。2.2CPUORGANIZATION計算機專業(yè)英語2-10在指令周期的取指階段,處理器首先將指令的地址輸出到地址總線上。處理器有一個寄存器叫做程序計數(shù)器,CPU將下一條要取的指令的地址存放在程序計數(shù)器中。在CPU將地址輸出到系統(tǒng)的地址總線之前,必須從程序計數(shù)器中取出該地址。在指令結束前,CPU從系統(tǒng)時局總線上讀取指令碼,它把該指令碼存儲在某個內部寄存器中,該寄存器通常稱作指令寄存器或其他相似的名字。2.2CPUORGANIZATION計算機專業(yè)英語2-11.算術邏輯單元執(zhí)行大部分的算術邏輯運算,如加法、邏輯與等運算。它從CPU的寄存器取得操作數(shù),然后將運算結果再存回到寄存器區(qū)。由于必須在一個時鐘周期內完成操作,因此ALU只采用組合邏輯構造而成。相對簡單CPU和8085微處理器中的ADD指令在執(zhí)行中都有使用ALU。2.2CPUORGANIZATION計算機專業(yè)英語2-12.同CPU控制整個計算機(除了其他功能外)一樣,控制單元控制著CPU。這個單元產(chǎn)生內部控制信號,促使寄存器裝載數(shù)據(jù),自動加1或清零,輸出它的內容,使得ALU完成正確的操作等等。這些信號作為控制信號顯示在圖2-3中。控制單元從寄存器區(qū)取得一些數(shù)據(jù)用以產(chǎn)生控制信號,這些數(shù)據(jù)包括指令碼和某些標志寄存器的值。2.2CPUORGANIZATION計算機專業(yè)英語2-13
2.2CPUORGANIZATION控制單元也產(chǎn)生系統(tǒng)控制總線上的信號,例如READ,WRATE,信號等。典型的一個微處理器執(zhí)行取指令、譯指令和執(zhí)行指令等一系列的操作。通過以正確的順序激發(fā)這些內部或外部控制信號,控制單元使CPU和計算機的其余部分完成正確處理指令所需要的操作。計算機專業(yè)英語2-142.3MemorySubsystemOrganizationandInterfacingNewWords&Expressions:multibyten.多字節(jié) MBn.兆字節(jié)shutoffn.切斷,關閉 enablen..使能tri-state三態(tài) tri-stated高阻態(tài)dimensionn.尺度,維(數(shù)) configurationn.構造,結構,配置asfaras盡;就;至于 high-order高位low-order低位 interleavingn.交叉,交錯contiguousadj.鄰近的,接近的 assignvt.分配,指派bigendian高位優(yōu)先 littleendian低位優(yōu)先hexadecimaladj.十六進制的;n.十六進制 alignmentn.對齊方式leftmostadj.最左邊的 rightmostadj.最右邊的,最右面的consecutiveadj.連續(xù)的,聯(lián)貫的 cachen.高速緩沖virtualmemory虛擬存儲器 buffern.緩沖器ROM(ReadOnlyMemory)只讀存儲器 RAM(RandomAccessMemory)隨機存取存貯器RISC(ReducedInstructionSetComputer)精簡指令集計算機計算機專業(yè)英語2-152.3MemorySubsystemOrganizationandInterfacingInthissectionweexaminetheconstructionandfunctionsofthememorysubsystemofacomputer.Wereviewthedifferenttypesofphysicalmemoryandtheinternalorganizationoftheirchips.Wediscusstheconstructionofthememorysubsystem,aswellasmultibytewordorganizationsandadvancedmemoryorganizations.本節(jié)我們將討論計算機中存儲器子系統(tǒng)的結構和功能。我們將會回顧不同類型的物理存儲器及其芯片的內部組成,討論存儲器子系統(tǒng)的結構,以及多字節(jié)的組織和高級存儲器的組成。計算機專業(yè)英語2-162.3.1TypesofMemoryTheinternalorganizationsofROMandRAMchipsaresimilar.Toillustratethesimplestorganization,alinearorganization,consideran82ROMchip.Forsimplicity,programmingcomponentsarenotshown.Thischiphasthreeaddressinputsandtwodataoutputs,and16bitsofinternalstoragearrangedaseight2-bitlocations.存儲器芯片有兩種類型:只讀存儲器(ROM)和隨機存取存儲器(RAM)。只讀存儲器芯片是為數(shù)據(jù)(此數(shù)據(jù)可包括程序的指令)只讀的應用而設計的。這些芯片在加入系統(tǒng)之前,就已經(jīng)被某個外部編程器而裝好數(shù)據(jù)了。這個工作一旦完成,其數(shù)據(jù)通常不再改變。ROM芯片總是保存有數(shù)據(jù),甚至在芯片斷電以后。例如,一個微波爐的嵌入式控制器可以連續(xù)運行一個不變的程序。這個程序就存儲在一片ROM上。計算機專業(yè)英語2-17RandomAccessMemory(RAM),alsocalledread/writememory,canbeusedtostoredatathatchanges.ThisisthetypeofmemoryreferredtoasXMBofmemoryinadsforPCs.UnlikeROM,RAMchipslosetheirdataoncepowerisshutoff.Manycomputersystems,includingpersonalcomputers,includebothROMandRAM.2.3.1TypesofMemory隨機訪問存儲器也稱為讀寫存儲器,用來存儲可以改變的數(shù)據(jù)。這就是我們在個人電腦廣告上經(jīng)常看到的XXMB的內存所指的那種類型。不像ROM,RAM芯片一旦掉電,數(shù)據(jù)就會丟失。許多計算機系統(tǒng),包括個人電腦,都同時擁有ROM和RAM。計算機專業(yè)英語2-182.3.2InternalChipOrganizationTheinternalorganizationsofROMandRAMchipsaresimilar.Toillustratethesimplestorganization,alinearorganization,consideran82ROMchip.Forsimplicity,programmingcomponentsarenotshown.Thischiphasthreeaddressinputsandtwodataoutputs,and16bitsofinternalstoragearrangedaseight2-bitlocations.ROM和RAM芯片的內部組成是相似的。為了說明一個最簡單的組成——線性組成,我們來考慮一個82的ROM芯片。為了簡化,編成器件沒有畫出來。這個芯片有三個地址輸入端和兩個數(shù)據(jù)輸出端,以及16位的內部存儲元件,它排列成8個單元,每個單元2位。計算機專業(yè)英語2-19Thethreeaddressbitsaredecodedtoselectoneoftheeightlocations,butonlyifthechipenableisactive.IfCE=0,thedecoderisdisabledandnolocationisselected.Thetri-statebuffersforthatlocation'scellsareenabled,allowingdatatopasstotheoutputbuffers.IfbothCEandOEsetto1,thesebuffersareenabledandthedataisoutputfromthechip;otherwisetheoutputsaretri-stated.2.3.2InternalChipOrganization三個地址位經(jīng)過譯碼,可以選擇8個中的一個,但只有芯片的使能端要有效才行。如果CE=0,譯碼器被禁止,則不選擇任何單元。該單元上的三態(tài)緩沖器是有效的,允許數(shù)據(jù)輸出到緩沖器中。如果CE=1且OE=1,則這些緩沖器有效,數(shù)據(jù)從芯片中輸出;否則,輸出是高阻態(tài)。計算機專業(yè)英語2-20Asthenumberoflocationsincreases,thesizeoftheaddressdecoderneededinalinearorganizationbecomesprohibitivelylarge.Toremedythisproblem,thememorychipcanbedesignedusingmultipledimensionsofdecoding.2.3.2InternalChipOrganization隨著單元數(shù)量的增加,線性組成中地址譯碼器的規(guī)模變得相當大。為了補救這一問題,存儲器芯片可以設計成使用多維譯碼方式。計算機專業(yè)英語2-21Inlargermemorychips,thissavingscanbesignificant.Considera40961chip.Thelinearorganizationwillrequirea12to4096decoder,thesizeofwhichisproportionaltothenumberofoutputs.(Thesizeofannto2ndecoderisthussaidtobeO(2n).)Ifthechipisorganizedasa6464twodimensionalarrayinstead,itwillhavetwo6to64decoders:onetoselectoneofthe64rowsandtheothertoselectoneofthe64cellswithintherow.Thesizeofthedecodersisproportionalto264,orO(22n/2)=O(2n/2+1).Forthischip,thetwodecoderstogetherareabout3percentofthesizeoftheonelargerdecoder.2.3.2InternalChipOrganization在大型存儲器芯片中,這種節(jié)省顯得至關重要。考慮一個40961芯片,其線性組成將需要一個12—4096譯碼器,譯碼器大小與輸出的數(shù)量成正比(假定一個n—2n譯碼器的大小是O(2n))。如果芯片排列成6464的二維數(shù)組,它將有兩個6—64譯碼器:一個用來選擇64行中的一行,另一個用來在選定行中選擇64個單元中的一個單元,該譯碼器的大小正比于264,或寫成O(22n/2)=O(2n/2+1)。對于這個芯片,兩個譯碼器總的大小約是那個大譯碼器大小的3%。計算機專業(yè)英語2-222.3.3MemorySubsystemConfigurationItisveryeasytosetupamemorysystemthatconsistsofasinglechip.Wesimplyconnecttheaddress,data,andcontrolsignalsfromtheirsystembusesandthejobisdone.However,mostmemorysystemsrequiremorethanonechip.Followingaresomemethodsforcombiningmemorychipstoformamemorysubsystem.構造包含一個簡單芯片的存儲器是非常容易的,我們只需要簡單地從系統(tǒng)總線上連接地址信號線、數(shù)據(jù)信號線和控制信號線就完成了。然而。大多數(shù)的存儲器系統(tǒng)需要多個芯片,下面是通過存儲器芯片組合來形成存儲器子系統(tǒng)的一些方法。計算機專業(yè)英語2-232.3.3MemorySubsystemConfigurationTwoormorechipscanbecombinedtocreatememorywithmorebitsperlocation.Thisisdonebyconnectingthecorrespondingaddressandcontrolsignalsofthechips,andconnectingtheirdatapinstodifferentbitsofthedatabus.Forexample,two82chipscanbecombinedtocreatean84memory,asshowninFigure2-4.Bothchipsreceivethesamethreeaddressinputsfromthebus,aswellasthesamechipenableandoutputenablesignals.(Fornowitisonlyimportanttoknowthatthesignalsarethesameforbothchips;weshowthelogictogeneratethesesignalsshortly.)Thedatapinsofthefirstchipareconnectedtobits3and2ofthedatabus,andthoseoftheotherchipareconnectedtobits1and0.兩個或多個芯片可以組合起來構造一個每單元有多位的存儲器。這可以通過連接芯片相應的地址信號線和控制信號線,并將它們的數(shù)據(jù)引腳連到數(shù)據(jù)總線的不同位上來完成。例如,2個82芯片可以組合產(chǎn)生一個84存儲器,如圖2-4所示。兩個芯片從總線上接收相同的三位地址輸入,還有共同的芯片使能信號和輸出使能信號(目前,我們只要了解兩個芯片使用的是同一信號就可以了,稍后我們將說明產(chǎn)生這些信號的邏輯)。第一個芯片的數(shù)據(jù)引腳連到數(shù)據(jù)總線的第3位和第2位,第二個芯片的數(shù)據(jù)引腳則連在第1位和第0位。計算機專業(yè)英語2-242.3.3MemorySubsystemConfigurationWhentheCPUreadsdata,itplacestheaddressontheaddressbus.BothchipsreadinaddressbitsA2,A1,andA0andperformtheirinternaldecoding.IftheCEandOEsignalsareactivated,thechipsoutputtheirdataontothefourbitsofthedatabus.Sincetheaddressandenablesignalsarethesameforbothchips,eitherbothchipsorneitherchipisactiveatanygiventime.Thecomputerneverhasonlyoneofthetwoactive.Forthisreason,theyactjustasasingle84chip,atleastasfarastheCPUisconcerned.當CPU讀取數(shù)據(jù)時,它將地址放在地址總線上。兩個芯片讀取地址位A2、A1、A0,并執(zhí)行內部譯碼操作。如果CE和OE信號是有效的,兩個芯片則輸出數(shù)據(jù)到數(shù)據(jù)總線的四位上。因為兩個芯片的地址和使能信號是相同的,因此在任一時刻兩個芯片要么同時有效,要么同時無效。正因如此,它們的行為就像一個單一的84芯片,至少就CPU而言是這樣的。計算機專業(yè)英語2-252.3.3MemorySubsystemConfigurationInsteadofcreatingwiderwords,chipscanbecombinedtocreatemorewords.Thesametwo82chipscouldinsteadbeconfiguredasa162memorysubsystem.ThisisillustratedinFigure2-5(a).Theupperchipisconfiguredasmemorylocations0to7(0000to0111)andthelowerchipaslocations8to15(1000to1111).TheupperchipalwayshasA3=0andthelowerchiphasA3=1.Thisdifferenceisusedtoselectoneofthetwochips.WhenA3=0,theupperchipisenabledandthelowerchipisdisabled;whenA3=1,theoppositeoccurs.(Asshowninthefigure,otherconditionsmustalsooccurorneitherchipwillbeselected.)Theoutputenablescanbeconnected,sinceonlythechipthatisenabledwilloutputdata.Sincebothchipscorrespondtothesamedatabits,bothareconnectedtoD1andD0ofthedatabus.除了構造更寬的字以外,芯片組合還可以構造出更多的字。兩樣的兩個82芯片能夠組成一個162存儲子系統(tǒng)。如圖2-5所示。上面的芯片構成存儲器的0到7(0000到0111)單元,下面的芯片作為單元8到15(1000到1111)。上面的芯片總是設置A3=0,而下面的芯片A3=1。通過這一區(qū)別來選擇芯片,當A3=0時,上面的芯片有效,而下面的芯片無效;當A3=1時,情況剛好相反。(如圖所示。另一種情況必定會發(fā)生,否則沒有芯片被選中。)輸出使能端需要連接起來,因為只有芯片有效才可以輸出數(shù)據(jù)。由于兩個芯片對應相同的數(shù)據(jù)位,因此都可以連接到數(shù)據(jù)總線的D1和D0位上。計算機專業(yè)英語2-262.3.3MemorySubsystemConfigurationThisconfigurationuseshigh-orderinterleaving.Allmemorylocationswithinachiparecontiguouswithinsystemmemory.However,thisdoesnothavetobethecase.ConsidertheconfigurationshowninFigure2-5(b),whichuseslow-orderinterleaving.TheupperchipisenabledwhenA0=0,orbyaddressesXXX0,inthiscase0,2,4,6,8,10,12,and14.ThelowerchipisenabledwhenA0=1,whichistrueforaddressesl,3,5,7,9,11,13,and15.BothlookthesametotheCPU,butlow-orderinterleavingcanoffersomespeedadvantagesforpipelinedmemoryaccess,andforCPUsthatcanreaddatafrommorethanonememorylocationsimultaneously.這種配置使用的是高位交叉技術。同一芯片的所有存儲單元在系統(tǒng)內存中是連續(xù)的。然而,不一定非得如此??紤]如圖2-5(b)所示的情況,它用的是低位交叉技術。上面的芯片當A0=0或者當?shù)刂肺粸閄XX0時有效,此時,地址為0、2、4、6、8、10和12;下面的芯片當A0=1時有效,條件是地址為1、3、5、7、9、11、13和15。對CPU而言,兩者是相同的。但低位交叉能為流水線存儲器訪問提供速度上的優(yōu)勢,對于能夠同時從多于一個存儲器單元中讀取數(shù)據(jù)的CPU來說,低位交叉也存在速度上的優(yōu)勢。計算機專業(yè)英語2-272.3.3MemorySubsystemConfigurationThenextstepinthesedesignsistodeveloptheCEandOEinputlogic.Ofthese,theoutputenableismorestraightforward.TheCPUgenerallyoutputsacontrolsignalcalledRDorRD',orsomethingsimilar,whichitsetsactivewhenitwantstoreaddatafrommemory.ThissignalissufficienttodriveOE;thelogictodriveCEensuresthatonlythecorrectchipoutputsdata.設計的下一步就是指制定CE和OE的輸入邏輯。輸出使能更直接一些,CPU通常輸出一個控制信號,稱作RD或RD'或別的什么,當它想要從主存讀取數(shù)據(jù)時就將其設為有效,用此信號驅動OE就足夠了,而驅動CE的邏輯務必確保只有正確的芯片方可輸出數(shù)據(jù)。計算機專業(yè)英語2-282.3.3MemorySubsystemConfigurationThechipenablesignalmakesuseoftheunusedaddressbits.Toillustrate,assumethatthe84memoryofFigure2-4isusedinasystemwith6-bitaddressbus.Furthermore,assumethischipcorrespondstolocations0to7(000000to000111).AddressbitsA2,A1,andA0selectalocationwithinthememorychips;bitsA5,A4,andA3mustbe000forthechipstobeactive.芯片使能信號可利用未使用的地址位。為了說明這一點,假設圖2-4中的84存儲器被用到一個6位地址總線的系統(tǒng)中,而且,進一步假設這個芯片對應的單元為0到7(00000到000111)。則地址位A2、A1和A0可以用于選中存儲芯片中的某個單元,而A5、A4和A3在芯片有效時一定要是000。計算機專業(yè)英語2-292.3.4MultibyteDataOrganization
Manydataformatsusemorethanone8-bitbytetorepresentavalue,whetheritisaninteger,floatingpointnumber,orcharacterstring.MostCPUsassignaddressesto8-bitmemorylocations,sothesevaluesmustbestoredinmorethanonelocation.ItisnecessaryforeveryCPUtodefinetheorderitexpectsforthedataintheselocations.許多數(shù)據(jù)格式使用多個字節(jié)(一個字節(jié)8位)來表示一個數(shù)據(jù),而不管此數(shù)值是整型數(shù)、浮點數(shù)還是字符串。由于大多數(shù)CPU給8位的存儲器單元分配地址,因此這些值必須存儲在多個單元中,每個CPU必須定義數(shù)據(jù)在這些單元中的順序。計算機專業(yè)英語2-302.3.4MultibyteDataOrganization
Therearetwocommonlyusedorganizationsformultibytedata:bigendianandlittleendian.Inbigendianformat,themostsignificantbyteofavalueisstoredinlocationX,thefollowingbyteinlocationX+l,andsoon.Forexample,thehexadecimalvalue01020304H(Hforhexadecimal)wouldbestored,startinginlocation100H,asshowninTable2-1(a).有兩種常用的多字節(jié)數(shù)據(jù)排列順序:高位優(yōu)先和低位優(yōu)先。依照高位優(yōu)先格式,一個數(shù)值的最高字節(jié)存儲在單元X中,次高字節(jié)存儲在單元X+1中,依次類推。例如,十六進制數(shù)01020304H(H表示十六進制)從單元100h開始存儲,則存儲結果如表2-1(a)所示。計算機專業(yè)英語2-312.3.4MultibyteDataOrganization
Inlittleendian,theorderisreversed.TheleastsignificantbyteisstoredinlocationX,thenextbyteinlocationX+1,andsoon.Thesamevalue,inlittleendianformat,isshowninTable2-1(b).依照低位優(yōu)先格式,順序正好相反。最低字節(jié)存儲在單元X中,次字節(jié)存儲在單元X+1中,依次類推。上例中的同一值,以低位優(yōu)先格式存儲,如表2-1(b)所示。計算機專業(yè)英語2-322.3.4MultibyteDataOrganization
Thesameorganizationscanbeusedforbitswithinabyte.Inbigendianorganization,bit0istherightmostbitofabyte:theleftmostbitisbit7.Inlittleendianorganization,theleftmostbitisbit0andbit7istherightmostbit.同樣的組織方式可用于一個字節(jié)中的不同位上。在高位優(yōu)先結構中,位0代表字節(jié)中最右邊的位,最左邊的位是第7位。在低位優(yōu)先結構中,最左邊的位是0,最右邊的位是7。計算機專業(yè)英語2-332.3.4MultibyteDataOrganization
WhichendianorganizationisusedforbytesandwordsdoesnotimpacttheperformanceoftheCPUandcomputersystem.AslongastheCPUisdesignedtohandleaspecificformat,neitherisbetterthantheother.Themainproblemcomesintransferringdatabetweencomputerswithdifferentendianorganizations.Forexample,ifacomputerwithlittleendianorganizationtransfersthevalue01020304Htoacomputerwithbigendianorganizationwithoutconvertingthedata,thebigendiancomputerwillreadthevalueas04030201H.Thereareprogramswhichcanconvertdatafilesfromoneformattotheother,andsomemicroprocessorshavespecialinstructionstoperformtheconversion.對于字節(jié)和字而言,無論使用哪一種排列組織方式都不會影響CPU和計算機系統(tǒng)的性能。只要設計CPU處理一種特定的格式,就不存在誰比誰強的問題,主要的問題在于具有不同排列組織方式的CPU之間傳輸數(shù)據(jù)的問題,例如,如果一個低位優(yōu)先結構的計算機傳輸01020304H的數(shù)據(jù)給一個高位優(yōu)先結構的計算機,而沒有轉換數(shù)據(jù),那么該高位優(yōu)先結構計算機讀出的值為04030201H。有程序可以將兩種時局文件進行格式轉換,并且某些處理器有特殊的指令可以執(zhí)行這種轉換。計算機專業(yè)英語2-342.3.4MultibyteDataOrganization
Oneotherissueofconcernformultibytewordsisalignment.Modernmicroprocessorscanreadinmorethanonebyteofdataatatime.Forexample,theMotorola68040microprocessorcanreadinfourbytessimultaneously.However,thefourbytesmustbeinconsecutivelocationsthathavethesameaddressexceptforthetwoleastsignificantbits.ThisCPUcouldreadlocations100,101,102,and103simultaneously,butnotlocations101,102,103,and104.Thiscasewouldrequiretworeadoperations,oneforlocations100(notneeded),101,102,and103,andtheotherfor104,105(notneeded),106(notneeded),and107(notneeded).多字節(jié)的另一個值得關注的問題是對齊問題?,F(xiàn)代微處理器在某一時刻可以讀出多個字節(jié)。例如,摩托羅拉68040微處理器能同時讀入4個字節(jié)的數(shù)據(jù),然而,這4個字節(jié)必須在連續(xù)的單元中,它們的地址除了最低兩位不同之外,其余的位均相同。該CPU可以同時讀單元100、101、102和103,但不能同時讀單元101、102、103和104,后者需要兩個讀操作,一個操作讀100(不需要的)、101、102和103,另一個讀104、105(不需要的)、106(不需要的)和107(不需要的)。計算機專業(yè)英語2-352.3.4MultibyteDataOrganization
Alignmentsimplymeansstoringmultibytevaluesinlocationssuchthattheybeginatalocationthatalsobeginsamultibytereadblock.Inthisexample,thismeansbeginningmultibytevaluesatmemorylocationsthathaveaddressesevenlydivisiblebyfour,thusguaranteeingthatafour-bytevaluecanbeaccessedbyasinglereadoperation.對齊簡單地說就使存儲多字節(jié)值的起始單元剛好是某個多字節(jié)讀取模塊的開始單元。在這個例子中,意味著多字節(jié)值開始存儲的單元的地址要能被4整除,這樣就保證該4字節(jié)值可在單一的一個讀操作中存取到。計算機專業(yè)英語2-362.3.4MultibyteDataOrganization
SomeCPUs,particularlyRISCCPUs,requirealldatatobealigned.OtherCPUsdonot;theycanusuallyaligndatainternally.Ingeneral,nonalignedCPUshavemorecompactprograms,becausenolocationsareleftunusedbyalignment.However,alignedCPUscanhavebetterperformancebecausetheymayneedfewermemoryreadoperationstofetchdataandinstructions.一些CPU,特別是精簡指令系統(tǒng)CPU,需要所有的數(shù)據(jù)都對齊。其它的CPU不要求這樣,它們通常能夠在內部將數(shù)據(jù)對齊。一般來說,不要求對齊的CPU具有更緊湊的程序,因為沒有單元因為要對齊而閑置不用。然而,對齊的CPU具有更好的性能,因為他們讀取指令和數(shù)據(jù)是需要更少的存儲器讀操作。計算機專業(yè)英語2-372.3.5BeyondtheBasics(基本功能的拓展)Thememorysubsystemdescribedinthischapterissufficientforsmall,embeddedcomputers.Personalcomputersandmainframes,however,requiremorecomplexhierarchicalconfigurations.Thesecomputersincludesmall,high-speedcachememory.Thecomputerloadsdatafromthephysicalmemoryintothecache;theprocessorcanaccessdatainthecachemorequicklythanitcanaccessthesamedatainphysicalmemory.Manymicroprocessorsincludesomecachememoryrightontheprocessorchip.Acomputerthatincludescachememorymustalsohaveacachecontrollertomovedatabetweenthecacheandphysicalmemory.本章描述的存儲器子系統(tǒng)對于較小的、嵌入式計算機而言是足夠的。然而,個人電腦和大型主機,需要更加復雜的層次結構。這些計算機包含體積小的、高速的高速緩沖存儲器。計算機將數(shù)據(jù)從物理存儲器中裝載到高速緩沖中:處理器在高速緩沖中訪問數(shù)據(jù)比在物理存儲器中快得多。許多微處理器就在處理器芯片中含有一些高速緩沖存儲器。含有高速緩沖存儲器的計算機同時也要有一個高速緩沖控制器,用來在高速緩沖和物理存儲器間傳輸數(shù)據(jù)。計算機專業(yè)英語2-38
2.3.5BeyondtheBasicsAttheotherextreme,moderncomputersincludevirtualmemory.Thismechanismusesaharddiskasapartofthecomputer'smemory,expendingthememoryspaceofthecomputerwhileminimizingcost,sinceabyteofharddiskcostslessthanabyteofRAM.Aswiththecache,virtualmemoryneedsacontrollertomovedatabetweenphysicalmemoryandtheharddisk.在另一端,現(xiàn)代計算機還具有一個虛擬存儲器。這種機制用硬盤充當計算機存儲器的一部分,擴大了計算機的存儲空間,而且降低了價格,因為一個硬盤字節(jié)的價格比一個RAM字節(jié)要便宜的多。同高速緩沖一樣,虛擬存儲器也需要一個控制器以便在物理存儲器和虛擬存儲器之間傳輸數(shù)據(jù)。計算機專業(yè)英語2-392.4I/OSubsystemOrganizationandInterfacingNewWords&Expressions:homogeneousadj.同類的,均一的 circuitryn.電路,線路headn.磁頭 waitstate等待狀態(tài)interrupt中斷DMA=DirectMemoryAccess直接存儲器訪問 計算機專業(yè)英語2-402.4I/OSubsystemOrganizationandInterfacingTheCPUtreatsmemoryashomogeneous.FromtheCPU'sperspective,eachlocationisreadfromandwrittentoinexactlythesameway.Eachmemorylocationperformsthesamefunction--itstoresadatavalueoraninstructionforusebytheCPU.CPU把存儲器看作是同構的。從CPU的角度來看,每一個單元的讀操作和寫操作都是一樣的,每一個單元執(zhí)行同樣的功能,即存儲CPU使用的數(shù)據(jù)或指令。Input/output(I/O)devices,ontheotherhand,areverydifferent.Apersonalcomputer'skeyboardandharddiskperformvastlydifferentfunctions,yetbotharepartoftheI/Osubsystem.Fortunatelyforthesystemdesigner,theinterfacesbetweentheCPUandtheI/Odevicesareverysimilar.另一方面,輸入/輸出設備是很不一樣的。個人電腦的鍵盤和硬盤執(zhí)行的是千差萬別的功能,但它們同是I/O子系統(tǒng)的一部分。對系統(tǒng)設計者而言,幸運的是CPU和各I/O設備之間的接口是非常相似的。計算機專業(yè)英語2-412.4I/OSubsystemOrganizationandInterfacingAsshowninFigure2-1,eachI/Odeviceisconnectedtothecomputersystem'saddress,data,andcontrolbuses.EachI/OdeviceincludesI/Ointerfacecircuitry;itisactuallythiscircuitrythatinteractswiththebuses.ThecircuitryalsointeractswiththeactualI/Odevicetotransferdata.如圖2-1所示,每一個I/O設備與計算機系統(tǒng)的地址總線、數(shù)據(jù)總線和控制總線相連接,它們都包括I/O接口電路,與總線交互的實際上正是這一電路,同時它與實際的I/O設備交互來傳輸數(shù)據(jù)。計算機專業(yè)英語2-422.4I/OSubsystemOrganizationandInterfacingFigure2-7showsthegenericinterfacecircuitryforaninputdevice,suchasakeyboard.Thedatafromtheinputdevicegoestothetri-statebuffers.Whenthevaluesontheaddressandcontrolbusesarecorrect,thebuffersareenabledanddatapassesontothedatabus.TheCPUcanthenreadinthisdata.Whentheconditionsarenotright,thelogicblockdoesnotenablethebuffers;theyaretri-statedanddonotplacedataontothebus.圖2-7顯示了一個輸入設備(比如鍵盤)的一般接口電路。從輸入設備來的數(shù)據(jù)傳送到三態(tài)緩沖器,當?shù)刂房偩€和控制總線上的值正確時,緩沖器設為有效,數(shù)據(jù)傳到數(shù)據(jù)總線上,然后CPU可以讀取數(shù)據(jù)。當條件不正確時,邏輯塊不會使緩沖器有效,它們保持高阻態(tài),而且不把數(shù)據(jù)傳到總線上。計算機專業(yè)英語2-432.4I/OSubsystemOrganizationandInterfacingThekeytothisdesignistheenablelogic.Justaseverymemorylocationhasauniqueaddress,eachI/Odevicealsohasauniqueaddress.Theenablelogicmustnotenablethebuffersunlessitreceivesthecorrectaddressfromtheaddressbus.Itmustalsogetthecorrectcontrolsignalsfromthecontrolbus.Foraninputdevice,anRD(orRD')signalmustbeasserted(aswellastheIO/signal,orequivalent,insystemswithisolatedI/O).這一設計的關鍵在于使能邏輯。正如每一個存儲單元都有一個惟一的地址一樣,每一個I/O設備也有一個惟一的地址。除非從地址總線得到了正確的地址,否則使能邏輯不置緩沖器有效。同時,它還必須從控制總線上得到正確的控制信號。對于一個輸入設備,RD(或者RD')信號必須有效(在獨立系統(tǒng)中,還有信號,或其他等效的信號)。計算機專業(yè)英語2-442.4I/OSubsystemOrganizationandInterfacingThedesignoftheinterfacecircuitryforanoutputdevice,suchasacomputermonitor,issomewhatdifferentthanthatfortheinputdevice.AsshowninFigure2-8,thetri-statebuffersarereplacedbyaregister.Thetri-statebuffersareusedininputdeviceinterfacestomakesurethatnomorethanonedevicewritesdatatothebusatanytime.Sincetheoutputdevicesreaddatafromthebus,ratherthatwritedatatoit,theydon'tneedthebuffers.Thedatacanbemadeavailabletoalloutputdevices;onlythedevicewiththecorrectaddresswillreaditin.輸出設備(如顯示器)接口電路的設計與輸入設備的設計有所不同。如圖2-8所示,寄存器代替了三態(tài)緩沖器。輸入設備中使用三態(tài)緩沖器是為了確保在任何時刻都只有一個設備向總線寫數(shù)據(jù),而輸出設備是從總線讀取數(shù)據(jù),不是寫數(shù)據(jù),因此不需要緩沖器。數(shù)據(jù)對于所有的輸出設備都可獲得,但只有具有正確地址的設備才會讀取它。計算機專業(yè)英語2-452.4I/OSubsystemOrganizationandInterfacingTheloadlogicplaystheroleoftheenablelogicintheinputdeviceinterface.Whenthislogicreceivesthecorrectaddressandcontrolsignals,itassertstheLDsignaloftheregister,causingittoreaddatafromthesystem'sdatabus.TheoutputdevicecanthenreadthedatafromtheregisteratitsleisurewhiletheCPUperformsothertasks.裝載邏輯發(fā)揮著輸入設備接口中使能邏輯的作用。當此邏輯獲得正確的地址信號和控制信號后,它發(fā)出寄存器的LD信號,促使它從系統(tǒng)數(shù)據(jù)總線上讀取數(shù)據(jù)。然后輸出設備可以在其空閑的時候從寄存器中讀取該數(shù)據(jù),同時CPU可以執(zhí)行其他的任務。計算機專業(yè)英語2-462.4I/OSubsystemOrganizationandInterfacingAvariantofthisdesignreplacestheregisterwithtri-statebuffers.Thesamelogicusedtoloadtheregisterisusedtoenablethetri-statebuffersinstead.Althoughthiscanworkforsomedesigns,theoutputdevicemustreadindatawhilethebuffersareenabled.Oncetheyaredisabled,theoutputsofthebuffersaretri-statedandthedataisnolongeravailabletotheoutputdevice.該設計也可以用三態(tài)緩沖器代替寄存器。裝載寄存器的邏輯同樣用于使能三態(tài)緩沖器。雖然對于某些設計這是可行的,但是輸出設備必須在緩沖器有效時讀入數(shù)據(jù)。一旦緩沖器被禁止,其輸出就是三態(tài),該數(shù)據(jù)也就不再能夠供輸出設備使用。計算機專業(yè)英語2-472.4I/OSubsystemOrganizationandInterfacingSomedevicesareusedforbothinputandoutput.Apersonalcomputer'sharddiskdrivefallsintothiscategory.Suchadevicerequiresacombinedinterfacethatisessentiallytwointerfaces,oneforinputandtheotherforoutput.Somelogicelements,suchasthegatesthatchecktheaddressontheaddressbus,canbeusedtogenerateboththebufferenableandregisterloadsignals有些設備既用于輸入又用于輸出,個人電腦中的硬盤驅動器就屬于這一類。這樣的設備需要一個組合接口,本質上是兩個接口,一個用于輸入,另一個用于輸出。一些邏輯元件(比如檢查地址總線上的地址是否正確的門電路)既可以用來產(chǎn)生緩沖器的使能信號,有可以用來產(chǎn)生寄存器的裝載信號。計算機專業(yè)英語2-482.4I/OSubsystemOrganizationandInterfacingI/OdevicesaremuchslowerthanCPUsandmemory.Forthisreason,theycanhavetimingproblemswheninteractingwiththeCPU.Toillustratethis,considerwhathappenswhenaCPUwantstoreaddatafromadisk.Itmaytakethediskdriveseveralmillisecondstopositionitsheadsproperlytoreadthedesiredvalue.Inthistime,theCPUcouldhavereadininvaliddataandfetched,decoded,andexecutedthousandsofinstructions.I/O設備比CPU和存儲器慢得多。基于這個原因,當它們與CPU交互時,就可能存在時序上的問題。為了說明這一點,考慮當CPU想要從硬盤中讀取數(shù)據(jù)時會發(fā)生的情況,這可能要消耗磁盤驅動器幾個毫秒來正確的定位磁頭,以便讀取想要的數(shù)值,而在這段時間里,CPU可能已經(jīng)讀入了不正確的數(shù)據(jù),并且讀取、譯解和執(zhí)行了成千上萬條指令。計算機專業(yè)英語2-492.4I/OSubsystemOrganizationandInterfacingMostCPUshaveacontrolinputsignalcalledREADY(orsomethingsimilar).Normallythisinputishigh.WhentheCPUoutputstheaddressoftheI/Odeviceandthecorrectcontrolsignals,enablingthetri-statebuffersoftheI/Odeviceinterface,theI/OdevicesetsREADYlow.TheCPUreadsthissignalandcontinuestooutputthesameaddressandcontrolsignals,whichcausethebufferstoremainenabled.Intheharddiskdriveexample,thedriverotatesthediskandpositionsitsreadheadsuntilitreadsthedesireddata.大多數(shù)CPU都有一個控制輸入信號,叫做就緒信號(READY)(或其他意思相近的名稱),通常它為高電平。當CPU輸出某I/O設備的地址和正確的控制信號,促使I/O設備接口的三態(tài)緩沖器有效時,該I/O設備置READY信號為低電平。CPU讀取這一信號,并且繼續(xù)輸出同樣的地址信號和控制信號,使緩沖器保持有效。在硬盤驅動器的例子中,此時驅動器旋轉磁頭,并且定位讀寫頭,直到讀到想要要的數(shù)據(jù)為止。計算機專業(yè)英語2-502.4I/OSubsystemOrganizationandInterfacingTheCPUthenreadsthedatafromthebusandcontinuesitsnormaloperation.TheextraclockcyclesgeneratedbyhavingREADYsetlowarecalledwaitstates.CPUscanalsousetheREADYsignaltosynchronizedatatransferswiththememorysubsystem.然后它通過緩沖器將數(shù)據(jù)輸出到數(shù)據(jù)總線上,并重新設置READY為高電平。這時CPU才從總線上讀入數(shù)據(jù),之后繼續(xù)它的正確操作。設置READY為低電平而生成的附加時鐘周期叫做等待狀態(tài)。CPU同樣也可以使用READY信號來同步與存儲器子系統(tǒng)之間的數(shù)據(jù)傳輸。計算機專業(yè)英語2-512.4I/OSubsystemOrganizationandInterfacingTheseI/Ointerfacesarefineforsmallcomputers,suchasthemicrowaveovencontroller,buttheysufferfrompoorperformanceinlargercomputersystems.Inallbutthesmallestsystems,itisnotacceptablefortheCPUtohavetowaitthousandsofclockcyclesfordatafromanI/Odevice.ManysystemsuseinterruptssotheycanperformusefulworkwhilewaitingforthemuchslowerI/Odevices.這些I/O接口對于小型的計算機而言已經(jīng)很好了,比如說微波爐控制器,但是在大型的計算機系統(tǒng)中它們的性能則很差。在除最小系統(tǒng)以外的所有系統(tǒng)中,讓CPU等待成千上萬個時鐘周期方從I/O設備中得到數(shù)據(jù)是不能接收的,為此,許多系統(tǒng)都使用了中斷機制,以便CPU在等待慢得多的I/O設備時,可以執(zhí)行其他有用的工作。計算機專業(yè)英語2-522.4I/OSubsystemOrganizationandInterfacingTheseI/Ointerfacesarealsonotsuitedtolargedatatransfers.Inthesystemsinthischapter,eachbyteofdatatransferredbetweenanI/OdeviceandmemorymustpassthroughtheCPU.Thisisinefficientformanycommonoperations,suchasloadingaprogramfromdiskintomemor
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 廣東省實驗中學廣州市天河區(qū)附屬實驗學校2021-2022學年八年級下學期期中物理試題(含答案)
- 基層中醫(yī)藥知識培訓課件
- (一模)哈三中2025屆高三第一次模擬考試 英語試題(含答案)
- 物業(yè)管理服務委托及管理費支付協(xié)議
- 安東尼奇妙的冒險故事讀后感
- 項目執(zhí)行工作計劃書與時間表安排
- 山西省晉中市太谷區(qū)職業(yè)中學校2024-2025學年高一上學期期末考試生物試題
- 企業(yè)文件保密制度表格化處理記錄
- 三農問題社會調查方法與技術指導書
- 離職員工知識產(chǎn)權保密協(xié)議
- DB3410T 34-2024特定地域單元生態(tài)產(chǎn)品價值核算規(guī)范
- 無人機操控技術 課件全套 項目1-6 緒論-無人機自動機場
- 江蘇紅豆實業(yè)股份有限公司償債能力分析
- 青島中石化輸油管道爆炸事故調查報告
- 2024年蘇州職業(yè)大學高職單招(英語/數(shù)學/語文)筆試歷年參考題庫含答案解析
- 充電樁采購安裝投標方案(技術方案)
- 教科版小學科學六年級下冊單元練習試題及答案(全冊)
- 《Java程序設計》電子課件
- 乳腺癌患者的疼痛護理課件
- 研課標說教材修改版 八年級下冊
- 江西宜春城市文化介紹
評論
0/150
提交評論