資源描述:
《CHAPTER 4 The Components of the System 4. Memory 課件》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、CHAPTER4TheComponentsoftheSystemUnitMemoryMainMemoryMainmemory–acollectionofstoragelocations,eachwithauniqueidentifiercalledtheaddress.Word-Dataaretransferredtoandfrommemoryingroupsofbitscalledwords.ThenumberofbitsthatcanbestoredinoneCPUregisterinacomputer.Figure5-3MainmemoryAddressSpaceAl
2、thoughprogrammersuseanametoidentifyaword,atthehardwarelevel,eachwordisidentifiedbyanaddress.Addressspace-Thetotalnumberofuniquelyidentifiablelocationsinmemory.Forexample:amemorywith64KBandawordsizeof1bytehasanaddressspacethatrangefrom0to65535.Table5.1MemoryunitsUnit------------KB-kilobyte
3、MB-megabyteGB-gigabyteTB-terabytePB-petabyteEB-exabyteExactNumberofbytes------------------------210bytes220bytes230bytes240bytes250bytes260bytesApproximation------------103bytes106bytes109bytes1012bytes1015bytes1018bytesAddressasBitPatternBecausecomputersoperatebystoringnumbersasbitpattern
4、s,theaddressitselfisalsorepresentedasabitpattern.IfacomputerhasNwordsofmemory,youneedanunsignedintegerofsizelog2Nbitstorefertoeachmemorylocation.Memoryaddressesaredefinedusingunsignedbinaryintegers.Note:Example1Acomputerhas32MB(megabytes)ofmemory.Howmanybitsareneededtoaddressanysinglebytei
5、nmemory?SolutionThememoryaddressspaceis32MB,or225(25x220).Thismeansyouneedlog2225or25bits,toaddresseachbyte.Example2Acomputerhas128MBofmemory.Eachwordinthiscomputeris8bytes.Howmanybitsareneededtoaddressanysinglewordinmemory?SolutionThememoryaddressspaceis128MB,whichmeans227.However,eachwor
6、dis8(23)bytes,whichmeansthatyouhave224words.Thismeansyouneedlog2224or24bits,toaddresseachword.MemoryTypesRAM(RandomAccessMemory)VolatileR/WbyuserTwocategories:DRAM(DynamicRAM)RefreshusedinmostPCsSRAM(StaticRAM)Norefreshfaster、morereliablemoreexpensiveoftenusedonlyasamemorycacheMemoryTypesR
7、OM(ReadOnlyMemory)NonvolatileWrittenbymanufactureHoldthebootingprogramCategories:ROMPROM(ProgrammableROM)-WriteoncebyuserEPROM(ErasablePROM)-physicalremovalandreinstallationbyspecialdeviceEEPROM(ElectronicallyEPROM)-withoutbeingremovedfromcomputerFigure5-4Memo