Memory Farhana Rahman December 7th , 2004 CS147, SECTION 3 Outline Memory Hierarchy Addressing Modes Architecture Types of Memory Memory Hierarchy Memory refers to any storage medium used for storing information. Since there are many different kinds of storage media , we can categorize them according to the memory speed.The memory hierarchy is as follows: Cache Memory Secondary memory Main (primary) memory Archival memory Memory Characteristics Memory Type Cache Main Secondary Archival Technology TTL MOS Magnetic Paper Speed (access time) 10^1 ns 10^2 ns 10^3 ns 10^5 ns Size (capacity) Small,< 8K Medium, 64K-8M Large, 300K-1G Very large, Usage Processor, Data Buffer On-line, Dynamic, Temporary Storage On-line, Bulk storage Archival, Off-line, permanent storage Representative Example TTL memories Semiconductor Memories Floppy disk, Hard disk,tape Paper Definition Cache Memory: The cache memory is a small section of memory that is usually placed between the processor and the main memory and is used when the main memory speed is much slower than the processor speed. Main (Primary) Memory: The main memory contains the primary storage space, which is randomly accessible by the processor.The primary function of the main memory is to store the instructions and data necessary for the current execution of the processor. Definition Secondary Memory: The information stored in the main memory is not easily accessible to the programmer and is not suited for storing a lot of information. Secondary storage media are useful for this purpose. Archival Memory: Archival memory refers to permanent storage media.This include media such as cards and paper printouts. Their use is strictly for the programmer to store computation results. Addressing Modes In order to access the memory, an address must be provided.The manner in which the address is specified in an instruction is called the addressing mode. Addressing modes can be categorized into: Basic addressing modes Special addressing modes Basic Addressing Modes Most computer systems use a number of basic addressing modes to obtain operands from memory; many high performance processors include additional addressing modes consistent with the design philosophies of the processor. Basic addressing modes include: Implied addressing Immediate addressing Register Addressing Direct Addressing Register indirect addressing Implied register indirect addressing Indexed addressing Basic Addressing Modes Immediate addressing (microcomputers) Implied addressing PC (implied) IR OPR M IR OPCODE OPR MDR Immediate addressing (large computers) PC IR OPCODE OPR OPCODE OPR Basic Addressing Modes Register addressing Direct addressing (large computers) M Reg.# 1 IR Reg.# 2 PC Reg.# 2 (OPR) OPCODE Reg.# 3 OPR Reg.# 4 Direct addressing (microcomputers) M PC OPCODE ADDR OPR MAR ADDR Basic Addressing Modes Register indirect addressing IR OPCODE Reg. #2 Reg. # 1 M Reg. # 2 OPR Reg. # 3 Implied register indirect addressing M IR OPCODE (implied) Reg. # 2 OPR Indexed addressing Reg. # 2 M IR OPCODE Reg. # 2 Index Reg. # 3 OPR Reg. # 2 Special Addressing Modes Many processors have additional or special addressing modes that facilitate ease implementing language constructs and primitives often used in operating systems and other systems programming environments. Special addressing modes include: Relative addressing Base addressing Page addressing Indirect addressing Special Addressing Modes Relative addressing PC M IR OPCODE offset OPR offset Base addressing Specified address M OPR Base register Special Addressing Modes Page addressing M Page EA OPR Page register Indirect addressing M EA ADDR OPR Virtual Memory In some computer systems it is convenient for the user to be able to specify a memory space that is larger than the actual installed memory space. This is called virtual memory.The operation of a virtual memory system uses the concept of memory segmentation. The user’s entire virtual memory space is segmented into pages of segments and is stored as pages or segments in secondary memory. A page is a fixed block of memory, whereas a segment is a variable-size block of memory. Memory System Architecture The main elements of the memory system architecture are: Memory Cells Memory Organization Bit-Slice Organization Memory Segmentation Board/Bank Segmentation Memory Access Time Memory Cells The memory cell is a simple flip-flop or a bistable multivibrator that can be found in one of two stable states: an ON state and an OFF state. Memory components are composed of three major parts: the memory cells, the row decoder, and the column decoder. Memory Organization Memory organization is usually given in terms of the number of individually accessible or addressable words in the chip and the word length. Bit –Slice Organization: The concept of bit-slice organization is to have many chips operating together in parallel, each responsible for the operations within a thin slice (a few bits) of the word. Memory Organization Memory Segmentation: Although the bit-slice organization technique provides the necessary tools for the design of a memory system with any width, the memory segmentation technique gives the necessary tools for the design of a memory system with any depth. In memory segmentation, many memory chips are connected together to form the complete memory system. Memory Organization Board/Bank Segmentation: Often only a fixed number of memory chips can fit into a specific size of circuit board. If more memory is required, multiple memory boards are used. The portion Of memory located on a particular board is called a memory bank. The total memory is composed of many memory banks. All banks are usually connected to a motherboard. Memory Access Time Memory Access Time: This is an important performance parameter for memory chips. Maximum Access Time: This is the delay time the chip requires to search through the memory cells for the addressed word. The output can be read after this time. A slightly longer time is sometimes required to write data into memory. Memory Types Memory components are extremely useful for many purposes in addition to storage. There are two basic types of memory: Read-only memory (ROM) Read/write memory (RAM) Read-Only Memory (ROM): It is read only: it can be read from but not written to. It is not volatile: Its contents are not lost when power is off. Read-Only Memory Applications of ROM: There are many applications of ROMs, some of which include: 1. Permanent information storage 2. Code conversion 3. Multiple output function generation Read-Only Memory Types of Rom: ROM PROM (Programmable read-only memory) : An example of a PROM is the P2764A production EPROM chip. EPROM (Erasable programmable read-only memory) : More versatile and popular type of ROM .EPROMs are ideal for experimentation and development when the final edition of the program is not yet available. EEPROM (Electrically erasable programmable read-only memory) : Information can be directly and dynamically erased electrically under program control. Read/Write Memory These are volatile memories, because they store information only as long as power is applied. The primary use of RAMs is temporary data storage , often called scratchpad memory, because the RAM can be written into and later read by the user. RAM Types Static Memory: For static memory, the memory cells are simple flip-flops or bistable multivibrator with two stable states so that the cells can hold their state permanently as long as the power is applied. Dynamic Memory (DRAM): DRAM chips have much simpler memory cells in which the state of the memory cell is indicated by the presence or absence of stored charge in a capacitor.As time passes, charge leakage occurs and the information is lost even if power is left on. Pseudo-static Memory: These chips are actually dynamic memory. They act like static memory because the refresh circuitry is provided inside the chip. References 1. John Y.Cheung, and Jon G.Bedeson , Modern Digital Systems Design. New York : West Publishing Company, 1990. 2. Anthony J. Dos Reis , Assembly Language And Computer Architecture Using C++ and Java. United States : Thomson Course Technology, 2004.