Set Associative mapping
Set Associative mapping
Associative
Mapping
Problems
Problem-01:
Given-
Set size = 2
• Cache memory size = 16 KB
• Block size = Frame size = Line size = 256 bytes
• Main memory size = 128 KB
Number of Bits in Physical Address-
We have,
Size of main memory
= 128 KB
= 217 bytes
Thus, Number of bits in physical address = 17 bits
Number of Bits in Block Offset-
Block size
= 256 bytes
= 28 bytes
Thus, Number of bits in block offset = 8 bits
Number of Lines in Cache-
Given-
• Set size = 8
• Cache memory size = 512 KB
• Block size = Frame size = Line size = 1 KB
• Number of bits in tag = 7 bits
Number of Bits in Block Offset-
Block size
= 1 KB
= 210 bytes
• Thus, Number of bits in block offset = 10 bits
Number of Lines in Cache-