Ask Question
3 March, 11:44

2. Suppose a computer using direct mapped cache has 220 words of main memory and a cache of 32 blocks, where each cache block contains 16 words. a. How many blocks of main memory are there? b. What is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, block, and word fields? c. To which cache block will the memory reference 0DB6316 map? d. In many computers the cache block size is in the range of 32 to 128 bytes. What would be the main advantages and disadvantages of making the size of the cache blocks larger or smaller within this range

+4
Answers (1)
  1. 3 March, 11:57
    0
    (a) The block size = 16 words (b) the format for the sizes of the tag, block, and word fields are stated below:

    Tag Block Offset

    11 bits 5 bits 4 bits

    (c) The memory address 0DB63 will map to 22nd block and 3 byte of a block. (d) The main advantage of the cache is, when the cache block is made larger or bigger then, there are fewer misses. this occur when the data in the block is used.

    One of the disadvantage is that if the data is not used before the cache block is removed from the cache, then it is no longer useful. here there is also a larger miss penalty.

    Explanation:

    Solution

    (a) The Cache of 32 blocks and the memory is word addressable

    The main memory size is not stated, so let's consider it as 2^20

    The main memory size = 2^20

    The block size = 16 words

    The Number of blocks = main memory size / block size = 2^20/16. = 2^16 = 64 K words.

    (b) The Main memory is 2^20, which says it is 1 M words size and it requires 20 bits

    Now,

    From which 32 cache block requires 2^5, 5 bits and block size means offset requires 2^4, 4 bits

    Thus, the sizes of the tag, block, and word fields are stated below:

    Tag Block Offset

    11 bits 5 bits 4 bits

    (c) The hexadecimal address is 0DB63, its binary equivalent is

    0000 1101 1011 0110 0011

    The tag = (first 11 bits) = 0000 1101 101

    block = (next 5 bits) = 1 0110

    offset = (next 4 bits) = 0011

    Therefore, the memory address 0DB63 will map to 22nd block and 3 byte of a block.

    (d) The main advantage of the cache is that, when the cache block is made larger or bigger then, there are fewer misses. this occur when the data in the block is used.

    One of the disadvantage is that if the data is not used before the cache block is removed from the cache, then it is no longer useful. here there is also a larger miss penalty.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “2. Suppose a computer using direct mapped cache has 220 words of main memory and a cache of 32 blocks, where each cache block contains 16 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers