part 3 Cache Memory 4

Direct map and Set associate 

These words are a little bit confused.

In direct map.

A memory address is consist of three parts. tag(t bits), line(l bits) and word(w bits)// This address is physical address and it is converted from logical address from calculation. 

T means how many segment can we have in the memory, always is 2^t bits.

L means how many block address in cache which is the cache line, is 2^l bits.

W means the size of block in the segment.

The maximum segment in the 2^T.

Q:how a program catch block of segments in main memory to cache at the first time when the program is executed. 


To check if block is in cache

-block address=tag+cache

-cache address=block address MOD#of blocks in cache

-check the tag field at the index address


pro and cons of direct map

Cache misses are high if two blocks that map to the same cache line are accessed repeatedly.


In set associative.

The only difference is we divide the cache memory in segments.which partly solve the problems when two blocks are mapped int the same cache line.

the cache capacity under direct map is 2^l *2^w

                                  under n way set associative is 2^l * 2^w * n that means much longer.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章