【存储器】高速缓存器

计算机组织与结构


       In 【存储器】半导体存储器 we know that the SRAM is uesd for cache for its stable and high speed in writing and reading, and there is a memory hierarchy :
Memory Hierarchy

Why cache?

       Nowadays, the speed of CPU is faster than memory’s like this figure :
Speed of CPU and Memory

Basic Idea

  1. Use a smaller, faster cache(SRAM) memory block together with a relatively large and slow main block(DRAM).
  2. The cache contains a copy of portions of main memory.
  3. Located between CPU and memory, and may be integrated inside CPU or as a module on motherboard.
    Like this :
    Basic Idea

How it works

  1. Check : When the processor attempts to read a word of memory, a check is made to determine whether the word is in the cache.
  2. Hit : If so, the word is delivered to the processor.
  3. Miss : If not, a block of main memory, consisting of some fixed number of words, is read into the cache and then the word is delivered to the processor.
    Like this :
    How cache works

Questions

       We know how it works, but why we can solve the problem in this way, There are some questions and answers.

Q1 : How to determine hit and miss?

       Through the von Neumann machine, the contents of this memory are addressable by location, without regard to the type of data contained there. So cache includes tags to identify its content’s corresponding locations in main memory.

Q2 : Why not directly move the word from memory to CPU if miss?

       There is a phenomenon describing the same value, or related storage locations, being frequently accessed.
This three types :

  • Temporal locality : the reuse of specific data, and/or resources, within a relatively small time duration.
  • Spatial locality : the use of data elements within relatively close s
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值