edited by
1,841 views
0 votes
0 votes
Assume a cache of $2K$ blocks ( 1 block size = 4 words= 16 bytes) and $32-bit$ address. Assume this machine is byte addressable.

What is the bit length of each field in direct mapped?

$(A).\space 19,11,2$

$(B).\space 20,11,2$

$(C).\space 21,9,2$

$(D). \text{none of these}$
edited by

2 Answers

0 votes
0 votes

In direct mapping, address is divided  into three parts i.e. Tag,index and offset.

Here offset will be block size so, it will be 2 bits

Now to represent the cache size of 2K we need 11 bits. So, Index will be 11.

Total 32 bit address  and 2 bit used as offset and 11 bits for index, remaining is 19.

So, answer will be A 

0 votes
0 votes
Cache size  $=2\text{K Blocks} = 2\times 2^{10} \text{ Blocks} = 2^{11}\times 16 \text{ bytes} = 2 ^ {15} $ Bytes

$\text{Block Offset} = \log_216 = 4$

$\text{Cache Offset} = \log{\frac{2^{15}}{2^4}} = 11$

$\text{Tag} = 32-11-4 = 17$

So none of these Option D
edited by

Related questions

3 votes
3 votes
1 answer
2
ashish pal asked Dec 31, 2017
1,808 views
The statement " Direct mapped cache, may produce more misses if programs refers to memory words that occupy a same tag value." is true or false ?