问题 单项选择题

一般来说,Cache的功能 (1) 。某32位计算机的cache容量为16KB,cache块的大小为16B,若主存与cache的地址映射采用直接映射方式,则主存地址为1234E8F8(十六进制)的单元装入的cache地址为 (2) 。在下列cache替换算法中,平均命中率最高的是 (3)

3()

A.先入后出(FILO)算法

B.随机替换(RAND) 算法

C.先入先出(FIFO)算法

D.近期最少使用(LRU)算法

答案

参考答案:D

解析:

Cache即高速缓冲存储器,它是位于CPU和DRAM主存之间的规模小的速度快的存储器,通常由SRAM组成。 Cache的工作原理是保存CPU最常用数据;当 Cache中保存着CPU要读写的数据时,CPU直接访问Cache。由于Cache的速度与CPU相当,CPU就能在零等待状态下迅速地实现数据存取。只有在 Cache中不含有CPU所需的数据时CPU才去访问主存。Cache在CPU的读取期间依照优化命中原则淘汰和更新数据,可以把Cache看成是主存与 CPU之间的缓冲适配器,借助于Cache,可以高效地完成DRAM内存和CPU之间的速度匹配。Cache的功能全部由硬件实现Cache块号占10位地址,块内4位地址共占14位地址。直接映象为内存低位部分的14位地址。

即:E8F8=1110 10001111 1000

块号10位 块内地址

用直接映象法,装入Cache的块号为10 1000 1111,主存地址为1234E8F8(十六进制)的单元装入的 cache地址为:10 1000 1111 1000。

cache替换算法中,平均命中率最高的是近期最少使用(LRU)算法

判断题
完形填空

I want to tell you a story about myself at the airport. I wanted to fly to France with my family on vacation. Before we took the plane, we had to go through the metal detector (金属探测仪) at the airport. When I walked through it, the alarm rang.

“Come here, young man.” said the guard at the airport. “Take everything out of your pockets. ” So I took my wallet out and put it on the table. Then I walked through the metal detector again. This time, the alarm didn’t ring. My mother said that maybe there was something made of metal in my wallet, but I didn’t think so. Anyway, we got on the plane successfully and flew to France. The trip was great and I had a good time there.

When we went to the airport in France to fly home, I got into trouble again. When I went through the metal detector, the alarm rang again. I was surprised, so I asked the guard about it. “Let me see what’s in your wallet,” said the guard. So I took out everything out of my wallet. “This one is made of metal,” said the guard, pointing at the pen I bought last week.

小题1:Did the writer go through the metal detector successfully for the first time?

_____________________________________________________________________________

小题2:Where did the writer go on his vacation?

_____________________________________________________________________________

小题3:What stopped the writer from going through the metal detector?

_____________________________________________________________________________