题目详情

某32位总线处理器的Cache直接映射方式如下图所示,若Cache大小为16KB,每个Cache块为16字节,则Offset,Index和Tag所占的位数分别是()。

中级嵌入式系统设计师,章节练习,嵌入式系统基础知识

  • A.4,10,18
  • B.4,12,16
  • C.5,10,17
  • D.5,12,15

正确答案及解析

正确答案
A
解析

本题考查嵌入式处理器Cache的基础知识。Cache是一种高速缓冲储存器,它的主要作用是提高CPU数据输入的速率,调和CPU速度与内存存储之间的巨大差异。通俗一点说就是CPU太快,内存速度相对较慢,而Cache的速度快,但是Cache的价格比较昂贵。很容易想到的一个办法就是利用小容量Cache在CPU和内存中间当桥梁,也就是说把CPU在下一个时间段需要用到的数据提前存入Cache中,当CPU需要的时候可以快速的从Cache中取得数据,这样就可以在一定程度上提高计算机的性能。

但怎样才能知道CPU在下一个时间段需要用到内存中的那些数据呢?局部性原理就可以解决这个问题。使用Cache改善系统性能的依据就是局部性原理。局部性原理反映在计算机中就是如果CPU当前时间用到内存中某块数据,那么CPU在下一个时间段内用到这块数据周围的数据可能性就非常大。Cache即是按照这种原理,把这个时间段中CPU用到 的这块数据周围的数据存入Cache中为下一个时间段的CPU使用做准备,这样当下一个时间段的CPU需要数据了就可以直接从储存较快的Cache中取得需要的数据,这样自然就可以提高计算机的性能。

另外涉及到的一个问题是Cache中的数据和内存中的部分数据是一致的,那么当CPU从Cache取得数据后怎样知道这块数据在内存中的具体地址呢?于是想到了映射的方法,将Cache中的数据按照特定的方式和内存中的数据进行映射,这样CPU就很容易找到Cache中数据在内存中的真实位置了。

映射的方式目前有三种,分别是直接映射,全相连映射和组相联映射。直接映射最为简单,即是指主存中的一个字块只能映射到Cache中一个准确确定的字块。全连接映射是指主存中的一个字块可以映射到Cache中的任何一个字块。组相连映射是上述两种方式的折中连接。在上图所示的直接映射中,如果每个Cache块的字节数是16,则Cache块内索引的位数为4;如果Cache的大小为16KB,则其Index索引的位数为10位,映射到内存的地址位数为32-4-10=18。

包含此试题的试卷

你可能感兴趣的试题

单选题

Advancements in ( )have contributed to the growth of the automotive industry through the creation and evolution of self-driving vehicles.

  • A.Artificial Intelligence
  • B.Cloud Computing
  • C.Internet of Things
  • D.Big Data
查看答案
单选题

In project human resource management , ( )is not a source of power for the project manager.

  • A.referent power
  • B.expert power
  • C.reward power
  • D.audit power
查看答案
单选题

At the project establishment stage , the feasibility study mainly includes techinical feasibility analysis , ( ), operation environment feasibility analysis and other aspects of feasibility analysis.

  • A.detail feasibility analysis
  • B.opportunity analysis
  • C.economic feasibility analysis
  • D.risk analysis
查看答案
单选题

( )is a grid that shows the project resources assigned to each work package.

  • A.Stakeholder engagement assessment matrix
  • B.Requirements traceability matrix
  • C.Probability and impact matrix
  • D.Responsibility assignment matrix
查看答案
单选题

Xinhua News Agency reported in January 2022,Chian will further promote the developmet of a digital economy during the 14th Five-Year Plan eriod(2021-2025). The plan also emphasized industrial ( )transformation.

  • A.digital
  • B.networking
  • C.intelligentize
  • D.informatization
查看答案

相关题库更多 +