Chapter 3 Cache
Chapter 3 Cache
Chapter Three
Memory Technology and Optimizations
• DRAM:
– Value is stored as a charge on capacitor (must be
refreshed)
– Very small but slower than SRAM (factor of 5 to 10)
Dynamic RAM
• Bits stored as charge in capacitors
• Charges leak
• Need refreshing even when powered
• Simpler construction
• Smaller per bit
• Less expensive
• Need refresh circuits
• Slower
• Main memory
• Essentially analogue
– Level of charge determines value
Dynamic RAM Structure
SDRAM
• There has been multiple improvements to the
DRAM design.
– A clock signal was added making the design
synchronous (SDRAM).
– The data bus transfers data on both rising and
falling edge of the clock (DDR SDRAM).
– Second generation of DDR memory (DDR2) scales
to higher clock frequencies.
– DDR3 and DDR4 are currently being used.
SDRAM
• SDRAMs allows burst transfer mode where multiple
transfers can occur without specifying a new column
address.
• In burst mode 8 or more 16-bit transfers can occur
without sending any new addresses.
• To overcome the problem of getting more bandwidth
from the memory as DRAM density increased,
SDRAM were made wider.
• SDRAMs introduced banks to help with power
management, improve access time, and allow
interleaved and overlapped accesses to different
banks.
Static RAM
• Bits stored as on/off switches
• No charges to leak
• No refreshing needed when powered
• More complex construction
• Larger per bit
• More expensive
• Does not need refresh circuits
• Faster
• Cache
• Digital
– Uses flip-flops
Static RAM Structure
Memory Hierarchy: How Does it Work?
• Temporal Locality (Locality in Time):
• the memory hierarchy will keep those more
recently accessed data items closer to the
processor because chances are, the processor will
access them again soon.
• Spatial Locality (Locality in Space):
=>Not only do we move the item that has just been
accessed to the upper level, but we also move the
data items that are adjacent to it.
Memory Hierarchy of a Modern Computer
System
By taking advantage of the principle of locality:
Present the user with as much memory as is available in the
cheapest technology.
Provide access at the speed offered by the fastest
technology.
Cache
• Small amount of fast memory
• Sits between main memory and CPU
• May be located on CPU chip or module
How to Improve Cache
Performance?
• Cache optimizations
– 1. Reduce the miss rate
– 2. Reduce the miss penalty
– 3. Reduce the time to hit in the cache
cache cache
cache
bus
bus bus