Computer Logical Organization 简明教程
Memory Devices
存储器就像人脑。用于存储数据和指令。计算机内存是计算机中的存储空间,其中要处理的数据和处理所需的指令存储在其中。
A memory is just like a human brain. It is used to store data and instruction. Computer memory is the storage space in computer where data is to be processed and instructions required for processing are stored.
存储器被分成许多小部分。每个部分称为一个单元。每个位置或单元都有一个唯一的地址,范围从零到存储器大小减一。
The memory is divided into large number of small parts. Each part is called a cell. Each location or cell has a unique address which varies from zero to memory size minus one.
例如,如果计算机有 64k 个字,则该存储器单元有 64 * 1024 = 65536 个存储器位置。这些位置的地址范围从 0 到 65535。
For example if computer has 64k words, then this memory unit has 64 * 1024 = 65536 memory location. The address of these locations varies from 0 to 65535.
内存主要分为两种类型
Memory is primarily of two types
-
Internal Memory − cache memory and primary/main memory
-
External Memory − magnetic disk / optical disk etc.
当我们从上到下时,内存层次结构的特征如下。
Characteristics of Memory Hierarchy are following when we go from top to bottom.
-
Capacity in terms of storage increases.
-
Cost per bit of storage decreases.
-
Frequency of access of the memory by the CPU decreases.
-
Access time by the CPU increases.
RAM
RAM 构成 CPU 的内部存储器,用于存储数据、程序和程序结果。它是读写内存。它被称为随机存取存储器 (RAM)。
A RAM constitutes the internal memory of the CPU for storing data, program and program result. It is read/write memory. It is called random access memory (RAM).
由于 RAM 中的访问时间与该字的地址无关,即存储器内部的每个存储位置都与其他位置一样容易到达,并且需要花费相同的时间。我们可以随机且极其快速地进入内存,但也可以非常昂贵。
Since access time in RAM is independent of the address to the word that is, each storage location inside the memory is as easy to reach as other location & takes the same amount of time. We can reach into the memory at random & extremely fast but can also be quite expensive.
RAM 是易失性的,即当我们关闭计算机或断电时,存储在其中的数据将丢失。因此,计算机通常使用备用不间断电源系统 (UPS)。RAM 很小,无论是在物理尺寸方面还是能够容纳的数据量方面。
RAM is volatile, i.e. data stored in it is lost when we switch off the computer or if there is a power failure. Hence, a backup uninterruptible power system (UPS) is often used with computers. RAM is small, both in terms of its physical size and in the amount of data it can hold.
RAM 分为两种类型
RAM is of two types
-
Static RAM (SRAM)
-
Dynamic RAM (DRAM)
Static RAM (SRAM)
static 字表示只要有电源供应,内存就会保留其内容。然而,由于易失性,在电源关闭时数据丢失。SRAM 芯片使用 6 晶体管矩阵且没有电容器。晶体管不需要电力来防止泄漏,因此 SRAM 不需要定期刷新。
The word static indicates that the memory retains its contents as long as power remains applied. However, data is lost when the power gets down due to volatile nature. SRAM chips use a matrix of 6-transistors and no capacitors. Transistors do not require power to prevent leakage, so SRAM need not have to be refreshed on a regular basis.
由于矩阵中有额外空间,SRAM 用的芯片比 DRAM 多,存储空间相同,因此制造成本更高。
Because of the extra space in the matrix, SRAM uses more chips than DRAM for the same amount of storage space, thus making the manufacturing costs higher.
SRAM 用作高速小型的缓存。
Static RAM is used as cache memory needs to be very fast and small.
Dynamic RAM (DRAM)
与 SRAM 不同,DRAM 必须持续进行 refreshed 才能维持数据。做法是将内存放在刷新电路中,以每秒数百次的速度重写数据。DRAM 用作大多数系统内存,因为它便宜且小巧。所有 DRAM 都由存储单元构成。这些单元由一个电容器和一个晶体管组成。
DRAM, unlike SRAM, must be continually refreshed in order for it to maintain the data. This is done by placing the memory on a refresh circuit that rewrites the data several hundred times per second. DRAM is used for most system memory because it is cheap and small. All DRAMs are made up of memory cells. These cells are composed of one capacitor and one transistor.
ROM
ROM 代表只读存储,即只能读取但无法写入的存储器。这种类型的存储器是非易失性的。信息在制造过程中永久存储在这样的存储器中。
ROM stands for Read Only Memory. The memory from which we can only read but cannot write on it. This type of memory is non-volatile. The information is stored permanently in such memories during manufacture.
ROM 存储计算机第一次通电时启动计算机所需的指令,此操作称为引导。ROM 芯片不仅用于计算机,还用于洗衣机和微波炉等其他电子设备。
A ROM, stores such instruction as are required to start computer when electricity is first turned on, this operation is referred to as bootstrap. ROM chip are not only used in the computer but also in other electronic items like washing machine and microwave oven.
以下是各种类型的 ROM:
Following are the various types of ROM −
MROM (Masked ROM)
· 第一个 ROM 是硬接线设备,包含预编程的数据或指令集。此类 ROM 称为屏蔽 ROM,价格低廉。
The very first ROMs were hard-wired devices that contained a pre-programmed set of data or instructions. These kind of ROMs are known as masked ROMs. It is inexpensive ROM.
PROM (Programmable Read Only Memory)
· PROM 是用户只能修改一次的只读存储器。用户购买空白 PROM,并使用 PROM 编程器输入所需内容。PROM 芯片内部有小型的保险丝,在编程过程中被烧断。它只能编程一次,无法擦除。
PROM is read-only memory that can be modified only once by a user. The user buys a blank PROM and enters the desired contents using a PROM programmer. Inside the PROM chip there are small fuses which are burnt open during programming. It can be programmed only once and is not erasable.
EPROM (Erasable and Programmable Read Only Memory)
· EPROM 可以通过将其暴露于紫外线下长达 40 分钟来擦除。通常,EPROM 擦除器可实现此功能。在编程期间,电荷被困在绝缘栅区域中。此电荷保持时间超过 10 年,原因是电荷没有泄漏路径。要清除此电荷,紫外线会通过石英晶体窗口(盖子)进行照射。接触紫外线会耗散电荷。正常使用时,石英盖用贴纸密封。
The EPROM can be erased by exposing it to ultra-violet light for a duration of upto 40 minutes. Usually, an EPROM eraser achieves this function. During programming an electrical charge is trapped in an insulated gate region. The charge is retained for more than ten years because the charge has no leakage path. For erasing this charge, ultra-violet light is passed through a quartz crystal window (lid). This exposure to ultra-violet light dissipates the charge. During normal use the quartz lid is sealed with a sticker.
EEPROM (Electrically Erasable and Programmable Read Only Memory)
· EEPROM 可以通过电子方式编程和擦除。它可以擦除并重新编程约一万次。擦除和编程均大约需要 4 到 10 毫秒(毫秒)。在 EEPROM 中,可以有选择地擦除和编程任何位置。EEPROM 每次可以擦除一个字节,而不是擦除整个芯片。因此,重新编程的过程灵活但速度较慢。
The EEPROM is programmed and erased electrically. It can be erased and reprogrammed about ten thousand times. Both erasing and programming take about 4 to 10 ms (millisecond). In EEPROM, any location can be selectively erased and programmed. EEPROMs can be erased one byte at a time, rather than erasing the entire chip. Hence, the process of re-programming is flexible but slow.
Serial Access Memory
顺序访问表示系统必须从存储器地址的开始搜索存储设备,直到找到所需的数据片段为止。支持此类访问的存储设备称为顺序访问存储器或串行访问存储器。磁带是串行访问存储器的示例。
Sequential access means the system must search the storage device from the beginning of the memory address until it finds the required piece of data. Memory device which supports such access is called a Sequential Access Memory or Serial Access Memory. Magnetic tape is an example of serial access memory.
Direct Access Memory
直接访问存储器或随机存取存储器是指系统可以直接获取用户所需信息的条件。支持此类访问的存储设备称为直接访问存储器。磁盘、光盘是直接访问存储器的示例。
Direct access memory or Random Access Memory, refers to conditions in which a system can go directly to the information that the user wants. Memory device which supports such access is called a Direct Access Memory. Magnetic disks, optical disks are examples of direct access memory.
Cache Memory
高速缓存是能够加快 CPU 速度的超高速半导体存储器。它充当 CPU 和主存储器之间的缓冲区。它用于保存 CPU 最常使用的那些数据和程序部分。操作系统将数据和程序的部分从磁盘传输到高速缓存,CPU 可以从该部分访问它们。
Cache memory is a very high speed semiconductor memory which can speed up CPU. It acts as a buffer between the CPU and main memory. It is used to hold those parts of data and program which are most frequently used by CPU. The parts of data and programs, are transferred from disk to cache memory by operating system, from where CPU can access them.
Advantages
-
Cache memory is faster than main memory.
-
It consumes less access time as compared to main memory.
-
It stores the program that can be executed within a short period of time.
-
It stores data for temporary use.
Disadvantages
-
Cache memory has limited capacity.
-
It is very expensive.
虚拟存储器是一种技术,允许执行尚未完全在内存中可用的进程。此方案的主要可见优势是程序可以大于物理存储器。虚拟存储器是用户逻辑存储器和物理存储器之间的分离。
Virtual memory is a technique that allows the execution of processes which are not completely available in memory. The main visible advantage of this scheme is that programs can be larger than physical memory. Virtual memory is the separation of user logical memory from physical memory.
这种分离允许在仅提供较小物理存储器时,为程序员提供极大的虚拟存储器。当整个程序不需要完全加载到主存储器中时,以下是这种情况。
This separation allows an extremely large virtual memory to be provided for programmers when only a smaller physical memory is available. Following are the situations, when entire program is not required to be loaded fully in main memory.
-
User written error handling routines are used only when an error occurred in the data or computation.
-
Certain options and features of a program may be used rarely.
-
Many tables are assigned a fixed amount of address space even though only a small amount of the table is actually used.
-
The ability to execute a program that is only partially in memory would counter many benefits.
-
Less number of I/O would be needed to load or swap each user program into memory.
-
A program would no longer be constrained by the amount of physical memory that is available.
-
Each user program could take less physical memory, more programs could be run the same time, with a corresponding increase in CPU utilization and throughput.
Auxiliary Memory
辅助内存的尺寸远大于主内存,但速度较慢。它通常存储系统程序、指令和数据文件。它还称为二级存储器。当主内存容量超出时,它还可用作溢出/虚拟内存。二级存储器无法被处理器直接访问。先将辅助内存的数据/信息传输到主内存,CPU 随后可以访问该信息。辅助内存的特点如下所列:
Auxiliary memory is much larger in size than main memory but is slower. It normally stores system programs, instruction and data files. It is also known as secondary memory. It can also be used as an overflow/virtual memory in case the main memory capacity has been exceeded. Secondary memories cannot be accessed directly by a processor. First the data/information of auxiliary memory is transferred to the main memory and then that information can be accessed by the CPU. Characteristics of Auxiliary Memory are following −
-
Non-volatile memory − Data is not lost when power is cut off.
-
Reusable − The data stays in the secondary storage on permanent basis until it is not overwritten or deleted by the user.
-
Reliable − Data in secondary storage is safe because of high physical stability of secondary storage device.
-
Convenience − With the help of a computer software, authorised people can locate and access the data quickly.
-
Capacity − Secondary storage can store large volumes of data in sets of multiple disks.
-
Cost − It is much lesser expensive to store data on a tape or disk than primary memory.