You are on page 1of 22

COMPUTERARCHITECTURE IT0205

M.Thenmozhi/Kayalvizhi Jayavel/M.B.Panbu Asst.Prof.(Sr.G)/Asst.Prof.(Sr.G)/Asst.Prof.(O.G) DepartmentofIT SRMUniversity,Kattankulathur

Disclaimer
Thecontentsoftheslidesaresolelyforthepurposeofteachingstudents atSRMUniversity.AllcopyrightsandTrademarksof organizations/personsapplyevenifnotspecifiedexplicitly.

UNITIV:memoryorganization

MemoryHierarchy Mainmemory Auxiliarymemory Associativememory Cachememory Virtualmemory


MemoryManagementHardware

Memoryhierarchy
MainMemory memoryunitthatcommunicatesdirectlywith theCPU Auxiliarymemory devicesthatprovidebackupstorage(e.g) magneticdisksandtapes Cachememory highspeedmemoryusedtoincreasethespeed ofprocessingbymakingprogramsanddataavailabletotheCPU atarapidrate

MAINmemory
StaticRandomAccessMemory internalflipflopsthatstorethe binaryinformation DynamicRAM storesthebinaryinformationintheformof electricchargesthatareappliedtocapacitors ReadOnlyMemory storeprogramsthatarepermanently residentinthecomputerandfortablesofconstantsthatdonot changeinvalueoncetheproductionofthecomputeris completed Bootstraploader functionisstartthecomputersoftware operatingwhenpoweristurnedon

Mainmemory
Bootstrapprogramloadsaportionofoperatingsystemfrom disctomainmemoryandcontrolisthentransferredtooperating system RAMchip utilizesbidirectionaldatabuswiththreestate bufferstoperformcommunicationwithCPU Memoryaddressmap pictorialrepresentationofassigned addressspaceforeachchipinthesystem

blockdiagramandfunctiontableofram

Auxiliarymemory
Accesstime averagetimerequiredtoreachastoragelocation inmemoryandobtainitscontent Seektime timerequiredtopositiontheread/writeheadtoa location Transfertime timerequiredtotransferdatatoorfromthe device Transferrate no.ofcharactersorwordsthatthedevicecan transferpersecond

Associativememory
AssociativememorycanalsobecalledasContentaddressable memory(CAM) CAMisaccessedsimultaneouslyandinparallelonthebasisof datacontentratherthanbyspecificaddressorlocation AssociativememoryismoreexpensivethanaRAMbecauseeach cellmusthavestoragecapabilityaswellaslogiccircuits Argumentregister holdsanexternalargumentforcontent matching Keyregister maskforchoosingaparticularfieldorkeyinthe argumentword

Blockdiagramofassociative memory

10

Onecellofassociativememory

Match logic will be explained using Chalk and Talk

11

Cachememory
Localityofreference referencestomemoryatanygiven intervaltendtobeconfinedwithinafewlocalizedareasof memory Cachememory logicallyplacedbetweenCPUandmain memory Hitratio ratioofthenumberofhits(successinfindingthe wordsinCache)tothetotalCPUreferencestomemory (hits+misses) Mapping transformationofdatafrommainmemorytocache memory

12

Cachememory
Threetypesofmappingprocedures

Associativemapping storesbothaddressand contentofthememoryword;Inthematching process,iftheaddressisfound,the corresponding12bitdataisreadandsenttothe CPU Directmapping consistsofindexfieldandtag field;no.ofbitsintheindexfieldisequaltothe numberofaddressbitsrequiredtoaccessthe cachememory;eachwordinthecacheconsists ofdatawordanditsassociatedtag;hit:tagfieldof CPUaddress=tagfieldinthecache
13

Cachememory
Threetypesofmappingprocedures

SetAssociativemapping eachwordofcache canstoretwoormorewordsofmemoryunder thesameindexaddress;whenamissoccursin setassociativemapping,tagreplacement algorithmshouldbeapplied

14

ASSOCIATIVEMAPPINGCACHE

15

Virtualmemory
Virtualmemory permittheusertoconstructprogramsasthoughlarge memoryspacewereavailable,equaltothetotalityoftheauxiliarymemory AnaddressusedbyaprogrammerisVirtualaddress Setofvirtualaddressesarecalledaddressspace Anaddressinmainmemoryiscalledalocationorphysicaladdress Setofphysicaladdressesconstitutememoryspace

16

Virtualmemory
Addressspace>memoryspaceifvirtualmemoryisavailable. Mappingavirtualaddress

Virtualaddressregister storesvirtualaddress Memorymappingtable tomapavirtual addresstoaphysicaladdress Mainmemoryaddressregister storesphysical address Addressmappingcanalsobedoneusingpages

17

Memorytableformappingavirtualaddress

18

Addressmappingusingpages
Blocks physicalmemoryisbrokendownintogroupsofequalsize Page groupsofaddressspaceofthesamesize Pageframeissometimesusedtodenoteablock Memorypagetableconsistsof8wordsoneforeachpage Addressinthepagetabledenotesthepagenumber Contentofthewordgivestheblocknumberwherethatpageisstored inmainmemory Presencebit indicateswhetherthepagehasbeentransferredfrom auxiliarymemoryintomainmemory 3highorderbitsofthevirtualaddressspecifyapagenumberandan addressforthememorypagetable.

19

Memorymanagementhardware
Basiccomponentsinclude: Facilityfordynamicstoragerelocationthatmapslogicalmemory referencesintophysicalmemoryaddresses Provisionforstoringcommonprogramsstoredinmemorybydifferent users Securityagainstunauthorizedaccessbetweenusersandpreventing usersfromchangingOSfunctions Segment setoflogicallyrelatedinstructionsordataelementsassociated withagivenname(addressgeneratedbyasegmentedprogramislogical address) Translationlookasidebuffer(TLB) fastassociativememoryusedtohold themostrecentlyreferencedtableentries

20

Exampleoflogicalandphysicaladdresses

21

Needforcache StaticanddynamicRAMComparison Memoryaddressmapping Contentaddressablememory function Localityofreference Mappingproceduresincachememory Addressspaceandmemoryspace Needformemorymanagementhardware Componentsofmemorymanagementhardwareunit

22