Home > Common Problem > body text

What is cache?

王林
Release: 2023-02-10 11:14:28
Original
13359 people have browsed it

cache is a cache memory, which is located between the CPU and the main memory DRAM. It is small in size but high in speed and is usually composed of SRAM. The write operation of cache is relatively complex. Commonly used methods include write-through method, write-back method and mark method.

What is cache?

The operating environment of this article: Windows 7 system, Dell G3 computer.

Cache memory is a high-speed cache memory in a computer. It is a small but high-speed memory located between the CPU and the main memory DRAM (Dynamic Random Access Memory). It is usually composed of SRAM (Static Random Access Memory static memory). It is a small-capacity but high-speed memory located between the CPU and the memory.

The speed of the CPU is much higher than that of the memory. When the CPU directly accesses data from the memory, it has to wait for a certain period of time, while the Cache can save a part of the data that the CPU has just used or recycled. If the CPU needs to access data again, When using this part of the data, it can be called directly from the Cache, thus avoiding repeated access to data and reducing the waiting time of the CPU, thus improving the efficiency of the system. Cache is divided into L1Cache (level one cache) and L2Cache (level two cache). L1Cache is mainly integrated inside the CPU, while L2Cache is integrated on the motherboard or CPU.

Write operation:

Because it is necessary to ensure that the data cached in the Cache is consistent with the content in the memory, the write operation of the Cache is relatively complex. Commonly used methods include write direct method, write back method and mark. Law.

Related expansion introduction:

Memory is a collection of many storage units, arranged in order of unit numbers. Each unit is composed of a number of binary bits to represent the value stored in the storage unit. This structure is very similar to the structure of an array, so in the VHDL language, an array is usually used to describe the memory.

Memory is a memory component used to store programs and various data information. Memory can be divided into two categories: main memory (referred to as main memory or memory) and auxiliary memory (referred to as auxiliary memory or external memory). It is the main memory that directly exchanges information with the CPU.

The working method of main memory is to store or read various types of information according to the address of the storage unit, collectively referred to as access memory. The carrier that collects storage units in the main memory is called a memory bank. Each unit in the memory bank can store information represented by a string of binary codes. The total number of bits of this information is called the word length of a storage unit. There is a one-to-one correspondence between the address of the storage unit and the information stored in it. There is only one unit address, which is fixed, but the information stored in it can be replaced.

The binary code indicating each unit is called the address code. When looking for a certain unit, first give its address code. The register that temporarily stores this address code is called the memory address register (MAR). In order to store information taken out from the storage unit of the main memory or information to be stored in a certain storage unit, a memory data register (MDR) is also set up.

(Learning video sharing: Programming video)

The above is the detailed content of What is cache?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template