# Cache Organization source: Week08 memory-cache p.5~p.13 [video link](https://www.youtube.com/watch?v=UeLbipDWxJs&ab_channel=soclab) ## why we need cache?  1. Temporal Locality: 剛被使用過的資料很可能短時間內會被重複使用 2. Spatial Locality: 剛被使用過的資料,鄰近位址的資料很可能會被使用 ## Cache Operations  * Read: 1. Cache hit: cache有要用的資料,直接從cache傳回去 2. cache miss: cache沒有要用的資料,清一個位子出來存從main memory傳回來的資料( **read-allocate** ) * Write: 1. Cache hit: cache有這個位址,直接寫在cache 2. cache miss: cache沒有這個位址,清一個位子寫入cache( **write-allocate** ),或是直接寫到main memory * Hit Rate: Hit的比例 * Cache Line: store data in blocks,也就是一次cache很多筆資料,e.g.: 資料長度8bit,cache line大小64 bit,以8筆資料為單位在做cache operation     About the chart: **Not improve much when cache size is large**   
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up