Is your pocket getting pinched due to the purchase of various memory devices?
If yes, it is time to turn to memory hierarchy for alternative solutions.
Brief about memory hierarchy
Based on speed and use, a computer's memory can be separated into five hierarchies.
Depending on its needs, the processor can switch between levels. Registers, main memory, cache, magnetic tapes and magnetic discs, are the five hierarchies in the memory.
The first three hierarchies are volatile memories, which means that whenever there is a power outage, their data is automatically erased. The data is permanently stored in the last two hierarchies because they are not volatile. This structure is referred to as the memory hierarchy.
The concept is based on locality, a fundamental characteristic of computer programmes. Programs with strong locality tend to repeatedly access the same set of data items or groups of nearby data items.
Programs with better locality typically access more data items from higher levels of the memory hierarchy and complete their tasks faster.
There are 5 types of computer memory in this hierarchy. The memory hierarchy is created to segregate the memories based on their speed. Following are the 5 types of memories.
=> Registers:
Located inside the CPU, Registers are the fastest type of memory. They are usually used for small partitions of memory, storing operands, etc. It is assumed that they are 32 bits long, according to the MIPS architecture. They are also the most expensive and are run using flip-flops. They are managed by compilers.
=> Cache:
Cache is another fast type of memory that can be both external and internal for a processor. It is usually used to store blocks obtained from the main memory temporarily. It can also be created by a processor and be written to the main memory later.
=> Main memory:
Main memory is a big linear array of elements of storage that is divided into dynamic and static storage. Main memory stores instructions and data that are processed during the execution of a program. If in case the data size is too much for the main memory, data can be easily paged to/from disk storage.
=> Disk storage:
Even though it is much slower than the main memory, it has more capacity than all the previous types. Since it has so much data, its processing time to search for a particular set of data is higher. Hence, we do not usually search for data here. Instead, web page the data to the main memory, where it can be found easily.
=> Archival storage:
Archival storage is the offline devices used in former years, magnetic tapes and CD-ROM jukeboxes. The access time in these disks is incredibly long. It is also not as volatile as disk data is.
Hence, among all the above-discussed hierarchies, the answer to the question of which is the fastest component in the memory hierarchy is undoubtedly Registers. Let us look at registers based on the 4 main parameters for the design storage systems.
Characteristics of Registers:
These memory types can be evaluated based on some specific characteristics.
The 4 main parameters are persistence, size usage and finally, access time.
Persistence (volatility): The data registers can be retained over several to hundreds of cycles.Size: Register data sizes range from a few hundred bites to kilobytes. Access time: Registers are the fastest memory type. Their access time is one CPU clock cycle (2- 5nsec). Usage: when it comes to fast storage of small partitions of data, then registers are the best option since they can quickly retrieve data.Types of Computer Registers:
There are various types of computer registers based on their functions.
Instructor register: This register stores the instruction, which is taken from the main memory. It holds all instruction codes which need to be executed. These instructions are then given to the Control Unit, which decodes and uses the information. It is a 16-bit register. Accumulator Register: this is also a 16-bit register that stores system results. All results produced after processing the said task or command are stored in the AC register. Address register: this 12-bit register stores the data and memory locations addresses.I/O address register: It specifies the addresses of specific I/o devices. I/O buffer register: It exchanges data between the CPU and the I/O model.Program counter: The PC holds the memory location address of the next instruction. This can be taken from the main memory upon the completion of the current instruction.Data register: it is used to store operands that are to be operated by the processor. The data which is to be transmitted to or from a peripheral device is stored here.Advantages of register memory:
There are many advantages of using register memory:
It executes all instructions faster than the main memories, and hence it is the fastest among all memory types. It is found in all computers, no matter which computer or operating system you use, there is hardly any CPU that does not have Registers.Registers make it easier for the CPUs to carry out the instructions precisely and easily.It is easy to access any data like instructions, addresses or any small data, hence making the operation efficient.Stop and wait protocol
Memory Hierarchy as we all know is based on the principle of offering better and faster storage functions for CPU. But in order to get the best in class, you need to implement a stop and wait protocol.
How will the network handle situations where the speed of data transmission at one end of a communication is significantly higher than the speed of data reception at the other end? It demands that the sender and receiver operate at a constant speed. The stop-and-wait protocol has come to light as a remedy for this issue. The sender sends a frame using this protocol, then waits for the acknowledgement. The receiver continues and sends another frame after sending an acknowledgement to the sender.
Conclusion
Registers are the fastest type of memory in the memory hierarchy. Any data can be easily accessed from registers. We need registers to be able to temporarily store data in CPUs and increase the efficiency of these operations.
Sign in to leave a comment.