Consider main memory of the size 64 kB with each word being 8 bits(one byte) only and a direct mapping Cache memory of size 4 kB also having data word size 8 bits Find the following : 1)find the size of tag and index fields of cache ? 2)In what location of cache hexadecimal address to main memory(AABB)(if exists in cache) will be located?
Answer to your first question is 4 tag bits and cache index bits should be 4 as it is byte-addressable so address bus size is 8 bits so the physical address is therefore of 8 bits and cache index = physical address - tag bits. Approach : tag bits = lg(main-memory size/ cache-memory size). Also clarifying the question will help, I don't think memory is byte-addressable if at all 2nd question has to make sense since AABB will take 16-bit address bus. Or according to the question, it won't exist.