retagged by
973 views
0 votes
0 votes

Here is a simple problem from Stallings.My confusion is with the offset bits in the address.If we are not mentioned anything about word addressing and byte addressing,what is the safest thing to assume? For example below exercise from Stallings.

Consider a 32-bit microprocessor that has an on-chip 16-KByte four-way set-associa-
tive cache. Assume that the cache has a line size of four 32-bit words. Draw a block di-
agram of this cache showing its organization and how the different address fields are
used to determine a cache hit/miss. Where in the cache is the word from memory lo-
cation ABCDE8F8 mapped?

Now the format of the address is,

Offset-4 bits,Set-8 bits,Tag-20 bits.

Now is this offset - word or byte offset??...As per the question it looks like we need to address 4 words in a line that make 2 bits in LSB for a word offset,but then why 4 bits are used for?Even if it is used last two bits (LSB) will be always 00.The offset can be one of the following only

0000,0100,1000,1100.

Is it because we want to support byte level addressing as well?Or is it that we cannot support Word level addressing without using byte level addressing internally?Hence it is like 2 bits for word addressing and 2 bits for internally selecting byte inside a word??

retagged by

1 Answer

1 votes
1 votes

4 32-bit words, i.e. word length = 32 bits = 4 bytes

$\therefore$ 4 words = 4*4 =16 bytes and hence offset requires 4 bits.

Default is always byte addressable

Related questions

1 votes
1 votes
3 answers
2
Prasanna asked Dec 4, 2015
3,787 views
What is Byte Addressable and Word Addressable means in computer Architecture ? Difference between them with examples?I also find some sources like stack overflow and wik...
2 votes
2 votes
1 answer
3
Sneha bhusare asked Aug 7, 2017
816 views
Let the number of bits required to address a memory word be 25. Each word is of 16 bits.Number of words in the memory is ________.Number of bytes in the memory denoted a...