chap4 - William Stallings Computer Organization and...

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

View Full Document Right Arrow Icon
William Stallings Computer Organization and Architecture Chapter 4 Cache memory
Background image of page 1

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

View Full DocumentRight Arrow Icon
( W). Why cache? W & : CPU Memory ¶ “ 20ns 60ns 12ms CPU Cache Memory Disk 3GHz 800MHz 3 times 2 cache M 7 1/4~1/10
Background image of page 2
W& : / ˙ ± ♥☛ CPU cache.  , ( ˙ ‚ “ * cache ( ˙ ‚ “ * (cache ). 20ns CPU Cache Memory …… …… …… …… ?CPU 2 2 ) 7 ?
Background image of page 3

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

View Full DocumentRight Arrow Icon
Locality of Reference & & & & & & & & ¤ 4 During the course of the execution of a program,  memory references tend to cluster e.g. Loops for (i=0; i<20; i++) int factorial (int n)      for (j=0; j<10; j++) {int i, f=1; a[i] =a[i]*j;   for (i=2; i<=n; i++) ……;        f *= i ; factorial (20);   return f ; ……; } the principle of cache design ( 2 , 2 , 2 ) 13
Background image of page 4
« ♥☛ W& W W&& ‚ « … ‚ « …‚ ( ,  ‚ « …‚ , CPU ‚ « …‚“ * . ‚ « …‚ cache, ‚ « … ‚ “ * cache. 
Background image of page 5

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

View Full DocumentRight Arrow Icon
Cache Small amount of fast memory Sits between normal main memory and CPU May be located on CPU chip or module
Background image of page 6
( ) ). Cache x ˘ & ‚“ * ± ) CPU x˘ * ± ± ± ± ² X cache x ˘ * cache cache,  x ˘ ‚ “ * cache,  CPU CPU,  . Cache includes  tags  to identify  which block  of  main memory is in each cache slot
Background image of page 7

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

View Full DocumentRight Arrow Icon
  0 1 2 3 4 5 6 7 8 9 10 11 cache memory 0 1 2 3 1 14 11 0 16 20 24 28 32 36 40 44 56 CPU want 14 15,… want 47,… want 4,… want 56,… want 16,… block no. is unique block no.=address div block length block no. 0 2 3 1 0 2 3 1 0 2 3 1 0 2 3 1 3
Background image of page 8
Cache Read Operation - Flowchart CPU Cache Memory Slow?
Background image of page 9

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

View Full DocumentRight Arrow Icon
Cache/Main Memory Structure
Background image of page 10
Cache Design Size Mapping Function Replacement Algorithm Write Policy Block Size Number of Caches
Background image of page 11

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

View Full DocumentRight Arrow Icon
Size does matter Cost More cache is expensive Speed More cache is faster (up to a point) Checking cache for data takes time
Background image of page 12
Typical Cache Organization hit miss
Background image of page 13

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

View Full DocumentRight Arrow Icon
Comparison of Cache Sizes Processor Type Year of Introduction L1 cache a L2 cache L3 cache IBM 360/85 Mainframe 1968 16 to 32 KB PDP-11/70 Minicomputer 1975 1 KB VAX 11/780 Minicomputer 1978 16 KB IBM 3033 Mainframe 1978 64 KB IBM 3090 Mainframe 1985 128 to 256 KB Intel 80486 PC 1989 8 KB Pentium PC 1993 8 KB/8 KB 256 to 512 KB PowerPC 601 PC 1993 32 KB PowerPC 620 PC 1996 32 KB/32 KB PowerPC G4 PC/server 1999 32 KB/32 KB 256 KB to 1 MB 2 MB IBM S/390 G4 Mainframe 1997 32 KB 256 KB 2 MB IBM S/390 G6 Mainframe 1999 256 KB 8 MB Pentium 4 PC/server 2000 8 KB/8 KB 256 KB IBM SP High-end server/ supercomputer 2000 64 KB/32 KB 8 MB CRAY MTA b Supercomputer 2000 8 KB 2 MB Itanium PC/server 2001 16 KB/16 KB 96 KB 4 MB SGI Origin 2001 High-end server 2001 32 KB/32 KB 4 MB Itanium 2 PC/server 2002 32 KB 256 KB 6 MB IBM POWER5 High-end server 2003 64 KB 1.9 MB 36 MB CRAY XD-1 Supercomputer 2004 64 KB/64 KB 1MB
Background image of page 14
( ) ). Cache & & & && & & & ± > ) & cache CPU cache.  cache Ł ‚ “ ?
Background image of page 15

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

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

This note was uploaded on 03/31/2010 for the course SOFTWARE I c0327 taught by Professor Li during the Spring '09 term at Nanjing University.

Page1 / 61

chap4 - William Stallings Computer Organization and...

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

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