0
votes

So i Have physical memory/cache system with following properties: -Physical memory is byte addressable -Memory accesses ate to 1-byte words (not 4-byte words) -Physical addresses are 12 bits wide -The cache is 4-way set associative, with a 2-byte block size and 32 total lines. I need to find cache offset, set index, and tag fields. So we have E=4, B=2, S=8 (32 lines/4 way set).

C(index) = log2(S)= log2(8) = 3. C(tag)= m - (s+b), where s = C(index) = 3. b = log2(B) = log2(2) = 1, so C (offset) = 1. C(tag) = 12 - (3+1) = 8.

Hence, CO= 1, CI = 3, CT = 8. Is this correct? Im not sure if this is right, because not sure if C offset can be 1? Thanks for any help.

1

1 Answers

0
votes

with a 2-byte block size and 32 total lines.

Do you mean that each set has 32 lines? Then the index-bits should be 5.

If you mean that the cache has 32 lines in total, 8 per set then the index bits should be 3, just as you have stated. The offset-bits is 1.