Memory in the CPU, generally refers to hard disks, u disk, etc. can be cut off power after the equipment to save data, capacity is generally relatively large, the disadvantage is that the reading and writing speed is very slow, ordinary mechanical hard disk read and write speed is generally 50mb/s around. Memory and register is to solve the memory read and write slow production of multi-level storage mechanism, since the 1950s, the core memory has once become main memory of the primary storage medium, but from the 1970s onwards, gradually replaced by the semiconductor memory, the current computer is using semiconductor memory. Now the DDR2 memory read and write speed is generally 6~8gb/s, and the machine performance is also related.
and register (also known as the cache) is generally referred to by the basic RS trigger structure derived from the D trigger, is a number of non-gate structure, generally integrated in the CPU, its read and write speed and the speed of the CPU basically match, but because of superior performance, so expensive, generally good CPU is only a few MB of level 2 cache , the level 1 cache is smaller. The use of registers can be shortened to 0 lengths, saving storage space, and increasing instruction execution speed. Different registers have different functions, such as: General Register (GR) to hold the operand, the address of the operand or the intermediate result; the instruction register (IR) is used to hold the instruction that is currently executing in order to control the complete function of an instruction during instruction execution.
When the CPU is calculated, the data to be used is pre-read from the hard disk to the memory, and then the data to be used is read to the register. The ideal situation is that the CPU all the data can be read from the register, so read and write speed, if there is no data to use in the register, it is necessary to read from the memory and even the hard disk, so read and write data accounted for more time than the CPU operation time. So to evaluate the performance of a CPU in addition to the frequency, caching is also a very important indicator.
The difference between memory and register