This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:cs:chapter_3_6 [2025/01/06 14:22] – [Memory, Types and Their Functions] ktokarz | en:multiasm:cs:chapter_3_6 [2025/12/04 12:53] (current) – ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Memory, Types and Their Functions====== | ====== Memory, Types and Their Functions====== | ||
| - | The computer cannot work without | + | The computer cannot work without memory. The processor fetches instructions from memory, |
| - | The overall view of the computer memory can be represented | + | The overall view of computer memory can be represented |
| <figure memtriangle> | <figure memtriangle> | ||
| - | {{ : | + | {{ : |
| - | < | + | < |
| </ | </ | ||
| + | In the table {{ref> | ||
| + | <table memhierarchy> | ||
| + | < | ||
| + | ^ Memory type ^ Average size ^ Access time ^ | ||
| + | | Registers | ||
| + | | Cache | few megabytes | ||
| + | | RAM | few gigabytes | ||
| + | | Disk | few terabytes | ||
| + | | Network | ||
| + | </ | ||
| ===== Address space ===== | ===== Address space ===== | ||
| - | Before we start talking about details of memory we will mention the term //address space//. The processor can access instructions of the program and data to process. The question is how many instructions and data elements | + | Before we start talking about details of memory, we will mention the term //address space//. The processor can access instructions of the program and data to process. The question is how many instructions and data elements it can reach? The possible number of elements (usually bytes) represents the address space available for the program and for data. We know from the chapter about von Neumann and Harvard architectures that these spaces can overlap or be separate. |
| - | + | ||
| - | The size of the program address space is determined by the number of bits of the Instruction Pointer register. In many 8-bit microprocessors, | + | |
| - | + | ||
| - | The size of the possible data address space is determined by addressing modes and the size of index registers used for indirect addressing. In 8-bit microprocessors sometimes it is possible to join two 8-bit registers to achieve address space of the same 64k size as for the program. In PC computers program and data address spaces overlap, so the address space for data is the same as for programs. | + | |
| + | The size of the program address space is determined by the number of bits of the Instruction Pointer register. In many 8-bit microprocessors, | ||
| + | The size of the possible data address space is determined by addressing modes and the size of index registers used for indirect addressing. In 8-bit microprocessors, | ||
| ===== Program memory ===== | ===== Program memory ===== | ||
| - | In this kind of memory, the instructions of the programs are stored. In many computers (like PCs), the same physical memory is used to store the program and the data. This is not the case in most microcontrollers where the program is stored in non-volatile memory, usually Flash EEPROM. Even if the memory for programs and data is common, the code area is often protected from writing to prevent malware and other viruses from interfering with the original, safe software. | + | In this kind of memory, the instructions of the programs are stored. In many computers (like PCs), the same physical memory is used to store the program and the data. This is not the case in most microcontrollers, where the program is stored in non-volatile memory, usually Flash EEPROM. Even if the memory for programs and data is common, the code area is often protected from writing to prevent malware and other viruses from interfering with the original, safe software. |
| ===== Data memory ===== | ===== Data memory ===== | ||
| - | In data memory, all kinds of data can be stored. Here we can find numbers, tables, pictures, audio samples and everything that is processed by the software. Usually, the data memory is implemented as RAM, with the possibility of reading and writing. | + | In data memory, all kinds of data can be stored. Here we can find numbers, tables, pictures, audio samples and everything that is processed by the software. Usually, the data memory is implemented as RAM, with the possibility of reading and writing. |
| ===== Memory technologies ===== | ===== Memory technologies ===== | ||
| Line 45: | Line 53: | ||
| ===== Non-volatile memories ===== | ===== Non-volatile memories ===== | ||
| - | Non-volatile memories are used to store the data which should be preserved during the power is off. Their main application is to store the code of the program, constant data tables, and parameters of the computer (e.g. network credentials). The hard disk drive (or SSD) is also the non-volatile memory, although not directly accessible by the processor via address and data buses. | + | Non-volatile memories are used to store the data which should be preserved during the power is off. Their main application is to store the code of the program, constant data tables, and parameters of the computer (e.g. network credentials). The hard disk drive (or SSD) is also a non-volatile memory, although not directly accessible by the processor via address and data buses. |
| ===== ROM ===== | ===== ROM ===== | ||
| - | ROM - Read Only Memory is the kind of memory that is programmed by the chip manufacturer during the production of the chip. This memory has fixed content which can't be changed in any way. It was popular as a program memory in microcontrollers a few years ago because of the low price of a single chip, but due to a need for replacement of the whole chip in case of an error in the software and lack of possibility of a software update, it was replaced with technologies which allow reprogramming the memory content. Currently, ROM is sometimes used to store the serial number of a chip. | + | ROM - Read Only Memory is the kind of memory that is programmed by the chip manufacturer during the production of the chip. This memory has fixed content which can't be changed in any way. It was popular as a program memory in microcontrollers a few years ago because of the low price of a single chip, but due to the need for replacement of the whole chip in case of an error in the software and lack of possibility of a software update, it was replaced with technologies which allow reprogramming the memory content. Currently, ROM is sometimes used to store the serial number of a chip. |
| ===== PROM ===== | ===== PROM ===== | ||
| - | PROM - Programmable Read Only Memory is the kind of memory that can be programmed by the user but can't be reprogrammed further. It is sometimes called OTP - One Time Programming. Some microcontrollers implement such a memory but due to the inability of software updates, it is a choice for simple devices with a short lifetime of a product. OTP technology is used in some protection mechanisms for preserving | + | PROM - Programmable Read Only Memory is the kind of memory that can be programmed by the user but can't be reprogrammed further. It is sometimes called OTP - One Time Programming. Some microcontrollers implement such a memory, but due to the inability of software updates, it is a choice for simple devices with a short product |
| ===== EPROM ===== | ===== EPROM ===== | ||
| - | EPROM - Erasable Programmable Read Only Memory is the memory which can be erased and programmed many times. The data can be erased by shining an intense ultraviolet light through a special glass window into the memory chip for a few minutes. After erasing the chip can be programmed again. This kind of memory was very popular a few years ago but due to a complicated erase procedure, requiring a UV light source, was replaced with EEPROM. | + | EPROM - Erasable Programmable Read Only Memory is a memory which can be erased and programmed many times. The data can be erased by shining an intense ultraviolet light through a special glass window into the memory chip for a few minutes. After erasing, the chip can be programmed again. This kind of memory was very popular a few years ago, but due to a complicated erase procedure, requiring a UV light source, |
| ===== EEPROM ===== | ===== EEPROM ===== | ||
| - | EEPROM - Electrically Erasable Programmable Read Only Memory is a type of non-volatile memory that can be erased and reprogrammed many times with electric signals only. They replaced EPROM memories due to ease of use and the possibility of reprogramming without removing the chip from the device. It is designed as an array of MOSFET transistors with, so-called, floating gates which can be charged or discharged and keep the stable state for a long time (at least 10 years). In EEPROM memory every byte can be individually reprogrammed. | + | EEPROM - Electrically Erasable Programmable Read Only Memory is a type of non-volatile memory that can be erased and reprogrammed many times with electric signals only. They replaced EPROM memories due to ease of use and the possibility of reprogramming without removing the chip from the device. It is designed as an array of MOSFET transistors with so-called floating gates, which can be charged or discharged and keep the stable state for a long time (at least 10 years). In EEPROM memory, every byte can be individually reprogrammed. |
| ===== Flash EEPROM ===== | ===== Flash EEPROM ===== | ||
| - | Flash EEPROM is the version | + | Flash EEPROM is a type of non-volatile |
| ===== FRAM ===== | ===== FRAM ===== | ||
| - | FRAM - Ferroelectric Random Access Memory is the type of memory where the information is stored with the effect of change of polarity of ferroelectric material. The main advantage is that the power efficiency, access time, and density are comparable to DRAM, but without the need for refreshing and with data retention while the power is off. The main drawback is the price which limits the popularity of FRAM applications. Currently, due to their high reliability, | + | FRAM - Ferroelectric Random Access Memory is a type of memory where the information is stored with the effect of a change of polarity of ferroelectric material. The main advantage is that the power efficiency, access time, and density are comparable to DRAM, but without the need for refreshing and with data retention while the power is off. The main drawback is the price, which limits the popularity of FRAM applications. Currently, due to their high reliability, |
| ===== Volatile memories ===== | ===== Volatile memories ===== | ||
| - | Volatile | + | Volatile |
| ===== SRAM ===== | ===== SRAM ===== | ||
| - | SRAM - Static Random Access Memory is the memory used as operational memory in smaller computer systems and as the cache memory in bigger | + | SRAM - Static Random Access Memory is the memory used as operational memory in smaller computer systems and as cache memory in larger |
| ===== DRAM ===== | ===== DRAM ===== | ||
| - | DRAM - Dynamic Random Access Memory is the memory used as operational memory in bigger computer systems. Its main benefit is very high density. The information is stored as a charge in a capacitance created under the MOSFET transistor. Because every bit is implemented as a single transistor it is possible to implement a few gigabytes in a small area. Another benefit is the reduced power required to store the data in comparison to static memory. But there are also drawbacks. DRAM memory is slower than SRAM. The addressing method and the complex internal construction prolong the access time. Additionally, | + | DRAM - Dynamic Random Access Memory is the memory used as operational memory in bigger computer systems. Its main benefit is very high density. The information is stored as a charge in a capacitance created under the MOSFET transistor. Because every bit is implemented as a single transistor, it is possible to implement a few gigabytes in a small area. Another benefit is the reduced power required to store the data in comparison to static memory. But there are also drawbacks. DRAM memory is slower than SRAM. The addressing method and the complex internal construction prolong the access time. Additionally, |