what is the difference between cache & register ? Cache memory is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM. As the microprocessor processes data, it looks first in the cache memory and if it finds the data there (from a previous reading of data), it does not have to do the more time-consuming reading of data from larger memory.
The register is a small set of data holding places that are part of a computer processor . A register may hold a computer instruction , a storage address, or any kind of data (such as a bit ..."
Chat with our AI personalities
A register is a memory directly accessible under program control to the CPU for some purpose. Most registers are of small size (e.g. one word, one byte). Some types of registers and what they do are:
The cache memory is a memory between the CPU and main memory used to "cache" commonly used locations of main memory so that the fast CPU does not have to wait for the slower memory access on every memory cycle. The cache memory is organized into "lines" of several adjacent words of memory (e.g. 4 words, 16 words, 64 words) depending on the computer and memory architecture. The CPU has no direct control over what is in cache memory, this is handled by a cache controller. In some computer architectures the CPU can request that the cache controller perform actions like "flush line", "invalidate line", or "preload line" but in general these are treated more like suggestions than required instructions by the cache controller
Even though both memory hold data, the register holds data temporary, i.e. data waiting to be execute by the CPU, while in the case of main memory, it holds information/data permanently. the register is smaller in capacity, while the memory is larger in capacity. the register serves as an assistance to the main memory, i.e. in situation where the data to be handled by the it is much more than what it can hand, so the register comes in handy.
Cache memory is a special high speed memory that acts as a buffer between the processor and slower memory. Nowadays, the cache memory is in the CPU and not a separate bank of memory on the motherboard like there was back in the 386/486 days.
A register is a special area of memory in the processor which is 1-8 bytes long. That is where the operations take place. Now, modern processors have many more registers than the official named ones (like EAX, EBX, ECX, and so on). They need them for hyperthreading, out of order processing, optimization, and more. Modern processors probably use tricks like aliasing and cloning. They may change the names of the registers in the middle of operations. Now, there are times when an extra register to be used as a buffer is needed. One would be if the result will end up in the register of one or more of the operands. Another would be if the memory isn't ready to accept a result and the CPU needs to continue. Memory contention could be another reason for a buffer register. Or, an operand mismatch is another. If you have to access the memory with a certain size, but the CPU needs another size, then it would have to go to the buffer register and the correct size pulled from there. The buffer register also allows the memory and processor to act independently of each other.