计算机系统与应用课件 chapter6 Instruction system

上传人:f****u 文档编号:129028575 上传时间:2020-04-22 格式:PPT 页数:46 大小:820KB
返回 下载 相关 举报
计算机系统与应用课件 chapter6 Instruction system_第1页
第1页 / 共46页
计算机系统与应用课件 chapter6 Instruction system_第2页
第2页 / 共46页
计算机系统与应用课件 chapter6 Instruction system_第3页
第3页 / 共46页
计算机系统与应用课件 chapter6 Instruction system_第4页
第4页 / 共46页
计算机系统与应用课件 chapter6 Instruction system_第5页
第5页 / 共46页
点击查看更多>>
资源描述

《计算机系统与应用课件 chapter6 Instruction system》由会员分享,可在线阅读,更多相关《计算机系统与应用课件 chapter6 Instruction system(46页珍藏版)》请在金锄头文库上搜索。

1、ComputerSystemandApplication Chapter6 InstructionSystemofCPU ConceptsofInstructionSystem Instructionsystem machineinstructionsetInterfacebetweenhardwareandsoftwareDetermineCPU sstructureandfunctionDeterminestructureandfunctionofprogramminglanguageThesamepartviewedbyarchitectandprogrammerAlargepartof

2、CPUdesigntaskisimplementinginstructionsetDifferentCPUarchitecture differentinstructionsetRISCvsCISCContentsofdesigninginstructionsetInstructionformatdesignInstructionfunctiondesignDatatypesupportAddressingmodedesign ComponentsofAnInstruction InstructionsetThecollectionofdifferentinstructionsthatthep

3、rocessorcanexecuteTens hundredsofinstructionsAninstructionincludesOpcodesAddressingmodeflagAddresses sourceoperandsandresultoperandsMainmemoryorvirtualmemoryRegisterI OdevicesSourceoperandmaybeimmediateoperandAddressofnextinstruction explicitorimplicitMachineinstructionispresentedasasequenceof0 1cod

4、esManyformatsexistininstructionset 4 OpcodeOptimizationDesign FrequentlyusedopcoderepresentationsFixed lengthopcodeHuffmanencodingExtendedHuffmanencodingFixed lengthopcodeOnebytelengthSimplehardware buttotalopcodeistoolongUsedinRISCCPUHuffmanencodingVariableopcodelengthShortestaverageopcodelengthExt

5、endedHuffmanencodingCombiningfixed lengthandHuffmanencoding 5 HuffmanEncoding PrincipleFrequentlyeventsarerepresentedbyshortcodeAveragecodelengthisshortestTheorybasisisentropycodingEntropyShortestaverageencodinglengthpi usageprobabilityofanopcodeinprogram amountofinformationoftheopcodeRedundantamoun

6、tofinformationH averagecodelengthofanencodingmode 6 ExampleforHuffmanEncoding SupposeaCPUhas7opcodesandoccurringprobabilityinprogramisshownasthetable Problems Iffixed lengthopcodeisused howmanybitsaretheopcode Howmanybitsaretheshortestaverageopcode entropy Howmuchisredundantamountofinformationforfix

7、ed lengthopcode 7 Solutions 7opcodes soinfixed lengthmode 3bitsareneededEntropyRedundantamountofinformationforfixed lengthopcode35 isredundantinformation 8 OpcodeEncodingMethodBasedonHuffman EncodingusingHuffmantree alsocalledminimumprobabilitymergingStep1 constructHuffmantreeStep2 encodingbranchesH

8、uffmantreeconstructingprocedureinaboveexampleArrangetheprobabilitiesof7opcodeshigh downMergingprobablenodesinbinarytreefromrighttoleftEncodeeachbranchusing0or1Leftbranchis0andrightbranchis10 1sequencefromtheroottoaleafnodeistheencodingoftheopcodeSeenextslide 9 HuffmanTree 10 AverageCodeLengthofHuffm

9、anEncoding Averagecodelengthpi usageprobabilityofithopcodeinprogramli lengthofithopcodeAccordingtovaluesofthefig Averagecodelength Amountofredundantinformation Huffmanencodingapproachesoptimizedentropy 11 ProsandConsofHuffmanEncoding ProsShortaveragecodelengthLittleredundantinformationConsOpcodeirre

10、gularityNoeasyforinstructiondecodingandcompilingNotesHuffmanencodingisnotuniqueTotalcodelengthandaveragecodelengthareunique 12 ExtendedHuffmanEncoding Huffmanencodingonthewholecombineswithlocalfixed lengthencodingTrade offbetweenHuffmanandfixed lengthSimplifydecoderandcompilerMultipleencodingmethods

11、 13 AddressCodeDesign Totaladdresslengthdependsonthenumberofaddresses typesandaddressingmodesTypicaladdressesininstructions3 2 1 0Toomanyaddressesmayexist butseldomusedAddressesselectionrulesMaketheprogramshortestMaketheprogramfastestShorteningaddresslengthtoavoidtoolonginstructionIndirectaddressing

12、RegisterindirectaddressingIndexaddressing 14 InstructionFormatDesign Itisaverycomplicatedproblem limitedbyInstructionfunctionandlengthFieldsandbitsofeachfieldAddressingmodesLengthofmainmemoryunitManyinstructionformatsexistinainstructionsetTrade offbetweenopcodelengthandaddressingabilityisneededVaria

13、bleopcodeMultipleopcodes 15 X86InstructionFormat Thex86isequippedwithavarietyofinstructionformatsTheinstructionformatisveryflexibleTypicalCISCinstructions 16 DataTypes DatatypedesignisanimportantcontentforinstructionsetInfluencingthestructureandfunctionofCPUDeterminingthedatatypesofHLLTypicaldatatyp

14、esAddressesNumbersCharactersLogicaldataSpecialdatatypesListsStrings 17 Numbers NumbersincomputerarelimitedanddiscreteTypicalnumbersBinaryintegerorbinaryfixedpointBinaryfloatingpointDecimalBinaryinteger itsvalueinTwosComplementRepresentationisWhere overflowwilloccurifavalueexceedsthisscope 18 Numbers

15、 BinaryfloatingpointnumbersAnyfloat pointnumbercannormalizedasor0 1 1 andbase2neednottobestoredExponentinbiasedrepresentationOriginalvalue 2k 1 1 RemovingsignofexponentIEEE754standardisnormallyused 19 Numbers PackeddecimalEachdecimaldigitisrepresentedbya4 bitcodeBCD BinaryCodedDecimal Standardsignva

16、luesare1100forpositiveand1101fornegativeateithertheleftorrightendExample 369 1100001101101001 369 1101001101101001MostofCPUssupportpackeddecimalAvoidingconvertingoverheadinfrequentI Oapplications 20 Characters CharacterorstringisnormallyrepresentedinASCIIcodeAnothercharacterrepresentationisEBCDICExtendedbinarycodeddecimalinterchangecode 0 1 codesof8bitsrepresentacharacterUsedinpastIBMlargecomputerWe dbetterrememberASCIIcodesofseveralspecialcharacters 0 48 A 65 enter 13 space 32Convertinglowercas

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号