您好,欢迎访问三七文档
P3U1AComputerStructureandFunction计算机结构与功能ComputerStructureandFunctionThissectionintroducestheinternalarchitectureofacomputeranddescribeshowinstructionsarestoredandinterpretedandexplainshowtheinstructionexecutioncycleisbrokendownintoitsvariouscomponents.计算机的结构与功能这一节介绍计算机的内部体系结构,描述了指令如何存储和译码,并解释了指令执行周期怎样分解成不同的部分。P3U1AComputerStructureandFunction计算机结构与功能Atthemostbasiclevel,acomputersimplyexecutesbinary-codedinstructionsstoredinmemory.Theseinstructionsactuponbinary-codeddatatoproducebinary-codedresults.Forageneral-purposeprogrammablecomputer,fournecessaryelementsarethememory,centralprocessingunit(CPU,orsimplyprocessor),anexternalprocessorbus,andaninput/outputsystemasindicatedinFig.3-lA-1.Thememorystoresinstructionsanddata.从最基本的水平来讲,计算机简单执行存储在存储器中的二进制编码指令。这些指令按照二进制编码数据来产生二进制编码结果。对于通用可编程计算机,四个必要部件是存储器、中央处理单元(CPU,或简称处理器),外部处理器总线,输入/输出系统。存储器储存指令和数据。P3U1AComputerStructureandFunction计算机结构与功能TheCPUreadsandinterpretstheinstructions,readsthedatarequiredbyeachinstruction,executestheactionrequiredbytheinstruction,andstorestheresultsbackinmemory.OneoftheactionsthatisrequiredoftheCPUistoreaddatafromorwritedatatoanexternaldevice.Thisiscarriedoutusingtheinput/outputsystem.Theexternalprocessorbusisasetofelectricconductorsthatcarriesdata,address,andcontrolinformationbetweentheothercomputerelements.CPU读取和解释指令,读每条指令所需的数据,执行指令所需的操作,将结果存回存储器。CPU所需的操作之一是从外部设备读取或写入数据。这利用输入/输出系统来实现。外部处理器总线是一套能在其他计算机部件之间传送数据、地址和控制信息的电导线。P3U1AComputerStructureandFunction计算机结构与功能TheMemoryThememoryofacomputerconsistsofasetofsequentiallynumberedlocations.Eachlocationisaregisterinwhichbinaryinformationcanbestored.Thenumberofalocationiscalleditsaddress.Thelowestaddressis0.Themanufacturerdefinesawordlengthfortheprocessorthatisanintegralnumberoflocationslong.存储器计算机的存储器是由一套连续编号的单元所组成。每个存储单元是一个能存二进制信息的寄存器。单元的编号称为地址。初始地址为0。制造商定义处理器的一个字长为单元的整数长。P3U1AComputerStructureandFunction计算机结构与功能Ineachwordthebitscanrepresenteitherdataorinstructions.FortheIntel8086/87andMotorolaMC68000microprocessors,awordis16bitslong,buteachmemorylocationhasonly8bitsandthustwo8-bitlocationsmustbeaccessedtoobtaineachdataword.在每个字中,各位表示数据或指令。对于英特尔8086/87和摩托罗拉MC68000微处理器来说,一个字是16位长,但每个存储单元仅为8位,因此两个8位单元来存取获得一个数据字长。P3U1AComputerStructureandFunction计算机结构与功能Inordertousethecontentsofmemory,theprocessormustfetchthecontentsoftherightlocation.Tocarryoutafetch,theprocessorplaces(enables)thebinary-codedaddressofthedesiredlocationontotheaddresslinesoftheexternalprocessorbus.Thememorythenallowsthecontentsoftheaddressedmemorylocationtobereadbytheprocessor.Theprocessoffetchingthecontentsofamemorylocationdoesnotalterthecontentsofthatlocation.为了使用存储器中的内容,处理器必须读取正确的内容。为了完成这一次读取,处理器把所需单元的二进制编码地址放到外部处理器地址总线的地址线上,然后,存储器允许处理器读取所寻址的存储单元的内容。读取存储单元的内容的这一过程并不改变该单元的内容。P3U1AComputerStructureandFunction计算机结构与功能InstructionsinMemoryInstructionsstoredinmemoryarefetchedbytheCPUandunlessprogrambranchesoccur,theyareexecutedinthesequencetheyappearinmemory.Aninstructionwrittenasabinarypatterniscalledamachine-languageinstruction.OnewaytoachievemeaningfulpatternsistodivideupthebitsintofieldsasindicatedinFig.3-1A-2,witheachfieldcontainingacodeforadifferenttypeofinformation.存储器中的指令存储器中的指令由CPU取来。除非发生程序转移,它们按在存储器中出现的顺序来执行。用二进制形式所写的指令叫做机器语言指令。一种得到(指令)有效形式的方法是将(这些)位分成段,如图3-4A-2所示。每一段都包含一个不同类型信息的代码。P3U1AComputerStructureandFunction计算机结构与功能Eachinstructioninoursimplecomputercanbedividedupintofourfieldsof4bitseach.Eachinstructioncancontainoperationcode(oropcode,eachinstructionhasauniqueopcode),operandaddress,immediateoperands,Branchaddress.在简单的计算机中,每条指令可分为四段,每段有四位。每条指令包括操作代码(或操作码,每条指令有唯一的操作码)、操作数地址、立即操作数、转换地址。P3U1AComputerStructureandFunction计算机结构与功能Inarealinstructionsettherearemanymoreinstructions.Thereisalsoamuchlargernumberofmemorylocationsinwhichtostoreinstructionsanddata.Inordertoincreasethenumberofmemorylocations,theaddressfieldsandhencetheinstructionsmustbelongerthan16bitsifweusethesameapproach.Thereareanumberofwaystoincreasetheaddressingrangeofthemicroprocessorwithoutincreasingtheinstructionlength:variableinstructionfields,multiwordinstructions,multipleaddressingmodes,variableinstructionlength.Wewillnotdiscussthemindetail.在一个实际的指令集中,有很多指令。也有大量的存储单元来存储指令和数据。为了增加存储单元的数目,如果我们使用同样的方法,地址段的指令一定长于16位。除了增加指令长度外,还有很多增加微处理器寻址范围的方法:可变指令段、多字指令、多寻址模式,可变指令长度。我们不详细讨论它们。P3U1AComputerStructureandFunction计算机结构与功能DatainMemoryDataisinformationthatisrepresentedinmemoryasacode.Forefficientuseofthememoryspaceandprocessingtime,mostcomputersprovidethecapabilityofmanipulatingdataofdifferentlengthsandrepresentationsinmemory.Thevariousdifferentrepresentationsrecognizedbytheprocessorarecalleditsdatatypes.Thedatatypesnormallyusedare:bit,binary-codeddecimaldigit(4-bitnibble,BCD),byte(8bits),word(2bytes),doubleword(4bytes).存储数据数据是存储器中代表代码的信息。为了有效利用存储空间和处理时间,大多数计算机提供了不同长度和表示方法的处理数据能力。能被处理器识别的各种不同表示称作数据类型。常用的数据类型有:位、二进制码、十进制数字(4位字节,BCD)、字节(8位)、字(2个字节)、双字(4个字节)。P3U1AComputerStructureandFunction计算机结构与功能Someprocessorsprovideinstructionsthatmanipulateotherdatatypessuchassingle-precisionfloating-pointdatatypes(32bits)anddouble-precisionfloating-pointdatatypes(64bits).Ther
本文标题:012-P3U1A-B-Computer Structure and Function
链接地址:https://www.777doc.com/doc-4160963 .html