Computer Science Tutorial
An Introduction to Interleave Memory
What is interleaved memory?Memory interleaving is a concept of dividing the main memory in a number of modules or banks with each module interacting with processor independent of others. Each memory modules has its own memory address register and data register. Memory Address Register(MAR) is connected with common unidirectional memory bus and data register is connected with common data bus.
When CPU requests a data, it sends the address to memory via common memory bus. The address is saved in the memory address register. The data is now retrived from module and kept in data register, from where it is sent to the cpu via common data bus.
Now the question arises, how does CPU determines in which memory bank or module data resides. To understand this scenario we take an example of a two way interleaved memory. In a two way interleaved memory, main memory is divided into two modules in such a way that all the positive addresses are in first module and rest all odd addresses are in second module. So, all the positive addresses go to first module and so on. We can also say that, least significant bit of the memory address specifies the address of the module. That is if LSB is 0, first module is selected and if LSB is 1, second module is selected. If it is a four way interleaved memory then least two significant bits of memory address is used to specify the memory module.
Benefits of interleaved memory
An instruction pipeline may require instruction and operands both at the same time from main memory which is not possible in the traditional method of memory access. Similarly arithmatic pipeline requires two operands to be fetched at the same time form main memory. So, to overcome this problem memory interleaving comes as a rescue. It allows simultaneous access to different modules of memory. The modular memory technique allows CPU to initiate memory acces with one module while othere amy be busy with cpu in read or write operations. So, we can say interleave memory honors every memory request independent of the state of the other modules.
So, because of this obvious reason, interleave memory makes a system more responsive and fast compared to non interleaving. Additionaly, with simultaneous access to memory the cpu processing time also decreases, resulting in increase in throughput. Interleave memory is useful in system with pipelining and vector processing.
In an interleaved memory, consecutive memory addresses are spread across different memory modules. Say, in a byte addressable 4 way interleave memory if byte 0 is in first module, then byte 1 will be in second module, byte 2 will be in third module, byte 3 will be in 4th module and again byte 4 will fall in first module, and this goes on.
An n-way interleaved memory where main memory is divided into n-banks and system can access n operands/instruction simultaneously from n differtent memory banks. This kind of memory access can reduce the memory access time by a factor close to the number of memory banks. In this memory interleaving memory location i can be found in bank i mod n.
Types of interleaved memory
- High order interleaving
- Low order interleaving
One major difference between high order and low order interleaving is, consecutive memory location is found in the same memory module in high order interleaving. But in low order interleaving consecutive memory location is found in consecutive banks.
BN Computer Academy
All Rights Reserved