Memory System
Memory System
Interleaving
Sudhansu Ranjan Lenka
Basic Concepts
• Memory system stores the program and data from which the
processor fetches the instructions to execute at the processing
subunits.
• The processor could place the processed data into the memory for
future reference.
• A 16 bit computer that generates 16 bit addresses is capable of
addressing upto 216 = 64k memory location.
• The data transfer between memory and processor takes place
through two processor registers:
1. MAR
2. MDR.
Q. How many separate address lines and data lines are needed for a
memory capacity 8M x 32 .
Miss Ratio = miss / (hit + miss) = no. of miss/total accesses = 1 - hit ratio(H)
• Average access time of any memory system consists of two levels: Cache and Main Memory.
• If Tc is time to access cache memory and Tm is the time to access main memory then we can write:
Average time to access memory (Tavg)=
For simultaneous access Tavg = H * Tc + (1-H)*Tm
For hierarchial access Tavg = H * Tc + (1-H)*(Tm + Tc)
• Miss penalty: The extra time needed to bring the desired information into cache is called miss penalty. This
refers to main memory access time if miss occurs.
Tag Block 0
• In AM a main memory block can be map to any cache
location.
Block 1
Tag • Suppose total no. blocks in main memory is 4096=2 12 .
... • So a 12 bit tag is used to identify the location of the
Tag
main memory block in cache.
Block 127
Tag • The higher order 12bits of memory address of the
memory address is compared to the tag bits of each
15 bits memory address block of the cache to verify the desired block is present
or not.
12 bits (Tag) 3 bits (word)
• If each block contain 8 words, then the remaining 3
bits comprises word.
• If the desired block is present, the 3 bits word is used to
identify the necessary word in the cache.
Then, block ‘j’ of main memory can map to line number (j mod n) only of the cache.
777 02 6710
Cache Memory
20-07-2023 Sudhansu Ranjan Lenka 24
Direct Mapping with multiple words in a block
• The same organization but the block size is 8 words. In this case, the index field is now divided into 2 parts: block field and word field.
• Consider a cache consisting of 512 words , 512/ 8 = 64 blocks.
• 64 blocks is defined by 6 bits. So the block field is 6 bits and the word field = 3 bits.
• The tag field stored within the cache is common for all the 8 words of the same block.
• When a miss occurs entire block of 8 words are transferred from main memory to cache.
Index
Index Tag Data
000 01 3450 Tag (6) Block (6) Word (3)
Block 0
007 01 6578
Block 1 010
017
770 02
Block 63 777 02 6710