CS 641 Name : Muhammad Hamad Albiladi ID : 1302219 Subject: Main Memory Research A computer system usually is not constructed using single type of memory . In fact, several types are used ; they comprice the hierarchical memory system of the computer. A typical memory hierarchy is shown in figure 9.1. The most well known element of the memory subsystem is the physical memory , which is constructed using random access memory (DRAM) chips. When a company advertices a personal computer for sale with 128 MB (or some other amount) of RAM, they are reffering to physical memory. [1] CPU with L1 cache Figure 1 L2 cache Physica l memory Virtual memory storage Generic memory hierarchy The memory unit that communacates directly with CPU is called main memory . The main memory is central storage unit in computer system. It is a relatively lage and fast memory used to store programs and data during the computer operation.[3] The memory unit is used to store programs and data. Usually, two types of memory devices are used to form a memory unit : primay storage memory decice and secondary storage memory device. The primary memory, commonly called main memory is a fast memory used for the storage of programs and active data (the data currently in process). The main memory is a semiconductor memory. It consists of a large number of semiconductor storage cells, each capable of storing one bit of information . These cells are read or written by the central processing unit in a group of fixed size called word. The main memory is organized such that the content of one word, containing n bits, can be stored or retrieved in one write or read operation, respectively.[3] To access data from a particular word from main memory each word in the main memory has distict address. This allows to access any word from the main memory by specifying corresponding adderss. The number of bits in each word is reffered as the word length of the computer. Typically, the word length varies from 8 to 64 bits. The number of such words in the main memory decides the size of memory or capacity of the memory. This is one of thespecification of the computer main memory varies from few million words to tens of millions words.[3] An important characteristics of a memory is access time (the time required to access one word). This access time for main memory should be as small as possible. Typically, it is of the order of 10 to 100 nanoseconds. This access time depend on the type of memory[3]. Essential concepts: The maximum size of the memory that can be used in any computer is determined from the number of address lines provided by the processor used in the computer. For example, if procesor has 20 address lines , it is capable of addressing upto 2^20 = 1 M (mega) memory locations. Similarly, proccessors whose instructions generate 32-bit address can access a memory taht contains up to 2^32 = 4G (Giga) memory locations. The number of locations represents the size of the address space of the computer.[3] Computer memory consists of a collection of consecutively number (addressed) registers, each one of which normally holds on byte. A byte is a collection of eight bits (sometimes reffered to by those in the computer communication community as an octor). Each register has an an address , reffered to as memory location. A nibble or nybble, as it is sometimes spelled, refer to a collection of four adjecent bits. The meaning of the terms “bit” , “byte” and “nibble” are generally agreed upon regardless of the specifics of an architecture, but the meaning of word depends upon the particular processor. Typical word sizes are 16,32,64 and 128 bits, with the 32-bit word size being the common form for ordinary computers these days, and the 64-bit word growing in popularity. In this text, words will be assumed to be 32 bits wide unless otherwise specified. A comparison of these data types is shown in figure 2.[4] Bit 0 Nibble 0110 Nibble Byte 10110001 16-bit word (half word) 11001001 01000110 32-bit 10110100 00110101 10011001 01011000 64-bit word (double) 01011000 01010101 10110000 11110011 11001110 11101110 01111000 00110101 128-bit word (quad) 01011000 01010101 10110000 11110011 11001110 11101110 01111000 00110101 00001011 10100110 11110010 11100110 10100100 01000100 10100101 01010001 Figure 2 Common sizes for data types. In byte-addressable machine, the smallest object that an be referenced in memory is the byte. However, there are usually instructions that read and write multi byte words. Multi byte words are stored as a sequence of byte , addressed by the byte of the word that has the lowest address.Most machine today have instructions that can access bytes, half-word and double-words.[4] When multi byte words are used, there are two choices about the order in whichthe byte are stored in memory: most significant byet at lowest address, refferedto as big-endian , or least significant byte stored at lowest address, reffered to as little-endian. The term “endian”comes from the issue of whether eggs should be broken on the big or little end, which caused a war by bickering politicians in Jonathan Swift’s Travels. Examples of big- and little-endian formats for a 4-byte, 32bit word illustrated in figure 3.[4] 31 X MSB Big-Endian byte x+1 x+2 31 x+3 MSB Little-Endian LSB X+3 X+2 X+1 x Figure 3 Big-endian and little-endian formats. Memory Organization: Characteristics of memory systems: The Table 1 lists the key characteristics of memory systems: Location : CPU Internal (main) External (Secondary) Capacity : Word size Number of words Unit of Transfer : Word Block Access Method : Random access Serial access Performance : Access time, Cycle time, Transfer rate Physical Type : Semiconductor Magnetic surface 0 Phgysical characteristics : Volatile / non volatile Organisation : Erasable/nonerasable Table 1 Location : The computer memory is placed in three different locations.[3] CPU : It is in the form of CPU registers and its internal cache memory (16 k bytes in case of pentium).[3] Internal : It is the main memory of the system which CPU can access directly.[3] External : It is in the form of secondary storage devices such as magnetic disk, tapes, etc. The CPU access this memory with the help of I/O controllers. [3] Capacity: It is expressed using two terms : Word size and number of words.[3] Word size: It is expressed in bytes (8-bit). The common word sizes are 8, 16 and 32 bits.[3] Number of Word: This term specifies the number of words available in the particular memory device. For exmaple, if memory capacity is 4k x 8 then its word size is 8 and number of words are 4k = 4096.[3] Unit of Transfer: It is the maximum number of bits that can be read or written intb the main memory at a time. In case of main memory, most of the times it is equal to word size. In case of external memory, unit of transfer is not limited top word size , it is often larger than a word and it is refferd to as blocks.[3] Access Method: A fundemental characteristic of a memory is the order or sequence in which information can be accessed.[3] Random Access; if storage locations can be accessed in any order and access time is independent of the location being accessed , the access method is known as random access. The memory tht provides such as access is known as random access memory (RAM) IC (semiconductor) memories are generally of this type.[3] Serial Access: if storage locations can be accessed only in a certain predetermined sequence, the access method is known as serial access. The memory that provides such access is known as serial access memory. Magnetic disk and tapes, as well as optical memories like CD_ROMs , employ serial access methods.[3] Semirandom Access: Memory devices such as magnetic hard disks and CD-ROMs contains many rotaing storage tracks. If each trck has its own read-write head, the tracks can be accessed randomly, but access within each track is serial. In such cases the access method is semirandom.[3] Performance: The performance of the memory system is determined using three parameters.[3] Access Time: In case of random access memory, it is the time taken by memory to complete read/write operation from the instant that an address is sent to the memoty. On the other hand, for nonrandom access memory , access time is the time it takes to position the read-write mevhanism at the desired location. Transfer Time : It is defined as the rate at which data can be transferred into or out of memory unit.[3] Physical Type: Two most common physical types used today are semiconductor memory and magnetic memory.[3] Physical characteristics : Volatile/nonvolatile if memory can hold data even if power turn off, it is called nonvolatile memory, otherwise volatile memory.[3] Memory Access time : This term is used only in cincern with random access memory and is is defined as access time plus additional time required befor a second access can commence.[3] Erasable/Nonrasable: The memories in which data is once programmed cannot be erased are called as noonerasable memories. On the hand , if data in the memory is called erasable memory.[3] The basic elememnt of semiconductor memory is the memory cell. Although a variety of electronic technologies are used, all semiconductor memory cells share certain properties: o They exhibit two stable (or smistable) status , which can be used to represent binary 1 and 0. o They are capable of being written into (at least once) , to set the state. o They are capable of being read to sense thw state. Figure 4 depicts the operation of memory cell. Most commonly, the cell has three functional terminals capable of carrying an electronic signal. The select terminal,as the name suggests, select a memory cell for a read or write operation. The control terminal indicates read or write. For writting, the other terminal provides an electroic signal the sets the state of the cell 0 or 1. For reading, that terminal is used for output of nthe cell’s state. The details of the internal organization, functioning, and timing of the memory cell depend on the specific integrated technology used and are beyond the scope of this book, except for brief summary. For our purpose, we will take it as given that individual cells can be selected for reading and writting operations.[5] Control Select Cell Control Data in (a) Write Select Cell Sense (b) Read Figure 4 Memory Cell Operation. DRAM and SRAM: Table 2 Lists are the major types of semiconductor memory. The most common is reffered to as random access memory (RAM). This is , course, a misuse of the term , because all of the types listed in the table are random access. One it is distinguishing charactertic of RAM is that it is possible both to read data from the memory and to write new data into the memory easily and rapidly.Both the reading and writting are accomplished through the use of electronic signals. The othe distinguishing characteristic of RAM is that it is volatile. A RAM must be provided with constant power supply. If the power supply is off, the data are lost. Thus, RAM can be used only as temporary storage. The two traditional forms of RAM used in computer are DRAM and SRAM.[5] Memory Type Category Erasure Write Volatiltity Mechanism Random-access memory(RAM) Read-write memory Electrically, bytelevel Electrically Read-only memory(ROM) Programmable ROM(PROM) Erasable PROM (EPROM) Electronic Erasable PROM (EEPROM) Flash memory Volatile Masks Read-only memory Not possible UV light, chip-level Read-mostly memory Electrically, Byte-level Electrically Block-level Table 2 semiconductor Memory Types Electrically Nonvolatile Dynamic RAM It is made with cells that store data as charge on capacitors. The presence or absence of the charge in a capacitor is interpreted as a binary 0 or 1. Because capacitors have a natural tendency to discharge, dynamic RAMs require periodic charge refreshing to maintain data. The term dynamic refers to this tendency of the stored charge to leak away , even with power continuously applied. Figure 5.1 is typical DRAM structurefor an individual cell that stores one bit.[5] For the Write operation , a voltage signal is applied to the bit line ; a high voltage represents 1 , qnd a low voltage represents 0. A signal is then applied to the address line , allowing a charge to be transferredto the capacitor. For Read operation, when the address line is selected , the transistor turns on and the charge on the capacitor is fed out onto a bit line and to a sense amplifier. Although the DRAM cell is used to store a signle bit (0 or 1), it is essentially analog device.[5] Address line Transistor Storage Capacitor Bit line B Ground (a) Dynamic RAM (DRAM) cell Figure 5.1 Typical Memory Cell Structure STATIC RAM It is a digital device, using the same logic elements used in the processor. In a SRAM, binary values are stored using traditional flip-flop configration . A static RAM will hold its data as long as power supplied to it. Figure 5.2b is a typical SRAM Structure for an individual cell.[5] T3 T4 C2 T6 T1 T2 Ground Bit line A Address Line Bit Line B (b) Static RAM (SRAM) cell Figure 5.1 Typical Memory Cell Structure SRAM versus DRAM: Both static and dynamic RAMs are volatile;that is, power musst be continously supplied to the memory to preserve the bit values. A dynamic memory cell is smaller and simpler than static memory cell. Thus, a DRAM is more dence (smaller cells=more cellsm per unit area) and less expensive than corresponding SRAM. DRAM requires the supporting refresh circuitry. For the larger memories , the fixed cost of the refresh circuitry is more than compensated for by the smaller variable cost of DRAM cells.Thus, DRAMs tend to be favored for large memory requirement. A final point is that SRAM is used are generally somewhat faster than DRAms. Because of these relative characteristics , SRAM is used for cache memory (both on and off chip), and DRAM is used for main memory.[5] Types of ROM: As the name suggests. A read-only memory (ROM) contains a permanent pattern of data taht cannot be changed .A ROM is nonvaltile ; that is no power source is required to maintain the bit values in memory. While it is possible to read a ROM , it is not possible to write new data into it. An important aplications of ROMs include the multiprgramming.[5] The other potential applications include : Library subroutines for frequently wanted functions. System programs. Function table. For modest-size requirement, the advantage of ROM is that the data or programs is permanently in main memory and need never be loaded from a secondray storage device. A ROM is created like any other integrated circuit chip , with data actually wired into the chip as part of the fabrication process.[5] The presence two problems: The data insertion step includes large fixed cost whether one or thousands of copies of particular ROM are fabricated. There is no room for error. If one bit is wrong , the whole batch of ROMs must be thrown out. When a small number of ROMs with a particular memory content is needed, a less expensive alternative is the programming ROM (PROM). The PROM is nonvolatile and may be written into only once. For the PROM, the writing process is performed electrically and may be performed by supplier or customer at a time than the original chip fabrication. The PROM remains attractive for high-volume production runs.[5] The optically erasable programmable read-only memory (EPROM) is read and written electrically, as with PROM. However, before a write operation, all the storage cells must be erased to the same initial state by exposure of the packaged chip to utraviolet rediation. The EPROM can be altered multiple times and it can hold its data virtually indefinitely. For comparable amount of storage, the EPROM is more expensive than PROM , but it has the advantage of the multiple update capability.[5] A more attractive form of read-mostly memory is electrically erasable programmable read-only memory (EEPROM). This is a read-mostly memory that can be written into at any time without erasing contents, only the byte or bytes addressed updated. The EEPROM combines the advantage of nonvolatility with the flexbility of being updatable in place, using ordinary bus control, address and data lines. EEPROM is more expensive than EPROM and also is less dense, supporting fewer bits per chip.[5] References: 1. John D. Carpinelli. (2001). Computer System Organisation & Architecture. USA: Addison Wesley. 2. M. Morris Mano. (2002). Computer System Architecture. India: Prentice-Hall of india private limited 3. A. P. Godse and D. A. Godse. (2008). Computer Organisation. India: technical publication pune. 4. Miles J. Murdocca and Vincent P. Heuring. (2000). Principles of Computer Architecture. USA: Prentice-Hall. 5. William Stallings. (2006). Computer Organisation & Architecture. USA: Prentice-Hall.