The memory hierarchy in a computer system is designed to balance speed, cost, and capacity.
(D) Hard Drive: Slow, large, and non-volatile storage. Used for long-term storage of programs and data.
(C) RAM (Random Access Memory): Faster than the hard drive, but volatile. Holds the data and programs currently in use by the CPU.
(A) Cache: A very small, extremely fast, and expensive type of volatile memory. It is located closer to the CPU than RAM. Its purpose is to store copies of frequently accessed data and instructions from RAM. When the CPU needs data, it checks the cache first. If the data is there (a cache hit), it can be retrieved much faster than from RAM.
(B) ROM (Read-Only Memory): Non-volatile memory that holds firmware and boot instructions. It is not used for storing frequently accessed operational data.
Therefore, Cache is the memory that holds frequently accessed data for fast retrieval.