Sixth chapter Memory Hierarchy
A memory system is a hierarchical structure of storage devices with different capacities, costs, and access times.
Locality is a basic property of a computer program.
Memory Mountain: A method of describing the performance of a memory hierarchy on a machine.
6.1 Storage Technology
- SRAM (Static): Cache memory. Each bit is stored in a bistable memory unit. (each unit is implemented with a six-transistor circuit; its properties can be maintained indefinitely in two different elegant configurations or one of the States, and any other state is unstable)
- DRAM (dynamic): Each bit is stored as a charge to a capacitor (this capacitance is small). The storage unit is sensitive to disturbances such as light, noise, etc., and will never recover when the voltage of the capacitor is disturbed. The advantages are low density and low cost.
- The cells in the DRAM chip are divided into D-units, each of which consists of a W DRAM unit. A d*w DRAM stores information about the DW bits in total. The cells are organized into a rectangular array of R row C columns, where rc = d. The information flows into and out of the chip through the external connector of the PIN.
- Each DRAM chip is connected to a circuit called a storage controller that can transmit the W bit to each DRAM chip at once or the W bit from each chip in turn. One reason for circuit designers to organize DRAM into two-dimensional rather than linear arrays is to reduce the number of address pins on the chip.
- The DRAM chip is packaged in a memory module, which is plugged into the main version of the expansion slot.
- A disk is a storage device that holds large amounts of data, but is slow to read.
- Disks are made up of several platters, sealed in containers (disk drives), and each platter has a set of concentric circles called tracks, each of which is separated by some gaps into a set of equal capacity tracks (usually 512 bytes), and a formatted bit that identifies the sector is stored in the gap. Two.
- Cylinder: The set of tracks equal to the center of the spindle at all the disc surfaces
- PROM: can only be programmed once.
- Erasable writable programming ROM (EPROM): The number of erase and rewrite times can reach 10^3 times
- Electronic erasable Prom (EEPROM): Can be programmed to reach 10^3 times.
- Flash: EEPROM-based. A program based on this disk drive called a SSD stored in a ROM device is usually called a firmware; when a computer system is powered on, it runs the firmware stored in the ROM
- Capacity refers to the maximum number of digits that can be recorded on a disk. Determining factors:
- Recording density, track density, surface density (first product)
- The reading and writing is accomplished by connecting the reading and writing head of the transmission arm, and can be positioned on any track on the disc; such mechanical motion is called seeking. Each disk face corresponds to a read-write head. All read and write heads act in unison, that is, at any one time, all reads and writes occur on the same disk surface.
6.2 Local Sex
- Computer programs tend to refer to data that is adjacent to other recently referenced data items or to itself; this tendency is called the principle of locality. Include: Temporal locality, spatial locality. Programs that have good locality are faster than programs that have poor local performance.
- Embodiment: In the hardware layer, the local principle allows the computer designer to save the most recently referenced instruction and data items by introducing a small and fast memory called a cache, at the operating system level, the local principle allows the system to use main memory as a disk block that is most recently used in the virtual address space.
- The procedure of repeatedly referencing a variable has good time locality, and for taking instruction, the loop has good time and space locality. The smaller the loop body, the more the loop iteration number, the better the locality.
6.3 Memory Hierarchy
- The central idea of the memory hierarchy is that for each k, the faster and smaller storage devices located on the K-tier act as caches of larger and slower storage devices at the (k+1) layer.
- The memory of the (k+1) layer is divided into successive data object slices, called blocks, and the data is always copied back and forth between the two adjacent layers with the block size as the transmitting unit; At any moment, the cache of the K layer includes a copy of a subset of The Block (k+1).
- Cache Hit: When the program requires the data Object D of the k+1 layer, the first is to find d at level K; if D is just cached at level K, then it is called a cache hit;
- If the cache is not hit, then the K-tier cache removes the block containing the data from the (k+1) layer, potentially overwriting the existing block. Overwrite = decide which block to replace is controlled by a cache substitution policy; For example, a cache with a random substitution policy is randomly selected, while the LRU substitution policy chooses the block that is accessed the farthest from now
6.4 Cache Memory
- Function: Connect CPU and Main memory
- Each memory address has a M-bit, which forms m=2^m different addresses. This m-bit is divided into T-marker bits, S-Group index bits, and B-block-biased shifts.
- The cache of such a machine is organized into an array of s=2^s cache groups, each containing an e cache line, each row consists of a b=2^b byte block, a valid bit (indicating whether the row contains valid information), t=m-(B+s) Tag bits, which uniquely identify blocks stored in this cache line
- The cache determines whether a request is hit and then jerks the process of the requested word, divided into: Group selection, line matching, word extraction
- Group selection: Extracts the group index from the address of W, which is interpreted as an unsigned integer corresponding to a group number
- Row matching: For direct map caching, row matching is easy and fast because each group has only one row
- Word match: The block offset provides the position from which the first byte of the word begins.
Information Security System Design Foundation Sixth Week study summary