zoukankan      html  css  js  c++  java
  • cache

    When the CPU is instructed by a load instruction to read a word from ad-
    dress A of main memory, it sends the address A to the cache. If the cache is holding
    a copy of the word at address A, it sends the word immediately back to the CPU

    So how does the cache know whether it contains a copy of the word at address A?

    here is some cache parameters you need to know 

    the way how the address match which part of the cache

    1)先从cache了解有(S,E,B)判断set有多少位,assoc有多少位,block有多少位

    2)假设block有b位,则有连续的2^n个位置都是属于这个set,假如cache为空,我们现在要地址0的内容,cpu先向cache发送地址0,cache未能命中,则向内存中发出读地址0命令,将地址0的内容写入set0,在这个读内存的过程中,cache还连带的把地址1、2、3

    的内容读入到cache中。假如下一次cpu需要地址2的内容就可以直接从cache中读取。

    3)那assoc有什么用呢!假如cpu需要地址8的内容,而且地址8和地址0都是用到set0。如果E只有0位那么就先要吧set0原先的内容踢掉,再去加载地址8的内容,如果E有1位,cpu如果需要地址8的内容就可以直接把地址8的内容加载到line2中,同样的在加载地址8时,cache顺便的把地址9、a、b的内容加载到cache中

  • 相关阅读:
    解析URL
    文件上传
    MyEclipse自动生成hibernate实体类和配置文件攻略
    <form>表单提交时注意
    W2UI /W2Toolbar的click响应事件
    JS 读写文件
    select 美化(bootstrap)
    安装MySQL for Windows 数据库
    java环境配置—配置Tomcat8环境
    对进程、线程、应用程序域的理解
  • 原文地址:https://www.cnblogs.com/been/p/3917097.html
Copyright © 2011-2022 走看看