Computer Architecture : Memory Hierarchy

Memory hierarchy a concept that is necessary for the CPU to be able to manipulate data. Memory hierarchy describes each level of computer storage by response time. Memory is categorized into volatile and nonvolatile memories. Volatile memory us a memory that losses its contents when the computer or hardware losses power or switched off and, Non-Volatile Memory is memory that keeps its contents even if the power is lost. A typical computer system provides a hierarchy of different types of memories for data storage. To identify the behavior of various memories certain characteristics are considered. On the basis of their data access speed, location inside the computer, memory can be placed in four groups :

  • CPU Registers
  • Cache Memory
  • Main Memory  (Primary Memory)
  • Auxiliary Memory (Secondary Memory)


CPU Registers : A processor Register or simply A Register is a very fast computer memory, used to store data/instruction in-execution. Register is a quickly accessible location available to a computer's central processing unit (CPU). Registers are speed up CPU's operations by providing quick access to commonly used values such as an instruction, a storage address, or any kind of data (such as a bit sequence or individual characters). Registers are the top of the memory hierarchy and are the fastest way for the system to manipulate data. Registers are normally measured by the number of bits they can hold, for example, an 8-bit register means it can store 8 bits of data or a 32-bit register means it can store 32 bit of data. A Register is a group of flip-flops with each flip-flop capable of storing one bit of information. An n-bit register has a group of n flip-flops and is capable of storing binary information of n-bits. A register consists of a group of flip-flops and gates. The flip-flops hold the binary information and gates control when and how new information is transferred into a register. Registers are used to store data temporarily during the execution of a program. Some of the registers are accessible to the user through instructions. Data and instructions must be put into the system.

Cache Memory : Cache is the fastest accessible memory of a computer system. It's access speed is in the order of a few nanoseconds. It is volatile and expensive, so the typical cache size is in the order of megabytes. It is placed between CPU registers and main memory. The cache memory is used to store program data which is currently being executed in the CPU. The data or contents of the main memory that are used again and again by CPU, are stored in the cache memory so that we can easily access that data in shorter time. Whenever the CPU needs to access memory, it first checks the cache memory. If the data is not found in cache memory then the CPU moves onto the main memory. It also transfers block of recent data into the cache and keeps on deleting the old data in cache to accomodate the new one. The capacity if a cache memory is less then main memory. But in terms of speed and access time ratio, it is faster than the main memory because some or all of it can reside on the same IC as the CPU. Approximate access time ratio between cache memory and main memory is about 1 to7~10. Cache memories are essential components of high performance computers. 

Main Memory : The memory unit that communicates directly within the CPU, Auxillary memory and Cache memory, is called main memory. The Main Memory size is larger than cache memory and it has very fast speed to access programs and data stored in external memory. It communicates directly with the CPU. The Main Memory is slower compared to CPU registers and cache memory. It is also known as Primary Memory. Main memory is made up of RAM and ROM, with RAM integrated circuit chips holing the major share. Main memory is arguably the most used memory. When discussing computer algorithms such as quick sort, balanced binary sorted trees, or fast Fourier transform, one typically assumes that the algorithm operates on data stored in the main memory. The main memory is reasonably fast, with access speed around 100 nanoseconds. It also offers larger capacity at a lower cost. However, the main memory is volatile.

Auxiliary MemoryAuxiliary memory is much larger in size than main memory but is slower. It normally stores system programs, instruction and data files. It is also known as secondary memory. It can also be used as an overflow/virtual memory in case the main memory capacity has been exceeded. Secondary memories cannot be accessed directly by a processor. First the data/information of auxiliary memory is transferred to the main memory and then that information can be accessed by the CPU. Auxiliary memory usually consists of magnetic disk and tape, which is much less expensive than RAM, but also much slower. Disks are used to store programs and data that are not currently in use. When a program is executed, it is loaded from disk into main memory. The program may then load data from disk into memory for processing. Main memory is arguably the most used memory. When discussing computer algorithms such as quick sort, balanced binary sorted trees, or fast Fourier transform, one typically assumes that the algorithm operates on data stored in the main memory. The main memory is reasonably fast, with access speed around 100 nanoseconds. It also offers larger capacity at a lower cost.





Next Topic :

No comments:

Post a Comment