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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值