To reduce the idle time of the CPU and increase the speed of processing, a fast memory can be used. This can be done by using a large size of main memory. But the cost of main memories of relatively large size is still very high. To reduce the cost of a large sized memory, a special type of high speed memory, known as cache memory can be used in between the CPU and the main memory (as shown in Figure). Thus the cost versus access time leads to a hierarchy of computer memory, where the memory is organized into a hierarchy, known as the memory hierarchy. This includes CPU registers, Cache memory, main memory and various secondary storage devices. Although the memory hierarchy is organized in such a way to minimize the cost, without compromising the overall speed of access.