In: Computer Science
Draw and clearly explain the memory hierarchy, and illustrate the relevant memory hierarchy components on the motherboard shown below. Then, compare “cache replacement policies” and ‘8-way set-associative cache mapping policies’ aspect of cache design in details in a computer with 4GB main memory and Quad-word memory configuration.
A memory unit is the collection of storage units. Based on the speed and usage the memory in a computer can be divided into five hierarchies. It can minimize the access time.
The five hierarchies in the memory are registers, cache, main memory, magnetic discs, and magnetic tapes.The first three hierarchies are volatile memories . That is when there is no power, it will lose their stored data. Whereas the last two hierarchies are not volatile which means they store the data permanently.
The memory hierarchy is classified as primary memory and secondary memory.
1. Primary memory
Primary memory is also called internal memory. The process can directly access this type of memory. Thereby we can reduce the time taken to execute an instruction. This memory contains the main memory, cache, as well as CPU registers.
2. Secondary memory
The secondary memory is also called external memory. The processor can only access this through an input/output module. This memory includes an optical disk, magnetic disk, and magnetic tape.
The memory hierarchy in computers mainly includes;
1. Registers- A register is nothing but a temporary storage area built into a CPU
2. Cache- Cache memory is used to reduce the average time to access data from the Main memory.it stores copies of the data from frequently used main memory locations.
3. Main memory- Primary memory holds only those data and instructions on which the computer is currently working.It is slower when compared to registers and cache but the price is lesser than them.
4. Magnetic disk- It is a flat disc covered with magnetic coating to hold information. It is used to store various programs and files. It is cheaper than registers, cache and main memory
5. Magnetic tape- It is a storage medium that allows for data archiving, collection, and backup. Data in this tape is written and read sequentially
Comparison of cache replacement policies and 8-way set-associative cache mapping
Cache replacement policy, the memory that is used least recently will be replaced. When the cache is full, the algorithm must choose which items to discard to make room for the new ones.
They are classified as;
8- way set-associative cache mapping can improve cache hit ratio by allowing a memory location to be placed in more than one cache block. N-Way associative cache allows placement in any block of a set where N is the number of elements.
For fixed cache capacity, higher associativity leads to higher hit rates. In this type of mapping, the associative memory is used to store content and addresses of the memory word. Thereby any block can go into any line of the cache
Please UPVOTE if you find this useful...