# 5.1 Introduction

Memory access有两个局部性（principle of locality）：这里直接复制书中的内容

Temporal locality (locality in time): if an item is referenced, it will tend to be referenced again soon.

Spatial locality (locality in space): if an item is referenced, items whose

addresses are close by will tend to be referenced soon

Cache既利用了空间局部性，也利用了时间局部性。空间局部性是cache中的每一个cache line包含一段地址相邻的数据；时间局部性，缓存在cache中的数据，下次被访问的时候，直接从cache中取。

hit rate The fraction of memory accesses found  in a level of the memory hierarchy.

miss rate The fraction of memory accesses not found in a level of the memory hierarchy.

hit time The time required to access a level of the memory hierarchy, including the time needed to determine whether the access is a hit or a miss.

miss penalty The time required to fetch a block into a level of the memory hierarchy from the lower level, including the time to access the block, transmit it from one level to the other, insert it in the level that experienced

the miss, and then pass the block to the requestor.

# 5.2 memory technology

SRAM （static  random access memory）

DRAM（dynamic random access memory）

- the value kept in a cell is stored as a charge in a capacitor.

- A single transistor is then used to access this stored charge。 So one transistor per

bit of storage

- must periodically be refreshed

refresh方式：读出来，再写进去。

DDR SDRAM。