Tag bits for direct mapping= size of main memory/cache memory.Cache memory = total bits for line representation+ total bits for block offset.Physical Address (PA) = Block Offset + Line + Tag Tag through the following equation in Direct Mapping if we have PA, Block Offset and Line Bits then we can calculate So, 13 bits are require to represent lines in cache Total lines = Cache size/Block size = 64KB/8B = 213B if cache size is 64KB and Block/Line size is 8B then how manyīits are require to represent lines of cache memory So, 3 bits required for Block Offset/Line offset If we have 8 words in block and each word is f 32 bit then how manyīits required for Block offset. So, 5 bits required for Block Offset/Line offset Total words * size of word in bytes = 8*4= 32= 25B Q3: If we have 8 words in block and each word is f 32 bit then how many Bits are required for Block offset? Main memory is Byte addressable So 14 bits required for physical address (PA) of main memory Q2: If memory size is 128 KB and memory is word addressable and word size is 8 byte then how many bits required to Represent Physical address of main Memory So 17 bits required for physical address (PA) of main memory Q1: If memory size is 128 KB and memory is Byte addressable then how many bits required to Represent Physical address of main Memory Note: if cache misses then we replace the block of that line (in cache) with required block (from main memory) But if the address is 1010011 then it is a cache miss because last three Tag bits (101) are not found in the tag bits of cache lines. So Comparator value in direct mapping is always one.įor address 0010100 in the following diagram, it is a cache Hit. We match the tag of given address with the tag of particular cache line only Once. As we know the exact block through K MOD N formula. Note: Only one comparator is require in direct mapping to find cache hit or miss. ![]() If it matches then Cache Hit otherwise cache miss.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |