1

I'm making an associative cache simulator in C: 4 ways, 524288 bytes total size, 64 bytes block size, 32 bits addresses.

In this address:

00001000000000000000000100001100

what is the decimal value of the tag, the set and the word?

I think it's tag: 256, set: 4 , word: 12, but I have some errors in Hits and Misses and I think this might be the problem. Thanks for your time.

4

1 回答 1

0

我明白了:

000010000000000 00000000100 001100
000010000000000 = tag = 1024
                00000000100 = slot number in set = 4
                            001100 = offset in block = 12

注意:这与您的结果相同,只是标签值相差 4 倍;这恰好与关联性相同。我很想假设这不是巧合(并且您在不应该的情况下为“方式”消耗了一些位)。

于 2013-05-08T12:11:31.280 回答