Assignment On Direct Mapping
Assignment On Direct Mapping
Given,
Cache memory size = 16 KB
Block size = Frame size = Line size = 256 bytes
Main memory size = 128 KB
We consider that the memory is byte addressable.
Number of Bits in Line number : Total number of lines in cache= Cache size / Line size
= 16 KB / 256 bytes= 214 bytes / 28 bytes= 26 lines
Number of bits in line number = 6 bits
Number of Bits in Tag-
Number of bits in tag
= Number of bits in physical address – (Number of bits in line number + Number of bits in block offset)
= 17 bits – (6 bits + 8 bits)= 17 bits – 14 bits= 3 bits
Number of bits in tag = 3 bits (ans.)
Problem2:
Given-
Cache memory size = 512 KB
Block size = Frame size = Line size = 1 KB
Number of bits in tag = 7 bits
problem 3:
Given-
Block size = Frame size = Line size = 4 KB
Size of main memory = 16 GB
Number of bits in tag = 10 bits
Problem 5:
Main memory size = 232 bytes
Block size = Frame size = Line size = 32 bytes
Number of lines in cache = 512 lines
Problem6:
Given-
Cache memory size = 8 KB
Block size = Frame size = Line size = 32 bytes
Number of bits in physical address = 32 bits