Cache in the computer fully associative task?

A fully associative cache has 256KB of memory. A block in the cache is 64KB in size.

The cache therefore has 256 / 64 = 4 blocks in total

Now hexa numbers are given e.g.

0x9AAF 4D5A

0x25AD 123F

Now we need to check whether these hexadecimal numbers are already present in the cash. That is, whether it's a hit or a miss. How do we check this?

No further information was given in the task.

I know that with a fully associative cash, there is only one day and one offset.

There is no index.

Since a block consists of 64KB (2^10 * 2^6 = 2^16), 16 bits are required for the block offset. As far as I remember, no further information was available.

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
KarlRanseierIII
1 year ago

Gemäß der wenigen Angaben die du hier anbringst:

Der Cache hat 4 Lines, wobei jeder Block 64 KiBi hat. Die hinteren 16 Bit der Adresse sind also der Offset (innerhalb des Blocks).

Die von Dir angegeben HexaDezzahlen sind 32 Bit, d.h. die vorderen 15 Bit (4 Hexstellen) sind das Tag.

Ist eienr der Cachebläche mit diesem Tag z.B. 9AAF getagged, dann ist es ein Hit, sonst ein Miss.

KarlRanseierIII
1 year ago
Reply to  RedDevil1982

Der Cache cached ja den gesamten Block, beim Tag 0x9AAF also alles von 0x9AAF 0000 bis 0x9AAF FFFF.

D.h. bei Deinem Beispiel: mit 0x9AAF 4D5A und dessen miss, wird einer der freien Blöcke des Caches genommen (oder einer verdrängt) und danach der gesamte Speicherbereich von 64 KiBi in den Cache geholt. Von daher gibt es nichts zu ersetzen, sondern es wird bei 0x9AAF 3FFF aus dem Cacheblock mit Tag 0x9AAF an Offsert 3FFF gelesen.

Von daher sind 64 KiBi als Blockgröße auch eher nicht praxisnah, während die Reduktion auf 4 Blöcke die Aufgabe vermutlich deutlich vereinfacht.