190 likes | 364 Views
Computer Architecture. Part III-C: Memory Access and Management. Memory Access Methods. Ways of locating data stored in main memory Three types Addressed memory Associative memory Sequential memory. Addressed Memory. Nearly all memories are of this type, both ROM and RAM
E N D
Computer Architecture Part III-C: Memory Access and Management
Memory Access Methods • Ways of locating data stored in main memory • Three types • Addressed memory • Associative memory • Sequential memory
Addressed 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 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 Memory Argument Register Mask Register Match Register Array of memory locations Memory Buffer Register Any-match Bit
Components 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 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 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 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? • 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.
Definitions • 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)
Definitions • 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 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
Direct Mapping Virtual Address from CPU Page n Line High speed memory holding real page addresses 0 Real Page Address n Page Line Real Address to MM
Associative Mapping Virtual Address from Processor Page n Line Associative Memory Compare with all stored virtual addresses simultaneously Virtual Page Virtual Page Page Line Real Address to MM