Summary

This document discusses computer memory types, encompassing primary memory (RAM and ROM), secondary memory, and cache memory. It provides a breakdown of different memory technologies and their characteristics. The document also compares various RAM types such as SRAM and DRAM.

Full Transcript

# MEMORY ## Units of Memory: * The smallest unit is _bit_, which means either 0 or 1. * 1 bit = 0 or 1 * 1 Byte = 8 bit * 1 Nibble = 4 bit * 1 Kilo Byte = 1024 Byte = 2<sup>10</sup> Byte * 1 Mega Byte = 1024 KB = 2<sup>10</sup> KB * 1 Gega Byte = 1024 MB = 2<sup>10</sup> MB * 1 Tera Byte = 1024 GB...

# MEMORY ## Units of Memory: * The smallest unit is _bit_, which means either 0 or 1. * 1 bit = 0 or 1 * 1 Byte = 8 bit * 1 Nibble = 4 bit * 1 Kilo Byte = 1024 Byte = 2<sup>10</sup> Byte * 1 Mega Byte = 1024 KB = 2<sup>10</sup> KB * 1 Gega Byte = 1024 MB = 2<sup>10</sup> MB * 1 Tera Byte = 1024 GB = 2<sup>10</sup> GB * 1 Peta Byte = 1024 TB = 2<sup>10</sup> TB * 1 Exa Byte = 1024 PB = 2<sup>10</sup> PB * 1 Zetta Byte = 1024 EB = 2<sup>10</sup> EB * 1 Yotta Byte = 1024 ZB = 2<sup>10</sup> ZB ## Secondary Memory * Secondary Memory is also known as external memory or non-volatile memory. * It is slower than the main memory. * It is used for storing data/information permanently. * CPU directly does not access these memories, instead, they are accessed via input-output routines. * The contents of secondary memories are first transferred to the main memory, and then the CPU can access it. * For example, disk, CD-ROM, DVD, etc. ### Characteristics of Secondary Memory * These are magnetic and optical memories. * It is known as the backup memory. * It is a non-volatile memory. * Data is permanently stored even if power is switched off. * It is used for storage of data in a computer. * Computer may run without the secondary memory. * Slower than primary memories. ## Memory Types ### I. Secondary Memory ### II. Primary Memory #### a) RAM * i. SRAM * ii. DRAM #### b) ROM * i. PROM * ii. EPROM * iii. EEPROM * iv. Flash Memory #### c) Hybrid * i. EEPROM * ii. NVRAM * iii. Flash Memory #### d) Cache Memory #### e) Virtual Memory ***Diagram of Memory Types*** The image illustrates a generic computer with the memory classifications for each type. * **Primary Storage:** * **Central Processing Unit:** Contains registers, logic unit, and the cache memory. * **Main Memory:** Random access memory, 256-1024 MB. * **Secondary Storage:** * **Mass Storage Device:** Hard Disk, 20-120 GB. * **Removable Media Drive:** CD-RW, DVD- RW drive. * **Off-line Storage:** * **Removable Medium:** CD-RW, 650 MB. * **Tertiary Storage:** * **Removable Media Drive:** * **Removable Medium:** * **Robotic Access System:** * **Removable Medium:** ## Memory Classification * **Main Memory** or **primary memory** is divided into two types: * **RAM (Random Access Memory)** * **ROM (Read Only Memory)** * The memory which is in direct contact of CPU is known as primary memory. RAM and ROM both remain in direct contact of CPU. ### Random Access Memory (RAM) * It is also called as read write memory or the main memory or the primary memory. * The programs and data that the CPU requires during execution of a program are stored in this memory. * It is a volatile memory as the data loses when the power is turned off. * Relatively cheap per megabyte stored compared to ROM, but relatively expensive compared to secondary memory. * It is not possible to imagine processing without RAM. * The efficiency of RAM depends upon the size (capacity) of RAM. RAM supports both read and write operations. * RAM is further classified into two types: * **SRAM (Static Random Access Memory)** * **DRAM (Dynamic Random Access Memory)** ***Diagram of RAM Types*** "Types of Memory" diagram. The diagram shows two levels of memory and their classifications. The top level is titled "RAM" and includes "SRAM", "DRAM". The bottom level is titled "ROM" and includes "PROM", "EPROM", "EEPROM". ## RAM * The RAM family includes two important memory devices: static RAM (SRAM) and dynamic RAM (DRAM). * **Volatile memory** is computer memory that requires power to maintain the stored information. Most modern semiconductor volatile memory is either Static RAM or dynamic RAM. * The primary difference between them is the lifetime of the data they store. * **1)** SRAM retains its contents as long as electrical power is applied to the chip. If the power is turned off or lost temporarily, its contents will be lost forever. * **2)** DRAM, on the other hand, has an extremely short data lifetime - typically about four milliseconds. This is true even when power is applied constantly. A DRAM controller is used to refresh the data before it expires; the contents of memory can be kept alive for as long as they are needed. So DRAM is as useful as SRAM after all. ## SRAM vs. DRAM | STATIC RAM | DYNAMIC RAM | | ----------- | ----------- | | Does not require refreshing | Must be continuously refreshed | | Requires multiple transistors to store one bit | Requires one transistor and one capacitor to store one bit | | Delivers faster access times | Delivers slower performance | | Consumes less power, especially in idle | Consumes more power | | Takes up more space | Requires less space | | Can hold only a small amount of data | Can hold much more data | | Costs more than DRAM | Costs less than SRAM | | Typically used for a processor's cache | Typically used for a computer's main memory | ***Diagram of Memory Speed and Capacity*** A pyramid depicting memory speed and capacity. The top-most layer represents the fastest and smallest memory, "Computer Chip". The next layer is "SRAM", with three layers of "SRAM". The layer below is "DRAM". The next layer is "NAND", with three layers of "NAND". The bottom layer is "DISK". The pyramid is tilted at an angle. A thick blue arrow points up, indicating an increase in speed and a decrease in capacity. ## Types of RAM * **Double Data Rate synchronous dynamic random access memory** or also known as **DDR1 SDRAM** is a class of memory integrated circuits used in computers. * The interface uses double pumping (transferring data on both the rising and falling edges of the clock signal) to lower the clock frequency. * One advantage of keeping the clock frequency down is that it reduces the signal integrity requirements on the circuit board connecting the memory to the controller. ## DDR2, DDR and SDRAM * DDR2 memory is fundamentally similar to DDR SDRAM. * Still, while DDR SDRAM can transfer data across the bus two times per clock, DDR2 SDRAM can perform four transfers per clock. * DDR2 uses the same memory cells, but doubles the bandwidth by using the multiplexing technique. * The DDR2 memory cell is still clocked at the same frequency as DDR SDRAM and SDRAM cells, but the frequency of the input/output buffers is higher with DDR2 SDRAM. * The bus that connects the memory cells with the buffers is twice wider compared to DDR. * Thus, the I/O buffers perform multiplexing: the data is coming in from the memory cells along a wide bus and is going out of the buffers on a bus of the same width as in DDR SDRAM, but of a twice bigger frequency. * This allows to increase the memory bandwidth without increasing the operational frequency. ***Diagram of DDR Technology*** Three diagrams depicting the evolution of DDR technology. * **SDR:** Shows a memory cell connected to a I/O buffer. * DRAM core frequency: 100MHz * Clock frequency: 100MHz * Data bus speed: 100Mbps * **DDR-I:** Shows a memory cell connected to a I/O buffer. * DRAM core frequency: 100MHz * Clock frequency: 100MHz * Data bus speed: 200Mbps * **DDR-II:** Shows a memory cell connected to a I/O buffer. * DRAM core frequency: 100MHz * Clock frequency: 200MHz * Data bus speed: 400Mbps ## DRAM Types Summary | DRAM Names | Release Year | BUS Clock (Frequency in MHz) | Data Transfer Rate (MT/S) | Operating Voltage | Memory Topology | Prefetch | Memory Module Connection Type | | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | | SDRAM | 1993 | 100~166 | 100-166 | 3.3V | T-Branch | 1n | Multi-branch | | DDR | 2000 | 133~200 | 266~400 | 2.5V | T-Branch | 2n | Multi-branch | | DDR2 | 2003 | 266~400 | 533~800 | 1.8V | T-Branch | 4n | Multi-branch | | DDR3 | 2007 | 533-800 | 1066~1600 | 1.5V | Fly-by | 8n | Multi-branch | | DDR4 | 2014 | 1066~1600 | 2133~3200 | 1.2V | Fly-by | 8n | Point-to-point | | DDR5 | 2019 | 1600~3200 | 3200~6400 | 1.1V | Fly-by | 16n | Point-to-point | ***Diagram of DDR Generations Comparison*** Table showing comparison of different DDR generations. Divided into several columns, including, but not limited to: * **Name:** Indicates SDRAMs, and DDR1 to DDR5. * **Standard Year:** Shows the year each generation was introduced. * **Clock Cycle (MHz):** Shows the clock cycle times for each generation. * **Clock Cycle Time (ns):** Shows the clock cycle time in nanoseconds. * **Data Transfers (MT/S):** Shows the data transfer rate per second. * **Bandwidth (MB/s):** Shows the bandwidth in megabytes per second. * **Operating Voltage (V):** Shows the operating voltage. * **Bus Width (bits):** Shows the bus width. * **Prefetch (n):** Shows the prefetch value for every generation. * **SO-DIMM (mm):** Shows the SODIMM size. * **Pins:** Shows the number of pin connections. ## Types of ROM * Memories in the ROM family are distinguished by the methods used to write new data to them (usually called _programming_), and the number of times they can be rewritten. * This classification reflects the evolution of ROM devices from hardwired to programmable to erasable-and-programmable. * A common feature is their ability to retain data and programs forever, even during a power failure. * The contents of the ROM had to be specified before chip production, so the actual data could be used to arrange the transistors inside the chip. ## Types of ROM * **PROM (Programmable ROM)** * **EPROM (Erasable Programmable ROM)** * **EEPROM (electrically erasable programmable ROM)** * **Flash EPROM** * **Mask ROM** ***Diagram of ROM Types*** A diagram showing the types of ROM memory. The center circle is "ROM". Surrounding the circle are five other circles labeled: * "Mask ROM" * "Flash EPROM" * "EPROM Erasable programmable ROM" * "PROM Programmable ROM" * "EEPROM Electrically Erasable Programmable ROM" ## PROM * One step up from the masked ROM is the PROM (programmable ROM), which is purchased in an unprogrammed state. * If you were to look at the contents of an unprogrammed PROM, the data is made up entirely of 1's. * The process of writing your data to the PROM involves a special piece of equipment called a device programmer. * The device programmer writes data to the device one word at a time by applying an electrical charge to the input pins of the chip. * Once a PROM has been programmed in this way, its contents can never be changed. * If the code or data stored in the PROM must be changed, the current device must be discarded. * As a result, PROMs are also known as _one-time programmable (OTP)_ devices. ## PROM * **PROM (programmable ROM)** and **OTP** * PROM refers to the kind of ROM that the user can burn information into. In other words, PROM is a _user-programmable memory_. * For every bit of the PROM, there exists a fuse. * PROM is programmed by blowing the fuses. * If the information burned into PROM is wrong, that PROM must be discarded since its internal fuses are blown permanently. * For this reason, PROM is also referred to as OTP (One Time Programmable). * Programming ROM, also called burning ROM, requires special equipment called a ROM burner or ROM programmer. ## EPROM (erasable programmable ROM) and UV-EPROM * EPROM was invented to allow making changes in the contents of PROM after it is burned. * In EPROM, one can program the memory chip and erase it thousands of times. This is especially necessary during the development of the prototype of a microprocessor-based project. * A widely used EPROM is called UV-EPROM, where UV stands for ultraviolet. * The only problem with UV-EPROM is that erasing its contents can take up to 20 minutes. * All UV-EPROM chips have a window through which the programmer can shine ultraviolet (UV) radiation to erase the chip's contents. * For this reason, EPROM is also referred to as _UV-erasable EPROM_ or simply UV-EPROM. ## EPROM (erasable programmable ROM) and UV-EPROM ### Programming a UV-EPROM: * To program a UV-EPROM chip, the following steps must be taken: * Its contents must be erased. To erase a chip, remove it from its socket on the system board and place it in EPROM erasure equipment to expose it to UV radiation for 5-20 minutes. * Program the chip. To program a UV-EPROM chip, place it in the ROM burner (programmer). To burn code or data into EPROM, the ROM burner uses 12.5 volts or higher, depending on the EPROM type. This voltage is referred to as Vpp in the UV-EPROM datasheet. * Place the chip back into its socket on the system board. * As can be seen from the above steps, not only is there an EPROM programmer (burner), but there is also separate EPROM erasure equipment. ## EPROM (erasable programmable ROM) and UV-EPROM * The main problem, and indeed the major disadvantage of UV-EPROM, is that it cannot be erased and programmed while it is in the system board. * To provide a solution to this problem, EEPROM was invented. ## Hybrid types * As memory technology has matured in recent years, the line between RAM and ROM has blurred. Now, several types of memory combine features of both. * These devices do not belong to either group and can be collectively referred to as _hybrid memory devices_. * Hybrid memories can be read and written as desired, like RAM, but maintain their contents without electrical power, just like ROM. * Two of the hybrid devices, EEPROM and flash, are descendants of ROM devices. * These are typically used to store code. * The third hybrid, NVRAM, is a modified version of SRAM. * NVRAM usually holds persistent data. ## EEPROMs * EEPROMs are _electrically-erasable-and-programmable_. * Internally, they are similar to EPROMs, but the erase operation is accomplished electrically, rather than by exposure to ultraviolet light. * Any byte within an EEPROM may be erased and rewritten. Once written, the new data will remain in the device forever - or at least until it is electrically erased. * The primary tradeoff for this improved functionality is higher cost, though write cycles are also significantly longer than writes to a RAM. So you wouldn't want to use an EEPROM for your main system memory. ## Flash memory * Flash memory combines the best features of the memory devices described thus far. * Flash memory devices are high density, low cost, nonvolatile, fast (to read, but not to write), and electrically reprogrammable. * These advantages are overwhelming and, as a direct result, the use of flash memory has increased dramatically in embedded systems. * From a software viewpoint, flash and EEPROM technologies are very similar. * The major difference is that flash devices can only be erased one sector at a time, not byte-by-byte. * Typical sector sizes are in the range 256 bytes to 16KB. * Despite this disadvantage, flash is much more popular than EEPROM and is rapidly displacing many of the ROM devices as well. ## Mask ROM * Mask ROM refers to a type of ROM in which the contents are programmed by the IC manufacturer. In other words, it is not a user-programmable ROM. * The term _mask_ is used in IC fabrication. Since the process is costly, mask ROM is used when the needed volume is high (hundreds of thousands) and it is absolutely certain that the contents will not change. * It is common practice to use UV-EPROM or Flash for the development phase of a project, and only after the code/data have been finalized is the mask version of the product ordered. * The main advantage of mask ROM is its cost since it is significantly cheaper than other kinds of ROM, but if an error is found in the data/code, the entire batch must be thrown away. * It must be noted that all ROM memories have 8 bits for data pins; therefore, the organization is x8. ## Difference between RAM and ROM | RAM | ROM | | ----------- | ----------- | | Temporary Storage. | Permanent storage. | | Store data in MBs. | Store data in GBs. | | Volatile. | Non-volatile. | | Used in normal operations. | Used for startup process of computer. | | Writing data is faster. | Writing data is slower. | **Note:** The most important things to understand about RAM are that RAM memory is very fast, it can be written to as well as read, it is volatile (so all data stored in RAM memory is lost when it loses power) and, finally, it is very expensive compared to all types of secondary memory. Read-only memory (ROM) is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device. RAM is costlier than ROM as it involves more complex technology to store information & also it is very much faster than ROM. ## Cache Memory * A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. * The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations. * As long as most memory accesses are cached memory locations, the average latency of memory accesses will be closer to the cache latency than to the latency of main memory. * When the processor needs to read from or write to a location in main memory, it first checks whether a copy of that data is in the cache. If so, the processor immediately reads from or writes to the cache, which is much faster than reading from or writing to main memory.

Use Quizgecko on...
Browser
Browser