Home > Article > System Tutorial > A brief discussion on the relationship between CPU, memory, virtual memory and hard disk
Everyone knows that assembling a computer requires CPU hard disk, memory and other hardware. The system also contains virtual memory. However, you may not understand the relationship between them! Below, I will introduce the relationship to you in the most concise and easy-to-understand language!
CPU is the central processing unit, which is the abbreviation of "Central Processing Unit" in English. The CPU fetches instructions from memory or cache, puts them into the instruction register, decodes and decomposes the instructions into a series of micro-operations, and then issues various control commands to execute the micro-operation series to complete the execution of system instructions.
However, the CPU cannot directly call the system, programs and data stored on the hard disk. The relevant contents of the hard disk must first be stored in the memory so that it can be read and run by the CPU. Therefore, memory (that is, physical memory, as opposed to the "external memory" of the hard disk), as a "transfer station" between the hard disk and the CPU, has a great impact on the running speed of the computer.
When the running data exceeds the capacity of the physical memory, part of the data will "overflow" on its own. At this time, the system will simulate part of the space on the hard disk as memory - virtual memory, and will temporarily not run programs or Unused data is stored in this part of the space for easy and timely recall when needed.
Since the memory is stored live (the data will disappear once the power is turned off), and the capacity is limited, a hard disk (external memory) is required to store programs or data for a long time. The hard disk also affects system speed, because the speed at which the system reads data from the hard disk and stores it into memory through the bus also affects how fast the system runs.
——As for the metaphor of some online articles: "CPU is a factory, hard disk is a large warehouse, memory is a regular transfer center, and virtual memory is a temporary transfer center", it is roughly close to reality, but not completely accurate.
The above is the detailed content of A brief discussion on the relationship between CPU, memory, virtual memory and hard disk. For more information, please follow other related articles on the PHP Chinese website!