Lecture_11_Memory-Hiearchy

Lecture_11_Memory-Hiearchy - Lecture 11 11 Memory Hierarchy...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 11 emory Hierarchy Memory Hierarchy 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Memory Hierarchy ± Keeping useful books close to you ± Keeping useful data close to the CPU – Memory Hierarchy 2
Background image of page 2
Why Cares about Memory Hierarchy? ± Processor Only Thus Far in Course – CPU cost/performance, ISA, Pipelined Execution CPU-DRAM Gap 1000 CPU 100 10 DRAM 1 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Levels of the Memory Hierarchy pper Level CPU Registers Capacity Access Time egisters Staging Xfer Unit Upper Level faster < 1K Bytes 0.25 – 0.5ns Cache 16 MB Bytes Registers Instr. Operands prog./compiler 1-8 bytes < 16 MB Bytes 0.5 - 25 ns Cache Blocks cache cntl 8-128 bytes Main Memory M< 16 GBytes 80 – 250 ns Memory ages OS Disk ¾ 100 G Bytes, 5 ms 000 000 ns) Disk Pages 512-4K bytes (5,000,000 ns) Tape finite ape Files user/operator Mbytes ower Level Larger 4 infinite sec-min Tape Lower Level
Background image of page 4
General Principle ± The Principle of Locality: – Program access a relatively small portion of the address space at any instant of time. ± Two Different Types of Locality: – Temporal Locality (Locality in Time): an item is referenced it will tend to be referenced again soon (e g loops If an item is referenced, it will tend to be referenced again soon (e.g., loops, reuse) – Spatial Locality (Locality in Space): • If an item is referenced, items whose addresses are close by tend to be referenced soon (e.g., straightline code, array access) For (i= 0; i++;i:<100) { A[i]=A[i] + x; ++; x++; } ocality + smaller HW is faster = memory hierarchy 5 ± Locality + smaller HW is faster = memory hierarchy Levels : each smaller, faster, more expensive/byte than level below Inclusive : data found in top also found in the bottom
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Memory Hierarchy: Terminology ± Definitions Upper is closer to processor Block : minimum unit that present or not in upper level ± Hit : data appears in some block in the upper level (example: Block X) –H i t R a t e : the fraction of memory access found in the upper level i t T im e : Time to access the upper level which consists of RAM access time + Time to determine hit/miss ± Miss : data needs to be retrieved from a block in the lower level (Block Y) – Miss Rate = 1 - (Hit Rate) – Miss Penalty : Time to replace a block in the upper level + Time to deliver the block the processor it Time << Miss Penalty (500 instructions on Alpha 21264!) ± Hit Time << Miss Penalty (500 instructions on Alpha 21264!) Block 6
Background image of page 6
Basic Structure of a Memory Hierarchy Memory Technology Typical access time $ per GB in 2004 SRAM 0.5-5 ns $4000-$10,000 DRAM 50 70 ns $100-$200 Magnetic disk 5,000,000-20,000,000 ns $0.50-$2 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Memory Hierarchy 1. Keeping more recently accessed data items closer to the processor -> temporal locality 2. Moving blocks consisting of multiple contiguous words in memory 8 gg p g y to upper levels of the hierarchy -> spatial locality 3. Data cannot be present in level i unless it is also present in level i+1
Background image of page 8
Basics of Caches Before the reference to X After the reference to X X 4 X 1 X 4 X 1 n n How do we find X n in cache?
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/24/2009 for the course CSIE CA2009 taught by Professor Yang during the Spring '09 term at National Taiwan University.

Page1 / 56

Lecture_11_Memory-Hiearchy - Lecture 11 11 Memory Hierarchy...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online