1 / 31

MEMORY ORGANIZTION & ADDRESSING

MEMORY ORGANIZTION & ADDRESSING. Presented by: Bshara Choufany. Outline: Introduction Memory Allocation Memory Hierarchy Memory Addressing. 1- Introduction: Memory is divided into tiers: - Main Memory * Relatively expensive * Relatively small capacity

lois
Download Presentation

MEMORY ORGANIZTION & ADDRESSING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MEMORY ORGANIZTION& ADDRESSING Presented by: BsharaChoufany

  2. Outline: • Introduction • Memory Allocation • Memory Hierarchy • Memory Addressing

  3. 1- Introduction: Memory is divided into tiers: - Main Memory * Relatively expensive * Relatively small capacity * High-performance - Second Storage * Cheap * Large Capacity * Slow

  4. Memory can be organized in two ways • One process uses the entire space • Each process gets its own partition in memory * Dynamically allocated * Statically allocated

  5. Dynamic allocated memory is the allocation of memory storage for use in a computer program during the run time of that program • Static allocated memory refers to the process of allocating memory at compile-time before the associated program is executed • Dynamically allocated memory exists until it is released wither explicitly by the programmer, exiting a block, or by the garbage collector. • Static memory allocation has a fixed duration

  6. Memory Allocation Contiguous vs. Noncontiguous Memory Allocation • Ways of organizing programs in memory – Contiguous allocation • Program must exist as a single block of contiguous addresses • Sometimes it is impossible to find a large enough block • Low overhead – Noncontiguous allocation • Program divided into chunks called segments • Each segment can be placed in different part of memory • Easier to find “holes” in which a segment will fit • Increased number of processes that can exist simultaneously in memory offsets the overhead incurred by this technique

  7. Single-User Contiguous Memory Allocation • One user had control of entire machine – Resources did not need to be shared – Originally no operating systems on computer • Programmer wrote code to perform resource management – Input-Output Control Systems (IOCS) • Libraries of prewritten code to manage I/O devices • Precursor to operating systems

  8. Single-user contiguous memory allocation

  9. - Memory Hierarchy

  10. Memory Hierarchy Main memory – Should store currently needed program instructions and data only • Secondary storage – Stores data and programs that are not actively needed • Cache memory – Extremely high speed – Usually located on processor itself – Most-commonly-used data copied to cache for faster access – Small amount of cache still effective for boosting performance

  11. Memory Hierarchy

  12. - Classification System of Memory

  13. Recall: - Two major types of Memory: * RAM (Read Access Memory) • Perform • Read • Write * ROM (Read-Only Memory) • A Programmable logic device • Perform only the read operation

  14. Registers associated with the memory system: Both RAM and ROM can be characterized by two registers and a number of control signals. For Example: Consider a memory of 2ⁿ words, each having M bits. Then, the Memory Address Register (MAR) is an n-bit register used to specify the memory address The Memory Buffer Register (MBR) is an M-bit register used to hold data to be written to the memory or just read from the memory. This register is also called Memory Data Register (MDR)

  15. - Organization of Memory Units • A basic memory unit provides the ability to store and access a fixed number of bits. • Each bit within such a unit may be selected individually for reading and writing. • Memory units are usually distributed as bit slices. • If A chip can store 64K bits, each chip will be used to store one bit each from 64K different locations, rather than a complete byte from 8K different locations

  16. Bit Slice Memory Organizition

  17. - Memory as a linear Array Consider a byte-addressable memory with N bytes of memory. Byte memory [N]; // Address ranges from 0 to (N-1) Let’s say for example that these notes were written on a computer with 384MB of memory. 384MB=384*2²⁰ bytes, since memory is byte addressable, N= 384*1048576 = 402,653,184 Also note that: 384 MB = (256 + 128)*220 = 228 + 227

  18. - Memory Addressing • A memory address is an identifier for a memory location, at which a computer program or a hardware device can store data and later retrieve it. • It’s a binary number from a finite monotonically sequence that uniquely describes the memory itself. • In modern byte-addressable computers, each address identifies a single byte of storage

  19. Samples of Memory Addressing

  20. - Addressing Strategies 1- Coordinate-Addressed: • Memory is accessed by supplying a number (address) which is used directly to identify a particular physical storage location. • Data is copied into or out the selected location. Coordinate-Addressed are typically constructed as a collection of individual units such as chips, each capable of storing a limited number of bits.

  21. 2- Content-Addressed: • Also called Associative. • It is accessed by supplying a data value for certain portions (fields) of a storage location, rather than the physical address of that location. • The memory automatically identifies any locations that match the given data, and the contents of these locations may be accessed.

  22. - Two registers are associated with the Content-Addressed Memory (CAM): • MASK • DATA • Each register has the size of one full word • Each word includes some comparison logic and one or more TAG bits. • Each set of tag bits forms a bit-slice register, with one bit for each word of the memory

  23. A Content-Addressable Memory Includes a set of words, each consisting of a number of bits. Common for such a memory to have very large word sizes, often 100 bits or more.

  24. - Types of operations that may be possible on associative memories: READ & WRITE SEARCH: Identify words that match a particular pattern COUNT MATCHES: This operation indicates how many tag bits are set. MASKED WRITE: Write data from the data register into only the bits selected by the mask register

  25. MULTIWRITE: Write data into all tagged words at the same time. STORE: Write a data word into any empty location, rather than a selected one. ADDRESS OPERATIONS: Determine the coordinate address of a tagged word, or read or write by address. TAG OPERATIONS: Set, clear or read a tag register, or copy among multiple tag registers.

  26. Example of Search Register Setup The above figure shows these two registers set to search for all words that contain the pattern 1101 in bits 10 through 7, and 010 in bits 3 through 1.

  27. - Two was to assign memory units to the address space: 1 – BANK ADDRESSING: • Uses the high-order bits of the address to select units • Each unit represents a consecutive sequence of addresses • Bank switching assigns different units to parts of memory likely to be used for different purposes 2 - INTERLEAVING: • uses the low-order bits of the address to select units. • consecutive memory locations are assigned to different memory units. • When it is desired to read a consecutive sequence at high speed, such as pipelined instruction fetching or block data transfer to disk, the transfers can be effectively overlapped since they will tend to come from independent units.

  28. Figure 1- Bank Selection Figure 2- Interleaving

  29. - Memory Management Strategies • Strategies divided into several categories – Fetch strategies • Demand or anticipatory • Decides which piece of data to load next – Placement strategies • Decides where in main memory to place incoming data – Replacement strategies • Decides which data to remove from main memory to make more space

  30. Course: CS 147 Computer Architecture Instructor: Dr. Sin-Min Lee Date: 03/19/09

More Related