3,173 views
2 votes
2 votes
Consider a 256KB direct mapped byte addressable cache. If one word is 4 bytes and each cache block contains 16 words , then determine the number of bits required for tag.(Assume that physical address of computer is 32 bits)

2 Answers

Best answer
1 votes
1 votes

Each cache block contain 16 words each word is 4 byte so addressable memory is 16*4= 64 bytes

Number of blocks 256KB/16*4=$\frac{2^{18}}{2^{6}}$=$2^{12}$

Address is divided as Tag|Block|Byte

Block = 12 bits

Word= 6 bits

Tag=32-12-6 =14 bits

Unless not mentioned system is byte addressable

Eg https://gateoverflow.in/1963/gate2014-2-9

selected by
0 votes
0 votes

logical address generated by the cpu is to find a block of main memory for accessing 1 byte of data (in case of byte addressable system)

no of blocks in main memory=32-6=26bits=226 blocks

no of blocks in cache =18-6=12bits =212 blocks

now required tag bits =26-12=14bits.....

out of 32bits ....14bits (tag bit) 12bits(block no) ,6bits(word)......bocz cpu is accessing a byte not word

https://en.wikipedia.org/wiki/Byte_addressing

No related questions found