![計算機組成與結構:chapter10 Instruction Sets Characteristics and Functions_第1頁](http://file4.renrendoc.com/view/6c6ef0db68495f3024ab9c3382c72f7d/6c6ef0db68495f3024ab9c3382c72f7d1.gif)
![計算機組成與結構:chapter10 Instruction Sets Characteristics and Functions_第2頁](http://file4.renrendoc.com/view/6c6ef0db68495f3024ab9c3382c72f7d/6c6ef0db68495f3024ab9c3382c72f7d2.gif)
![計算機組成與結構:chapter10 Instruction Sets Characteristics and Functions_第3頁](http://file4.renrendoc.com/view/6c6ef0db68495f3024ab9c3382c72f7d/6c6ef0db68495f3024ab9c3382c72f7d3.gif)
![計算機組成與結構:chapter10 Instruction Sets Characteristics and Functions_第4頁](http://file4.renrendoc.com/view/6c6ef0db68495f3024ab9c3382c72f7d/6c6ef0db68495f3024ab9c3382c72f7d4.gif)
![計算機組成與結構:chapter10 Instruction Sets Characteristics and Functions_第5頁](http://file4.renrendoc.com/view/6c6ef0db68495f3024ab9c3382c72f7d/6c6ef0db68495f3024ab9c3382c72f7d5.gif)
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
ComputerOrganization&ArchitectureChapter10
InstructionSets:CharacteristicsandFunctions10.1MachineinstructioncharacteristicsWhatisTheInstructionSetArchitectures?Theattributesofasystemasseenbytheprogrammer,i.e.,theconceptualstructureandfunctionalbehavior,asdistinctfromtheorganizationofthedataflowsandcontrols,thelogicdesign,andthephysicalimplementation.
-Amdahl,BlaawandBrooks,1964...theportionofthemachinevisibletotheprogrammerorcompilerwriter.
-HennesseyandPatterson,1990SoftwareHardwareISAInstructionSetThecollectionofinstructionsthatCPUcanexecuteTheinstructionsetdeterminatesthefunctionofCPUMachineCode,BinaryForconvenience,usuallyrepresentedbyassemblycodesElementsofanInstructionOperationcode(Opcode)DothisSourceOperandreferenceTothisResultOperandreferencePuttheanswerhereNextInstructionReferenceWhenyouhavedonethat,dothis...BranchinstructionPC
InstructionCycleStateDiagramWherearealltheOperands?Cache
or
mainmemoryorvirtualmemoryCPUregistersIfonlyoneregisterexists,referencetoitmaybeimplicitFormanyregisters,eachisassignedauniquenumberI/OdeviceTheinstructionmustspecifytheI/Omodule&deviceoranothermemoryaddressfortheoperationInstructionRepresentation
Inmachinecode,eachinstructionhasauniquebitsequenceTheinstructionisdividedintofieldssuchasthefollowingformat:Itisdifficultforboththeprogrammerandreaderstodealwithbinarycodeofmachineinstructions,thus,asymbolicrepresentationisusede.g.ADD,SUB,MPY,DIV
LOAD,STOR,etc.OperandscanalsoberepresentedinthiswayADDA,BInstructionTypesDataprocessingDatastorage(mainmemory)Datamovement(I/O)Programflowcontrol:testandbranchAnydata-processingtaskmaybeexpressedbyaboveinstructionsAnyprogramwritteninhigh-levellanguagemaybetranslatedintoaboveinstructionsNumberofAddresses3addressesOpcodeOperand1,Operand2,Result(Operand1)OP(Operand2)→Resulta=b+c;Maybeaforth-nextinstruction(usuallyimplicit)NotcommonNeedsverylongwordstoholdeverything2addressesOpcodeOperand1,Operand2(Operand1)OP(Operand2)→Operand1Oneaddressdoublesasoperandandresulta=a+bReduceslengthofinstructionSometimes,requiressomeextrawork:usingMOVinstructionTemporarystoragetoholdsomeresults1addressOpcodeOperand1OP(Operand1)→Operand1or(Operand1)OP(OperandX)→Operand1ImplicitsecondaddressUsuallyaregister(accumulator,AC)Commononearlymachines
E.g:ACACOPA0(zero)addressesOpcodeAlladdressesimplicitornoaddressUsesastack0addressesinstructionswouldreferencetoptwounitsofstackE.g.TTOP(T-1)NOPHowManyAddresses?MoreaddressesMorecomplex(powerful?)instructionsMoreregistersInter-registeroperationsarequickerFewerinstructionsperprogramFeweraddressesLesscomplex(powerful?)instructionsMoreinstructionsperprogramFasterfetch/executionofinstructions,buttheprogramislonger,morecomplicatedandslowerModerncomputersadopttwo-orthree-addressinstructionsInstructionSetDesignDecisionsOperationrepertoireHowmanyops?Whatcantheydo?Howcomplexarethey?DatatypesAddresses,Numbers,Characters,LogicalDataInstructionformatsLengthofopcodefieldNumberofaddresses
RegistersNumberofCPUregistersavailableWhichoperationscanbeperformedonwhichregisters?Addressingmodes(later…)RISCvCISC10.2TypesofOperandsAddressesUnsignedintegerNumbersInteger/floatingpoint/decimalUsingdecimalcanavoidconversionManymachinessupportpackeddecimal4bitsbinarycodeadecimaldigit246=001001000110CharactersASCII,EBCDIC,etc.LogicalDataBitsorflagsBoolean10.3PentiumandPowerPCdatatypePentiumDataTypes8bit(Byte)16bit(word)32bit(doubleword)generaldatatypes64bit(quadword)Addressingisby8bitunitA32bitdoublewordisreadataddressesdivisibleby4(32bitdatabus)Little-endian:theleastsignifcandisstoredinthelowestaddressSpecificDataTypesGeneral-arbitrarybinarycontentsInteger-signedbinaryvalue,complementrepresentationOrdinal-unsignedintegerUnpackedBCD-OnedigitperbytePackedBCD-2BCDdigitsperbyteNearPointer-32bitoffsetwithinsegmentBitfieldByteStringFloatingPointPentiumDataTypesPowerPCDataTypes8(byte),16(halfword),32(word)and64(doubleword)lengthdatatypesSomeinstructionsneedoperandalignedon32bitboundaryCanbebig-orlittle-endianFixedpointprocessorrecognises:Unsignedbyte,unsignedhalfword,signedhalfword,unsignedword,signedword,unsigneddoubleword,bytestring(<128bytes)FloatingpointIEEE754Singleordoubleprecision10.4TypesofOperationsDataTransferArithmeticLogicalConversionI/OSystemControlTransferofControlDataTransferDatatransferinstructionsarethemostfundamentaltypeofmachineinstructionSpecifySourceDestination:registers,memory,topofstackAmountofdataModeofaddressingDatatransferinstructionsMoveStoreLoadExchange:swapcontentsofsourceanddestinationClear:all0Set:all1Push/popArithmeticAdd,Subtract,Multiply,DivideSignedIntegerFloatingpointMayincludeIncrement(a++)Decrement(a--)Negate(-a)absoluteLogicalBitwiseoperations/BooleanoperationsAND,OR,NOT,Exclusive-ORTest,compareSetcontrolVariables:setcontrolsforprotectingpurpose,interrupthandling,timercontrol,etc.ShiftRotateshiftLogicalShiftArithmeticShiftCyclicShiftConversionTranslateSomevaluesinmemoryareconvertedbytablequeryASCIIEBCDICConvertBaseconversionE.g.BinarytoDecimalInput/OutputInput/readOutput/writeStartI/OTestI/OMaybespecificinstructionsMaybedoneusingdatamovementinstructions(memorymapped)Maybedonebyaseparatecontroller(DMA)SystemsControlPrivilegedinstructionsCPUneedstobeinspecificstateUpdatecontrolregisterForoperatingsystemsuseScheduleaprocessUpdatePCBTransferofControlBranch/jumpJumpconditionalJumptosubroutineReturnexecuteSkipSkipconditionalHaltWait(hold)NooperationProcedureCallInstructionAprocedureisaself-containedcomputerprogramthatisincorporatedintoalargerprogramCodereuseTaskdecomposingProcedureCallInstructionisajumpinstructionAcallinstructionAreturninstructionNestedProcedureReturnAddressForcorrectlyexecutingmainprogram’ssequence,thereturnaddressmustbeprotectedThreemainmethods:RegisterStartofprocedureTopofstackStack&ReturnAddressStack&ParameterspassingWithaprocedurecall,inadditiontoprovidingareturnaddress,passingorreturnedparametersisalsoneededHowtopassparameters?RegistersMemorystackStackFrame:asetofparametersincludingreturnaddress10.5PentiumIIOperationTypesPp.356~357–table10.8NoneedtorememberCall/ReturnInstructionsPIIprovides4instructionstosupportprocedurecall/returnCALL:pushPCintostack,PC=startaddressoftheprocedure(jump)ENTER:createastackframeLEAVE:clearastackframeRETURN:endofprocedureMemoryManagementInstructionsDealwithmemorysegmentationsPrivilegedinstructionsusedbyOSE.g.loadasegmenttablecheckoralteraprivilegeofasegmentConditionCodesBitsinspecialregistersSetbycertainoperationsandusedinconditionaljumpinstructionsPIICCsC:carryP:parity–1meansevenA:auxiliarycarry—carryofhalfbytesinALZ:0S:signO:overflowThesecodescanbecombinedtoformaconditionMMXTechniquesMMX—MultiMedia
eXtensionAsetofhighlyoptimizedinstructionsformultimediaapplications57SIMDinstructions,64-bitdatafieldPerformthesameoperationonmultipledataelementsatonceinasingleclockcycleForproperapplications,theseparalleloperationscanyieldaspeedupof2~8timesMMXRegisters864-bitregistersMMXDataTypes64-bitdatafield,3types:SIMDExecutionModelSIMDallowsthesameoperationtobecarriedoutonmultipledataelementsinparallel.TheMMXtechnologysupportsparalleloperationsonbyte,word,anddoubleworddataelementswhencontainedinMMXregisters.Wraparound&SaturationArithmeticWraparoundArithmeticWithordinaryunsignedarithmetic,whenanoperationoverflows,theextrabitistruncatedthatis,thecarryoroverflowbitisignoredandonlytheleastsignificantbitsoftheresultarereturnedtothedestinationcontroltherangeofoperandstopreventout-of-rangeresultsSaturationArithmeticIfadditionresultsoverfloworsubtractionresultsunderflow,theresultissettothelargestorsmallestvaluerepresentable0or255DataRangeLimitsforSaturationMMXInstructionsTheMMXinstructionsetconsistsof57instructions,groupedintothefollowingcategories:DatatransferArithmeticComparisonConversionUnpackingLogicalShiftEmptyMMXstateinstruction(EMMS)ExampleFade-outandfade-ininvideoapplicationAlgorithm:Result-pixel=Apixel
fade+Bpixel
(1-fade)=(Apixel-Bpixel)fade+Bpixel
MMXCodespxormm7,mm7;zerooutmm7movqmm3,fad_val;loadfadevaluereplicated4timesmovdmm0,imageA;load4redpixelcomponentsfromimageAmovdmm1,imageB;load4redpixelcomponentsfromimageBpunpcklbwmm0,mm7;unpack4pixelsto16bitspunpckblwmm1,mm7;unpack4pixelsto16bitspsubwmm0,mm1;subtractimageBfromimageApmulhwmm0,mm3;multiplythesubtractresultbyfadevaluespadddwmm0,mm1;addresulttoimageBpackuswbmm0,mm7;pack16-bitresultsbacktobytesSpecification8-bitpixelcomponentsareconvertedto16-bitelementstoaccommodatetheMMX16-bitmultiplycapabilityIfimages’resolutionis640*480,andthedissolveusesall255possiblefadevaluesthen,totalnumberofinstructionsinMMXis535million,withoutMMX,is1.4billionNotesAssemblelanguageisneeded50cyclestimeisneededfromMMXtofloatingpointinstructionsDoyourbesttoavoidshuffleusageofMMXandFPinstructionsSSESSE—StreamSIMDExtensionsMMX28new128-bitXMMregistersSSEregistersUsedforPentiumIIIprocessorfamilyEnhancetheperformanceofIA-32processorsforadvanced2-Dand3-Dgraphics,motionvideo,imageprocessing,speechrecognition,audiosynthesis,telephony,andvideoconferencingSSEInstructionsTheSSEinstructionsaredividedintofourfunctionalgroupsPackedandscalarsingle-precisionfloating-pointinstructions.64-bitSIMDintegerin
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度國際快遞運輸與時效跟蹤服務合同
- 2025年度屋頂租賃合同附屋頂廣告權益共享協(xié)議
- 2025年度時尚女鞋品牌全國代理權購買合同樣本
- 培養(yǎng)學生團隊合作能力的美術教學計劃
- 激活團隊潛力的成功經(jīng)驗計劃
- 學校年度班級工作計劃表目
- 區(qū)域倉庫布局的設計原則計劃
- 2025年港物運輸項目合作計劃書
- 主管的職業(yè)素養(yǎng)與榜樣作用計劃
- 2025年激光轉速測量儀項目建議書
- 醫(yī)院審計科科長述職報告
- 《檔案管理課件》課件
- 2024年度中國共產(chǎn)主義共青團團課課件版
- 關于谷愛凌的課件
- 《學寫文學短評》課件 高中語文統(tǒng)編版必修上冊
- 《中藥的性能》課件
- 大型商業(yè)綜合體消防安全管理規(guī)則培訓
- 2025年中考物理終極押題猜想(新疆卷)(全解全析)
- 1《讀懂彼此的心》(說課稿)2023-2024學年統(tǒng)編版道德與法治五年級下冊
- DB32T 2857-2015 玉米產(chǎn)量現(xiàn)場測定操作規(guī)程
- 脛骨骨折的護理查房
評論
0/150
提交評論