in CO and Architecture retagged by
644 views
2 votes
2 votes

 

in CO and Architecture retagged by
by
644 views

4 Comments

22bits
2
2
22 bits will be there in Tag field,

Cache size/ block size =number of blocks

256KB/1KB= 256

NO. OF BLOCK / 8= NO. OF SETS

256/8= 32

Number of words within a block = block size / word size

1KB/8B=128 words

To identify a set we need log(32) = 5 bits

To identify a word we need log(128) = 7 bits

TAG bits = 34-(5+7)= 22
2
2
22 bits, first convert everything to words, then u can solve easily.
0
0
Yes 22 bits is the right answer here memory is word addressable so Block size will be taken in terms of words.
0
0

2 Answers

4 votes
4 votes

22 should be correct answer as we know CPU will generate the address which is divided as 

     

TAG BITS                                    SET OFFSET                        WORD OFFSET

Now CPU generate the address of 34 bits ..now one word is of 64 bits ...we have one BLOCK of 1KB so number of words present in one block are = (1024*8 ) / 64 = 128 Words ....so if 128 words are there in ONE BLOCK to identify each one of them we need 7 bits SO WORD OFFSET = 7 bits .  Now number of lines in cache = cache size / Block size = 256  Kb / 1KB = 256 Lines 

So as per problem one set has 8 lines so x set will have 256 lines ...so number of set are = 256/8 = 32 sets 

So to identify each one of them we need 5 bits ...so SET OFFSET is 5 bits 

SO TAG bits = 34 - (5+7)= 34 - 12 = 22 bits .. 

2 Comments

If it is byte addressable, Then what will be the answer.
0
0
why cpu generated address 34 bit is not converted to words ie 2^34 bytes which on converting to words 2^31 words.So 31 bits-7-5=19bits.May I know what is wrong in this?
0
0
0 votes
0 votes
i m getting 27 tag bits in the physical address & 7 bits for word offset..

1 comment

It will be 22.
0
0

Related questions