retagged by
2,720 views
0 votes
0 votes
a 4-way set - associative cache memory unit with a capacity of 16kb is built using a block size of 8 words. the word length is 32 bits. the size of the physical address space is 4gb.the number of bits for the tag field is

i am geting the answer 21 tag field bit length

but answer is 22

can any explain this question if answer is 22...
retagged by

2 Answers

0 votes
0 votes
Assuming memory is word addressable

No of bits for offset=3

No of blocks=2^14/4*8=2^9

No  of sets =no of blocks/4

                               =2^9/4

                               =2^7

Bits for set=7

Bits for tag=32-7-3=22

If memory was byte addressable then tag bits=32-7-5=20
0 votes
0 votes

Memory is word adddressable

No. of words in physical memory = 4GB/4B = 1G

So no of bits required for Physical Address = 30 Bits

No. of bits required for block offset = 3 bits

No. of words in cache = 16KB/4B = 4KB

No. of blocks in cache = 4KB/8 = 512

No. of sets in cache = 512/4 = 128

So, no.of bits required to represent sets = 7 bits

Remaining bits are to represent TAG, so remaining bits are 30-(7+3) = 20 bits.

Related questions

0 votes
0 votes
1 answer
2
focus _GATE asked Jun 5, 2015
6,520 views
16 KB, 4-way set-associative cache, 32-bit address, byte addressable memory, 32-byte cache blocks/linesHow many tag bits?Where would you find the word at address 0x200356...
2 votes
2 votes
2 answers
3
Na462 asked Nov 14, 2018
637 views