We use computers to store our data, calculation of numbers, retrieving of the data, etc. The main concept of designing a computer system is storing. To do so, there is a memory storage area. There are different aspects and hardware components to help in storage of the data such as main memory, RAM, ROM, Cache, and many more divisions in it. Some of them are volatile memory storage that means, data that is not saved is lost on any power fluctuations, and some are non-volatile which means data is permanent. To manage all these aspects and to enable CPU to manipulate the data that is stored we need to understand the concept called Memory hierarchy.
CPU gets the instructions of manipulating the data from the cache memory. Cache memory is a kind of buffer which is located near to the CPU so that to allow fast storing and retrieving of data. It is temporary storage of memory and is faster. It is located on the processor chip. We can’t fit many processes on it at a time as it is smaller. So we have RAM which is Random Access memory. It is slower than the Cache as it is not directly placed on the CPU and is much larger than the cache memory. And even this is a volatile memory.
Until CPU satisfies its needs, RAM is loaded with all the instructions. But the drawback of this is, it is only available until the power I supplied and hence, we need Disk memory. To hold all the files, programs, and data when they are not in use, we use Disk memory. This is the most popular memory used by all of us.
We want our systems to be very fast in executing the processes and to store lots of data in it. But while designing the system, we always have to compromise between these two aspects. There is no system that is perfectly built satisfying these two at a time. You can build a system with a very large memory like a hard drive by compromising on the speed or else you can have the very fast memory like the registers used in the CPU, but they can store only little amounts of data for temporary purposes. This is always the case; you can’t have both at a time.
But to have the best parts of both the speed and size, we have Memory Hierarchy. You have options such as large amounts of very slow memory, very small amounts of faster memory. You can achieve huge amounts of faster memory by selecting a correct and required type of memory for data storage.
It is needed to have knowledge for the Chip designers about passing the data from man memory to hard disk, to caches from the registers to main memory from the cache. Memory management and its hierarchy need to be known by the Low-level programmers for the quick manipulation of data by writing the programs.