computer architecture part iii-c: memory access and management
TRANSCRIPT
Memory Access MethodsMemory Access Methods
Ways of locating data stored in main memory
Three types Addressed memory Associative memory Sequential memory
Addressed MemoryAddressed Memory
Nearly all memories are of this type, both ROM and RAM
Uses addresses to select the cells being read from or written to
Device needs to supply the address in memory and the transfer direction (read or write)
Associative MemoryAssociative Memory
Also called content-addressable memories (CAM)
Uses the contents of part of the memory words to select the cells being written or read
Used mainly in cache memory Example of an access request:
“Search for all words whose highest order 8 bits contain the value 1101 1110, and return the value in the first word that matches”
Components of Associative MemoryComponents of Associative Memory
Argument Register
Mask Register
Match Register
Any-match Bit
Array of memorylocations
Memory BufferRegister
Components of Associative MemoryComponents of Associative Memory
Argument Register Holds the argument for an associative search In previous example: “1101 1110 XXXX …”
Mask Register Specifies the field of each word that the memory
should match In previous example : “highest-order 8 bits”
Match Register/Match Bits Indicates which words match the search criterion
Components of Associative MemoryComponents of Associative Memory
Any Match Bit Indicates whether any match bits are set
Memory Buffer Register Holds the value to be stored or the value
just recalled
Sequential AccessSequential Access
Data is acquired based on its offset from the current position of the read/write head (e.g. next word, previous word, hundredth word forward, etc.)
Usually found in magnetic tapes
Memory ManagementMemory Management
Information will reside in slowest memory when it is not in use; then brought to faster memories when it is needed
How? Needs a scheme to ensure required data is in memory when it is to be read or altered by the processor
These are called memory management schemes
How much memory do you have?How much memory do you have?
Total memory = MM + Secondary memory
MM: high speed; programs reside here for CPU to access
A cache can be inserted between MM and processor
Secondary memory: often refers to magnetic disk memory (e.g. hard disk) but also includes other types like floppy, CD-R, Zip, etc.
DefinitionsDefinitions
Virtual memory = MM + disk cache Real Address
Physical memory address Virtual Address
Program generated address; has corresponding address in physical memory (either primary or secondary)
Pages Blocks of words in memory (64b to 4 KB)
DefinitionsDefinitions
Addresses consists of Page field - which page in memory the
data is located Line field - which part of the page the
data is located
Address TranslationAddress Translation
Processor generates virtual address used to determine where to read from or write to in physical memory
Virtual address must be translated to a physical address
Three methods Direct Mapping Associative Mapping Set-Associative Mapping
Page n Line
Virtual Address from CPU
Page Line
Real Address to MM
Real PageAddress
0
n
High speed memoryholding real pageaddresses
Direct MappingDirect Mapping
Page n Line
Virtual Address from Processor
Page Line
Real Address to MM
Virtual Page
VirtualPage
Associative MemoryCompare withall storedvirtual addressessimultaneously
Associative MappingAssociative Mapping