Chapter 4. Cache Memory. Yonsei University

Size: px
Start display at page:

Download "Chapter 4. Cache Memory. Yonsei University"

Transcription

1 Chapter 4 Cache Memory

2 Contents Computer Memory System Overview Cache Memory Principles Elements of Cache Design Pentium 4 and Power PC Cache 4-2

3 Key Characteristics 4-3 Location Processor Internal (main) External (secondary) Capacity Word size Number of words Unit of Transfer Word Block Access Method Sequential Direct Associative Performance Access time Cycle time Transfer rate Physical Type Semiconductor Magnetic Optical Magneto-Optical Physical Characteristics Volatile/nonvolatile Erasable/nonerasable Organization Computer memory system overview

4 Characteristics of Memory System Computer memory system overview Location Processor Internal(main) External(secondary) 4-4

5 Capacity Computer memory system overview Internal memory capacity Expressed in terms of bytes or words External memory capacity Expressed in terms of bytes 4-5

6 Computer memory Unit of Transfer system overview Internal memory The unit of transfer is equal to number of data into and out of the memory module Often equal to the word length Word Natural unit of organization of memory The size of the word is equal to number of bits used to represent a number and to instruction length Addressable unit In many systems, the addressable unit is word Some systems allow addressing at the byte level Unit of transfer The number of bits read out of or written into memory at a time 4-6

7 Methods of Accessing Sequential access Start at the beginning and read through in order Access time depends on location of data and a previous location e.g. tape Direct access Individual blocks have unique address Access is by jumping to vicinity plus sequential search Access time depends on location and previous location e.g. disk Computer memory system overview 4-7

8 Methods of Accessing Computer memory system overview Random access Individual addresses identify locations exactly Access time is independent of location or previous access e.g. RAM Associative access Data is located by a comparison with contents of a portion of the store Access time is independent of location or previous access e.g. cache 4-8

9 Performance Computer memory system overview Access time Time it takes to perform read or write operation (for random-access memory) Time it takes to position the read-write mechanism at desired location (for non-random-access memory) Memory cycle time Applied to random-access memory Consists of the access time plus any additional time required before next access 4-9

10 Performance Computer memory system overview Transfer rate Rate at which data can be transferred into or out of a memory unit (for random-access memory) For non-random-access memory T T = + N A N R T N = Average time to read or write N bits T A = Average access time N = Number of bits R = Transfer rate, in bits per second(bps) 4-10

11 Physical Types Computer memory system overview Semiconductor RAM Magnetic Disk & Tape Optical CD & DVD Others Bubble Hologram 4-11

12 Physical Characteristics Computer memory system overview Decay Volatility Erasable Power consumption 4-12

13 Organization Computer memory system overview Physical arrangement of bits to form words Not always obvious e.g. interleaved 4-13

14 The Bottom Line Computer memory system overview How much? Capacity How fast? Time is money How expensive? 4-14

15 The Memory Hierarchy Relationships The faster access time, the greater cost per bit The greater capacity, the smaller cost per bit The greater capacity, the slower access time As one goes down the hierarchy, the following occur Decreasing cost per bit Increasing capacity Increasing access time Computer memory system overview Decreasing frequency of access of the memory by the processor 4-15

16 The Memory hierarchy Computer memory system overview 4-16

17 The Memory Hierarchy Computer memory system overview Registers In CPU Internal or Main memory May include one or more levels of cache RAM External memory Backing store 4-17

18 Performance of A Two-Level Memory Computer memory system overview 4-18

19 Hierarchy List Computer memory system overview Registers L1 Cache L2 Cache Main memory Disk cache Disk Optical Tape 4-19

20 Memory Hierarchy Locality of reference During the course of the execution of a program, memory references tend to cluster Computer memory system overview 4-20

21 Memory Hierarchy Computer memory system overview Additional levels can be effectively added to the hierarchy in software Portion of main memory can be used as a buffer to hold data that is to be read out to disk Such a technique, sometimes referred to as a disk cache 4-21

22 So You Want Fast? Computer memory system overview It is possible to build a computer which uses only static RAM (see later) This would be very fast This would need no cache How can you cache cache? This would cost a very large amount 4-22

23 Cache & Main Memory Cache memory Small amount of fast memory Sits between normal main memory and CPU May be located on CPU chip or module 4-23

24 Principle Cache Memory Principles CPU requests contents of memory location Check cache for this data If present, get the word from cache (fast) If not present, main memory is read into cache and the word is delivered to the processor The word is delivered from cache to CPU because of phenomenon of locality of reference Cache includes tags to identify which block of main memory is in each cache slot 4-24

25 Principle Cache Memory Principles For mapping purposes, the memory is considered to consist of number of fixedlength block of K words each Number of block : M = 2 n /K Cache consists of C lines of K words each and the number of lines is considerably less than the number of main memory blocks Each line includes a tag that identifies which particular block is currently being stored 4-25

26 Cache/Main-Memory Memory Structure Cache Memory Principles 4-26

27 Principle Cache hit occurs Data and address buffers are disabled and the communication is only between the processor and cache, with no system bus traffic Cache miss occurs Cache Memory Principles Desired address is loaded onto the system bus and the data are returned through data buffer to both cache and main memory 4-27

28 Cache Read Operation Cache Memory Principles 4-28

29 Elements of Cache Design Cache memory Cache size Mapping Function Direct Associative Set Associative Replacement Algorithm Least recently used(lru) First in first out(fifo) Least frequently used(lfu) Random Write Policy Write through Write back Write once Line Size Number of Caches Single or two level Unified or split 4-29

30 Cache Size 4-30 Cache memory Small enough that overall average cost per bit is close to that of main memory Large enough that overall average access time is close to that cache alone The larger cache, the larger number of gates involved in addressing the cache The larger cache tend to be slower than small caches Cache size is limited by available chip and board area Impossible to arrive optimum size because cache s performance is very sensitive to the nature of workload

31 Factors For Cache Size Cache memory Cost More cache is expensive Speed More cache is faster (up to a point) Checking cache for data takes time 4-31

32 Typical Cache Organization Cache memory 4-32

33 Mapping Function Needed for determining which main memory block currently occupies a cache line Direct mapping Cache of 64kByte Cache block of 4 bytes i.e. cache is 16k (2 14 ) lines of 4 bytes 16MBytes main memory 24 bit address (2 24 =16M) Cache memory 4-33

34 Direct Mapping Cache memory Maps each block of main memory into only one possible cache line i = j modulo m where i = cache line number j = main memory block number m= number of lines in the cache 4-34

35 Direct Mapping Cache Organization Cache memory 4-35

36 Direct Mapping Cache Line Table Cache line Main memory block assigned 0 0, m, 2m,, 2 s -m 1 1, m +1, 2m +1,, 2 s -m m -1 m 1, 2m 1, 3m 1,, 2 s -1. Cache memory 4-36 Least significant w bits identify a unique word or byte Most significant s bits specify one memory block The MSBs are split into a cache line field r and a tag of s-r (most significant) This latter field identifies one of the m=2 r lines of cache

37 Direct Mapping Example Cache memory 4-37

38 Direct Mapping Address Structure Cache memory Tag s-r Line or Slot r Word w bit address 2 bit word identifier (4 byte block) 22 bit block identifier 8 bit tag (=22-14) 14 bit slot or line No two blocks in the same line have the same Tag field Check contents of cache by finding line and checking Tag 4-38

39 Direct Mapping Summary Cache memory Address length = (s + w) bits Number of addressable units = 2 s+w words or bytes Block size = line size = 2 w words or bytes Number of blocks in main memory = 2 s+ w / 2 w = 2 s Number of lines in cache = m = 2 r Size of tag = (s r) bits 4-39

40 Direct Mapping Cache memory Advantage Simple Inexpensive to implement Disadvantage If a program accesses 2 blocks that map to the same li ne repeatedly, cache misses are very high 4-40

41 Associative Mapping Cache memory A main memory block can load into any line of cache The tag field uniquely identifies a block of main memory To determine whether a block is in the cache, the cache control logic must simultaneously examine every line s tag for a match Cache searching gets expensive 4-41

42 Fully Associative Cache Organization Cache memory 4-42

43 Associative Mapping Example Cache memory 4-43

44 Associative Mapping Address Structure 4-44 Tag 22 bit 22 bit tag stored with each 32 bit block of data Compare tag field with tag entry in cache to check for hit Cache memory Word 2 bit Least significant 2 bits of address identify which 16 bit word is required from 32 bit data block e.g. Address Tag Data Cache line FFFFFC FFFFFC FFF

45 Associative Mapping Summary Cache memory Address length = (s + w) bits Number of addressable units = 2 s+w words or bytes Block size = line size = 2 w words or bytes Number of blocks in main memory = 2 s+ w /2 w = 2 s Number of lines in cache = undetermined Size of tag = s bits 4-45

46 Associative Mapping Cache memory Replacement algorithms is designed to maximize the hit ratio Advantage Flexible replacement of blocks when a new block is read into the cache Disadvantage Complex circuitry is required to examine the tags of all cache lines in parallel 4-46

47 Set Associative Mapping Cache memory Compromise that reduces disadvantage of direct & associative approaches Where m = v k i = j modulo v i = cache set number j = main memory block number m= number of lines in the cache k-way set associative mapping V=m, k=1, the set associative technique reduces to direct mapping V=1, k=m, reduces to associative mapping 4-47

48 Set Associative Mapping Cache is divided into a number of sets Each set contains a number of lines A given block maps to any line in a given set e.g. Block B can be in any line of set i e.g. 2 lines per set 2 way associative mapping A given block can be in one of 2 lines in only one set Cache memory 4-48

49 K- Way Set Associative Cache Organization Cache memory 4-49

50 Set Associative Mapping Address Structure Cache memory Tag 9 bit Set 13 bit Word 2 bit Use set field to determine cache set to look in Compare the tag field to see if we have a hit e.g Address Tag Data Set number 1FF 7FFC 1FF FFF 001 7FFC FFF 4-50

51 Set Associative Mapping Example Cache memory 13 bit set number Block number in main memory is modulo , ,, FF8000map to same set 4-51

52 Set Associative Summary Cache memory Address length = (s + w) bits Number of addressable units = 2 s+w words or bytes Block size = line size = 2 w words or bytes Number of blocks in main memory = 2 d Number of lines in set = k Number of sets = v = 2 d Number of lines in cache = kv = k * 2 d Size of tag = (s d) bits 4-52

53 Two Way Set Associative Mapping Example Cache memory 4-53

54 Replacement Algorithms A new block is brought into cache, one of the existing blocks must be replaced Cache memory Direct mapping Because there is only one possible line for any particular block, the block is must be replaced 4-54

55 Replacement Algorithms Hardware implemented algorithm (speed) Cache memory Associative & set associative techniques Need replacement algorithm Least recently used(lru) Most effective Replace that block in the set that has been in the cache longest with no reference When a line is referenced, its USE bit is set to 1 and the USE bit of the other line is set to

56 Replacement Algorithms Cache memory First in first out (FIFO) Replace block that has been in cache longest Least frequently used(lfu) Replace block which has experienced the fewest references Random Not based on usage 4-56

57 Write Policy Must not overwrite a cache block unless main memory is up to date If it has not updated, old block in the cache may be overwritten When multiple processors are attached to the same bus and each processor has its own local cache A word altered in one cache, invalidates a word in other cache Multiple CPUs may have individual caches I/O may address main memory directly Cache memory 4-57

58 Write Through Cache memory All writes go to main memory as well as cache Multiple CPUs can monitor main memory traffic to keep local (to CPU) cache up to date Disadvantage Generates substantial memory traffic and may create bottleneck 4-58

59 Write Back Cache memory Minimizes memory writes Updates are made only in the cache An UPDATE bit for cache slot is set when an update occurs If a block is to be replaced, it is written back to main memory if and only if the UPDATE bit is set Other caches get out of sync I/O must access main memory through cache Complex circuitry and a potential bottleneck 15% of memory references are writes 4-59

60 Cache Coherency If data in one cache is altered, this invalidates the corresponding word in main memory and the same word in other caches Even if a write-through policy is used, the other caches may contain invalid data A system that prevents this problem said to maintain cache coherency Bus watching with write through Hardware transparency Noncachable memory Cache memory 4-60

61 Bus Watching With Write Through Cache memory Each cache controller monitors address lines to detect write operations to memory by other bus masters If another master writes to a location in shared memory that also resides in cache memory, cache controller invalidates that cache entry This strategy depends on the use of a writethrough policy by all cache controllers 4-61

62 Hardware Transparency Cache memory Additional hardware is used to ensure that all updates to main memory via cache reflected in all caches If one processor modifies a word in its cache, this update is written to main memory Any matching words in other caches are similarly updated 4-62

63 Noncachable Memory Cache memory Only a portion of main memory is shared by more than one processor, and this is designated as noncachable All accesses to shared memory are cache misses because the shared memory is never copied into the cache The noncachable memory can be identified using chip-select logic of high-address bits 4-63

64 Line size When a block of data is retrieved and placed in the cache, the desired word and some number of adjacent words are retrieved Two specific effects come into play Cache memory Larger blocks reduce the number of block that fit into a cache. Because each block fetch overwrites older cache contents, a small number of blocks result in data being overwritten shortly after it is fetched As a block becomes larger, each additional word is farther from the requested word, and therefore less likely to be needed in near future 4-64

65 Line size Cache memory The relationship between block size and hit ratio is complex, depending on the locality characteristics of a particular program No definitive optimum value has been found A size of from 2 to 8 words seems reasonably close to optimum 4-65

66 Number of Caches Cache memory On chip cache Possible to have cache on the same chip as the processor Reduces processor s external bus activity and speed up execution times and increases overall system performance Most contemporary designs include both on-chip and external caches Two-level cache Internal cache designed level 1(L1) and external cache designed level 2(L2) 4-66

67 Number of Caches Reason for including L2 cache If there is no L2 cache and the processor makes access request for memory location not in L1 cache, the processor must access DRAM or ROM memory across the bus Poor performance because of slow bus speed and slow memory access time If L2 SRAM cache is used, missing information can be quickly retrieved Effect of using L2 depends on hit rates in both L1 and L2 caches Cache memory 4-67

68 Number of Caches Cache memory To split the cache into two: one dedicated to instruction and one dedicated to data Potential advantage of a unified cache For a given cache size, a unified cache has higher hit rate than split caches because it balances the load between instruction and data fetches automatically Only one cache needs to be designed and implemented 4-68

69 Number of Caches Cache memory The trend toward split caches Superscalar machines (Pentium II, PowerPC) which emphasize parallel instruction execution and prefetching of predicted future instructions The key advantage of the split cache design is that it eliminates condition for cache between the instruction processor and the execution unit Important in any design that relies on the pipelining of instructions 4-69

70 Pentium 4 Cache Pentium 4 and PowerPC no on chip cache k using 16 byte lines and four way set associative organization Pentium (all versions) two on chip L1 caches Data & instructions Pentium 4 L1 caches 8k bytes 64 byte lines four way set associative L2 cache Feeding both L1 caches 256k 128 byte lines 8 way set associative

71 Pentium 4 Diagram (Simplified) Pentium 4 and PowerPC 4-71

72 Pentium 4 Core Processor Pentium 4 and PowerPC 4-72 Fetch/Decode Unit Fetches instructions from L2 cache Decode into micro-ops Store micro-ops in L1 cache Out of order execution logic Schedules micro-ops Based on data dependence and resources May speculatively execute Execution units Execute micro-ops Data from L1 cache Results in registers Memory subsystem L2 cache and systems bus

73 Pentium 4 Design Reasoning 4-73 Pentium 4 and PowerPC Decodes instructions into RISC like micro-ops bef ore L1 cache Micro-ops fixed length Superscalar pipelining and scheduling Pentium instructions long & complex Performance improved by separating decoding fr om scheduling & pipelining (More later ch14) Data cache is write back Can be configured to write through L1 cache controlled by 2 bits in register CD = cache disable NW = not write through 2 instructions to invalidate (flush) cache and write back then i nvalidate

74 Structure Of Pentium II Data Cache LRU replacement algorithm Write-back policy Pentium 4 and PowerPC 4-74

75 Data Cache Consistency Pentium 4 and PowerPC To provide cache consistency, data cache supports a protocol MESI (modified/exclusive/shared/invalid) Data cache includes two status bit per tag, so that each line can be in one of four states Modified Exclusive Shared Invalid 4-75

76 MESI Cache Line States Pentium 4 and PowerPC M E S I Modified Exclusive Shared Invalid This cache line valid? Yes Yes Yes No The memory copy is Copies exist in other caches? Out of date Valid Valid - No No Maybe Maybe A write to this line Does not go to bus Does not go to bus Goes to bus and updates cache Goes directly to use 4-76

77 Cache Control Pentium 4 and PowerPC Internal cache controlled by two bits CD (cache disable) NW(not write through) Two Pentium II instruction that used to control cache INVD invalidates(flushes) internal cache memory and signals external cache to invalidate WBINVD writes back and invalidates internal cache, then writes back and invalidates external cache 4-77

78 Pentium II Cache Operation Modes Pentium 4 and PowerPC Control Bits Operating Mode CD NW Cache Fills Write Throughs Invalidates Enabled Enabled Enabled 0 Disabled Enabled Enabled 1 Disabled Disabled Disabled 4-78

79 PowerPC Internal Cache Pentium 4 and PowerPC Model Size Bytes/Line Organization PowerPC kbyte 32 8-way set associative PowerPC kbyte 32 2-way set associative PowerPC kbyte 32 4-way set associative PowerPC kbyte 64 8-way set associative PowerPC G kbyte 64 8-way set associative PowerPC G kbyte 32 8-way set associative 4-79

80 PowerPC G3 Block Diagram Pentium 4 and PowerPC 4-80

81 PowerPC Cache Organization Pentium 4 and PowerPC The L1 caches are eight-way set associative and use a version of the MESI cache coherency protocol The L2 cache is a two-way set associative cache with 256K, 512K, of 1 Mbyte of memory 4-81

82 Characteristics of Two-Level Memories Appendix 4A Typical access time ratios Main Memory Cache Virtual Memory (Paging) 5/1 1000/1 1000/1 Disk Cache Memory management system Implemented by special hardware Combination of hardware and system software System software Typical block size 4 to 128 bytes 64 to 4096 bytes 64 to 4096 bytes Access of processor to second level 4-82 Direct access Indirect access Indirect access

83 Relative Dynamic Frequency Appendix 4A Study [HUCK83] [KNUT71] [PATT82] [TANE78] Language Pascal FORTRAN Pascal C SAL Workload Scientific Student System System System Assign Loop Call IF GoTo Other

84 Locality Each call is represented by the line moving down and to the right Each return is represented by the line moving up and to the right A window with depth equal to 5 is defined Only a sequence of calls and returns with a net movement of 6 in either direction causes the window to move Appendix 4A 4-84

85 The Call/Return Behavior of Programs Appendix 4A 4-85

86 Locality Appendix 4A Spatial locality Refers to the tendency of execution to involve a number of memory locations that are clustered Temporal locality Refers to the tendency for a processor to access memory locations that have been used recently 4-86

87 Locality of Reference For Web Pages Appendix 4A 4-87

88 Operation of Two-Level Memory Appendix 4A T s = H T 1 + (1 - H) (T 1 + T 2 ) = T 1 + (1 H) T 2 where T s = average(system) access time T 1 = access time of M1 (e.g., cache, disk cache) T 2 = access time of M2 (e.g., main memory, disk) H = hit ratio (fraction of time reference is found in M1) 4-88

89 Performance Where C s = C 1 S S C s = average cost per bit for the combined two-level memory C 1 = average cost per bit of upper-level memory M1 C 2 = average cost per bit of lower-level memory M2 S 1 = size of M1 S 2 = size of M C S We would like C s C 2 (Given C 1 >> C 2, this requires S 1 << S 2 ) 2 2 S 2 Appendix 4A 4-89

90 Memory cost Vs. Memory Size Appendix 4A 4-90

91 Performance Consider the quantity T 2 / T 1, which referred to as the access efficiency T T 1 s = 1 + (1 1 H ) T T 2 1 Appendix 4A 4-91

92 Access Efficiency Vs. Hit Ratio(T 2 / T 1 ) Appendix 4A 4-92

93 Hit Ratio Vs. Memory Size Appendix 4A 4-93

94 Performance Appendix 4A If there is strong locality, it is possible to achieve high values of hit ratio even with relatively small upper-level memory size Small cache sizes will yield a hit ratio above 0.75 regardless of the size of main memory A cache in the range of 1K to 128K words is generally adequate, whereas main memory is now typically in the multiple-megabyte range If we need only a relatively small upper-level memory to achieve good performance, the average cost per bit of the two levels of memory will approach that of the cheaper memory 4-94

Computer & Microprocessor Architecture HCA103

Computer & Microprocessor Architecture HCA103 Computer & Microprocessor Architecture HCA103 Cache Memory UTM-RHH Slide Set 4 1 Characteristics Location Capacity Unit of transfer Access method Performance Physical type Physical characteristics Organisation

More information

William Stallings Computer Organization and Architecture 8th Edition. Cache Memory

William Stallings Computer Organization and Architecture 8th Edition. Cache Memory William Stallings Computer Organization and Architecture 8th Edition Chapter 4 Cache Memory Characteristics Location Capacity Unit of transfer Access method Performance Physical type Physical characteristics

More information

Unit 2. Chapter 4 Cache Memory

Unit 2. Chapter 4 Cache Memory Unit 2 Chapter 4 Cache Memory Characteristics Location Capacity Unit of transfer Access method Performance Physical type Physical characteristics Organisation Location CPU Internal External Capacity Word

More information

Characteristics. Microprocessor Design & Organisation HCA2102. Unit of Transfer. Location. Memory Hierarchy Diagram

Characteristics. Microprocessor Design & Organisation HCA2102. Unit of Transfer. Location. Memory Hierarchy Diagram Microprocessor Design & Organisation HCA2102 Cache Memory Characteristics Location Unit of transfer Access method Performance Physical type Physical Characteristics UTM-RHH Slide Set 5 2 Location Internal

More information

Characteristics of Memory Location wrt Motherboard. CSCI 4717 Computer Architecture. Characteristics of Memory Capacity Addressable Units

Characteristics of Memory Location wrt Motherboard. CSCI 4717 Computer Architecture. Characteristics of Memory Capacity Addressable Units CSCI 4717/5717 Computer Architecture Topic: Cache Memory Reading: Stallings, Chapter 4 Characteristics of Memory Location wrt Motherboard Inside CPU temporary memory or registers Motherboard main memory

More information

Eastern Mediterranean University School of Computing and Technology CACHE MEMORY. Computer memory is organized into a hierarchy.

Eastern Mediterranean University School of Computing and Technology CACHE MEMORY. Computer memory is organized into a hierarchy. Eastern Mediterranean University School of Computing and Technology ITEC255 Computer Organization & Architecture CACHE MEMORY Introduction Computer memory is organized into a hierarchy. At the highest

More information

Overview IN this chapter we will study. William Stallings Computer Organization and Architecture 6th Edition

Overview IN this chapter we will study. William Stallings Computer Organization and Architecture 6th Edition William Stallings Computer Organization and Architecture 6th Edition Chapter 4 Cache Memory Overview IN this chapter we will study 4.1 COMPUTER MEMORY SYSTEM OVERVIEW 4.2 CACHE MEMORY PRINCIPLES 4.3 ELEMENTS

More information

William Stallings Computer Organization and Architecture 10 th Edition Pearson Education, Inc., Hoboken, NJ. All rights reserved.

William Stallings Computer Organization and Architecture 10 th Edition Pearson Education, Inc., Hoboken, NJ. All rights reserved. + William Stallings Computer Organization and Architecture 10 th Edition 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved. 2 + Chapter 4 Cache Memory 3 Location Internal (e.g. processor registers,

More information

WEEK 7. Chapter 4. Cache Memory Pearson Education, Inc., Hoboken, NJ. All rights reserved.

WEEK 7. Chapter 4. Cache Memory Pearson Education, Inc., Hoboken, NJ. All rights reserved. WEEK 7 + Chapter 4 Cache Memory Location Internal (e.g. processor registers, cache, main memory) External (e.g. optical disks, magnetic disks, tapes) Capacity Number of words Number of bytes Unit of Transfer

More information

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (4 th Week)

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (4 th Week) + (Advanced) Computer Organization & Architechture Prof. Dr. Hasan Hüseyin BALIK (4 th Week) + Outline 2. The computer system 2.1 A Top-Level View of Computer Function and Interconnection 2.2 Cache Memory

More information

TK2123: COMPUTER ORGANISATION & ARCHITECTURE. CPU and Memory (2)

TK2123: COMPUTER ORGANISATION & ARCHITECTURE. CPU and Memory (2) TK2123: COMPUTER ORGANISATION & ARCHITECTURE CPU and Memory (2) 1 Contents This lecture will discuss: Cache. Error Correcting Codes. 2 The Memory Hierarchy Trade-off: cost, capacity and access time. Faster

More information

Chapter 4 Main Memory

Chapter 4 Main Memory Chapter 4 Main Memory Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge of mathematics, science and engineering fundamentals

More information

Chapter 4 - Cache Memory

Chapter 4 - Cache Memory Chapter 4 - Cache Memory Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 4 - Cache Memory 1 / 143 Table of Contents I 1 Introduction 2 Computer Memory System Overview Characteristics

More information

COMPUTER ARCHITECTURE AND ORGANIZATION

COMPUTER ARCHITECTURE AND ORGANIZATION Memory System 1. Microcomputer Memory Memory is an essential component of the microcomputer system. It stores binary instructions and datum for the microcomputer. The memory is the place where the computer

More information

Cache Memory Part 1. Cache Memory Part 1 1

Cache Memory Part 1. Cache Memory Part 1 1 Cache Memory Part 1 Cache Memory Part 1 1 - Definition: Cache (Pronounced as cash ) is a small and very fast temporary storage memory. It is designed to speed up the transfer of data and instructions.

More information

The Memory System. Components of the Memory System. Problems with the Memory System. A Solution

The Memory System. Components of the Memory System. Problems with the Memory System. A Solution Datorarkitektur Fö 2-1 Datorarkitektur Fö 2-2 Components of the Memory System The Memory System 1. Components of the Memory System Main : fast, random access, expensive, located close (but not inside)

More information

Memory Pearson Education, Inc., Hoboken, NJ. All rights reserved.

Memory Pearson Education, Inc., Hoboken, NJ. All rights reserved. 1 Memory + 2 Location Internal (e.g. processor registers, cache, main memory) External (e.g. optical disks, magnetic disks, tapes) Capacity Number of words Number of bytes Unit of Transfer Word Block Access

More information

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory Memory Hierarchy Contents Memory System Overview Cache Memory Internal Memory External Memory Virtual Memory Memory Hierarchy Registers In CPU Internal or Main memory Cache RAM External memory Backing

More information

Cache memory. Lecture 4. Principles, structure, mapping

Cache memory. Lecture 4. Principles, structure, mapping Cache memory Lecture 4 Principles, structure, mapping Computer memory overview Computer memory overview By analyzing memory hierarchy from top to bottom, the following conclusions can be done: a. Cost

More information

Physical characteristics (such as packaging, volatility, and erasability Organization.

Physical characteristics (such as packaging, volatility, and erasability Organization. CS 320 Ch 4 Cache Memory 1. The author list 8 classifications for memory systems; Location Capacity Unit of transfer Access method (there are four:sequential, Direct, Random, and Associative) Performance

More information

Computer Organization. Chapter 12: Memory organization

Computer Organization. Chapter 12: Memory organization Computer Organization Chapter 12: Memory organization Memory Organization Recall: Information is stored in the memory as a collection of bits. Collection of bits that are stored or retrieved simultaneously

More information

Lecture 2: Memory Systems

Lecture 2: Memory Systems Lecture 2: Memory Systems Basic components Memory hierarchy Cache memory Virtual Memory Zebo Peng, IDA, LiTH Many Different Technologies Zebo Peng, IDA, LiTH 2 Internal and External Memories CPU Date transfer

More information

Chapter 6 Objectives

Chapter 6 Objectives Chapter 6 Memory Chapter 6 Objectives Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured.

More information

Computer Organization

Computer Organization University of Pune S.E. I.T. Subject code: 214442 Computer Organization Part 20 : Memory Organization Basics UNIT IV Tushar B. Kute, Department of Information Technology, Sandip Institute of Technology

More information

CPU issues address (and data for write) Memory returns data (or acknowledgment for write)

CPU issues address (and data for write) Memory returns data (or acknowledgment for write) The Main Memory Unit CPU and memory unit interface Address Data Control CPU Memory CPU issues address (and data for write) Memory returns data (or acknowledgment for write) Memories: Design Objectives

More information

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY 1 Memories: Review SRAM: value is stored on a pair of inverting gates very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: value is stored

More information

Computer Organization

Computer Organization University of Pune S.E. I.T. Subject code: 214442 Computer Organization Part 20 : Memory Organization Basics UNIT IV Tushar B. Kute, Department of Information Technology, Sandip Institute of Technology

More information

UNIT-V MEMORY ORGANIZATION

UNIT-V MEMORY ORGANIZATION UNIT-V MEMORY ORGANIZATION 1 The main memory of a computer is semiconductor memory.the main memory unit is basically consists of two kinds of memory: RAM (RWM):Random access memory; which is volatile in

More information

CMPSC 311- Introduction to Systems Programming Module: Caching

CMPSC 311- Introduction to Systems Programming Module: Caching CMPSC 311- Introduction to Systems Programming Module: Caching Professor Patrick McDaniel Fall 2016 Reminder: Memory Hierarchy L0: Registers CPU registers hold words retrieved from L1 cache Smaller, faster,

More information

A Cache Hierarchy in a Computer System

A Cache Hierarchy in a Computer System A Cache Hierarchy in a Computer System Ideally one would desire an indefinitely large memory capacity such that any particular... word would be immediately available... We are... forced to recognize the

More information

k -bit address bus n-bit data bus Control lines ( R W, MFC, etc.)

k -bit address bus n-bit data bus Control lines ( R W, MFC, etc.) THE MEMORY SYSTEM SOME BASIC CONCEPTS Maximum size of the Main Memory byte-addressable CPU-Main Memory Connection, Processor MAR MDR k -bit address bus n-bit data bus Memory Up to 2 k addressable locations

More information

LECTURE 10: Improving Memory Access: Direct and Spatial caches

LECTURE 10: Improving Memory Access: Direct and Spatial caches EECS 318 CAD Computer Aided Design LECTURE 10: Improving Memory Access: Direct and Spatial caches Instructor: Francis G. Wolff wolff@eecs.cwru.edu Case Western Reserve University This presentation uses

More information

Memory. Objectives. Introduction. 6.2 Types of Memory

Memory. Objectives. Introduction. 6.2 Types of Memory Memory Objectives Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured. Master the concepts

More information

Memory hierarchy and cache

Memory hierarchy and cache Memory hierarchy and cache QUIZ EASY 1). What is used to design Cache? a). SRAM b). DRAM c). Blend of both d). None. 2). What is the Hierarchy of memory? a). Processor, Registers, Cache, Tape, Main memory,

More information

Chapter 6 Memory 11/3/2015. Chapter 6 Objectives. 6.2 Types of Memory. 6.1 Introduction

Chapter 6 Memory 11/3/2015. Chapter 6 Objectives. 6.2 Types of Memory. 6.1 Introduction Chapter 6 Objectives Chapter 6 Memory Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured.

More information

CSC 553 Operating Systems

CSC 553 Operating Systems CSC 553 Operating Systems Lecture 1- Computer System Overview Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users Manages secondary memory

More information

Computer Organization (Autonomous)

Computer Organization (Autonomous) 2-7-27 Computer Organization (Autonomous) UNIT IV Sections - A & D SYLLABUS The Memory System: Memory Hierarchy, - RAM and ROM Chips, Memory Address Maps, Memory Connection to, Auxiliary Magnetic Disks,

More information

LECTURE 11. Memory Hierarchy

LECTURE 11. Memory Hierarchy LECTURE 11 Memory Hierarchy MEMORY HIERARCHY When it comes to memory, there are two universally desirable properties: Large Size: ideally, we want to never have to worry about running out of memory. Speed

More information

Chapter Seven. Large & Fast: Exploring Memory Hierarchy

Chapter Seven. Large & Fast: Exploring Memory Hierarchy Chapter Seven Large & Fast: Exploring Memory Hierarchy 1 Memories: Review SRAM (Static Random Access Memory): value is stored on a pair of inverting gates very fast but takes up more space than DRAM DRAM

More information

MEMORY. Objectives. L10 Memory

MEMORY. Objectives. L10 Memory MEMORY Reading: Chapter 6, except cache implementation details (6.4.1-6.4.6) and segmentation (6.5.5) https://en.wikipedia.org/wiki/probability 2 Objectives Understand the concepts and terminology of hierarchical

More information

A Review on Cache Memory with Multiprocessor System

A Review on Cache Memory with Multiprocessor System A Review on Cache Memory with Multiprocessor System Chirag R. Patel 1, Rajesh H. Davda 2 1,2 Computer Engineering Department, C. U. Shah College of Engineering & Technology, Wadhwan (Gujarat) Abstract

More information

Overview. EE 4504 Computer Organization. Historically, the limiting factor in a computer s performance has been memory access time

Overview. EE 4504 Computer Organization. Historically, the limiting factor in a computer s performance has been memory access time Overview EE 4504 Computer Organization Section 3 Computer Memory Historically, the limiting factor in a computer s performance has been memory access time Memory speed has been slow compared to the speed

More information

Module 5a: Introduction To Memory System (MAIN MEMORY)

Module 5a: Introduction To Memory System (MAIN MEMORY) Module 5a: Introduction To Memory System (MAIN MEMORY) R E F E R E N C E S : S T A L L I N G S, C O M P U T E R O R G A N I Z A T I O N A N D A R C H I T E C T U R E M O R R I S M A N O, C O M P U T E

More information

Locality. Cache. Direct Mapped Cache. Direct Mapped Cache

Locality. Cache. Direct Mapped Cache. Direct Mapped Cache Locality A principle that makes having a memory hierarchy a good idea If an item is referenced, temporal locality: it will tend to be referenced again soon spatial locality: nearby items will tend to be

More information

Chapter 1 Computer System Overview

Chapter 1 Computer System Overview Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Ninth Edition By William Stallings Operating System Exploits the hardware resources of one or more processors Provides

More information

CPE300: Digital System Architecture and Design

CPE300: Digital System Architecture and Design CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Virtual Memory 11282011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Review Cache Virtual Memory Projects 3 Memory

More information

Memory Hierarchies. Instructor: Dmitri A. Gusev. Fall Lecture 10, October 8, CS 502: Computers and Communications Technology

Memory Hierarchies. Instructor: Dmitri A. Gusev. Fall Lecture 10, October 8, CS 502: Computers and Communications Technology Memory Hierarchies Instructor: Dmitri A. Gusev Fall 2007 CS 502: Computers and Communications Technology Lecture 10, October 8, 2007 Memories SRAM: value is stored on a pair of inverting gates very fast

More information

1. Memory technology & Hierarchy

1. Memory technology & Hierarchy 1 Memory technology & Hierarchy Caching and Virtual Memory Parallel System Architectures Andy D Pimentel Caches and their design cf Henessy & Patterson, Chap 5 Caching - summary Caches are small fast memories

More information

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang CHAPTER 6 Memory 6.1 Memory 341 6.2 Types of Memory 341 6.3 The Memory Hierarchy 343 6.3.1 Locality of Reference 346 6.4 Cache Memory 347 6.4.1 Cache Mapping Schemes 349 6.4.2 Replacement Policies 365

More information

TDT Coarse-Grained Multithreading. Review on ILP. Multi-threaded execution. Contents. Fine-Grained Multithreading

TDT Coarse-Grained Multithreading. Review on ILP. Multi-threaded execution. Contents. Fine-Grained Multithreading Review on ILP TDT 4260 Chap 5 TLP & Hierarchy What is ILP? Let the compiler find the ILP Advantages? Disadvantages? Let the HW find the ILP Advantages? Disadvantages? Contents Multi-threading Chap 3.5

More information

CPE300: Digital System Architecture and Design

CPE300: Digital System Architecture and Design CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Cache 11232011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Review Memory Components/Boards Two-Level Memory Hierarchy

More information

a process may be swapped in and out of main memory such that it occupies different regions

a process may be swapped in and out of main memory such that it occupies different regions Virtual Memory Characteristics of Paging and Segmentation A process may be broken up into pieces (pages or segments) that do not need to be located contiguously in main memory Memory references are dynamically

More information

Page 1. Multilevel Memories (Improving performance using a little cash )

Page 1. Multilevel Memories (Improving performance using a little cash ) Page 1 Multilevel Memories (Improving performance using a little cash ) 1 Page 2 CPU-Memory Bottleneck CPU Memory Performance of high-speed computers is usually limited by memory bandwidth & latency Latency

More information

Operating system Dr. Shroouq J.

Operating system Dr. Shroouq J. 2.2.2 DMA Structure In a simple terminal-input driver, when a line is to be read from the terminal, the first character typed is sent to the computer. When that character is received, the asynchronous-communication

More information

Memory Hierarchy Recall the von Neumann bottleneck - single, relatively slow path between the CPU and main memory.

Memory Hierarchy Recall the von Neumann bottleneck - single, relatively slow path between the CPU and main memory. Memory Hierarchy Goal: Fast, unlimited storage at a reasonable cost per bit. Recall the von Neumann bottleneck - single, relatively slow path between the CPU and main memory. Cache - 1 Typical system view

More information

Chapter Seven Morgan Kaufmann Publishers

Chapter Seven Morgan Kaufmann Publishers Chapter Seven Memories: Review SRAM: value is stored on a pair of inverting gates very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: value is stored as a charge on capacitor (must be

More information

Advanced Parallel Architecture Lesson 4. Annalisa Massini /2015

Advanced Parallel Architecture Lesson 4. Annalisa Massini /2015 Advanced Parallel Architecture Lesson 4 Annalisa Massini - Modules and connections 2 Components and connections The CU and the ALU constitute the Central Processing Unit Data and instructions need to get

More information

CHAPTER 6 Memory. CMPS375 Class Notes Page 1/ 16 by Kuo-pao Yang

CHAPTER 6 Memory. CMPS375 Class Notes Page 1/ 16 by Kuo-pao Yang CHAPTER 6 Memory 6.1 Memory 233 6.2 Types of Memory 233 6.3 The Memory Hierarchy 235 6.3.1 Locality of Reference 237 6.4 Cache Memory 237 6.4.1 Cache Mapping Schemes 239 6.4.2 Replacement Policies 247

More information

Donn Morrison Department of Computer Science. TDT4255 Memory hierarchies

Donn Morrison Department of Computer Science. TDT4255 Memory hierarchies TDT4255 Lecture 10: Memory hierarchies Donn Morrison Department of Computer Science 2 Outline Chapter 5 - Memory hierarchies (5.1-5.5) Temporal and spacial locality Hits and misses Direct-mapped, set associative,

More information

Advanced Memory Organizations

Advanced Memory Organizations CSE 3421: Introduction to Computer Architecture Advanced Memory Organizations Study: 5.1, 5.2, 5.3, 5.4 (only parts) Gojko Babić 03-29-2018 1 Growth in Performance of DRAM & CPU Huge mismatch between CPU

More information

High Performance Computer Architecture Prof. Ajit Pal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

High Performance Computer Architecture Prof. Ajit Pal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur High Performance Computer Architecture Prof. Ajit Pal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 23 Hierarchical Memory Organization (Contd.) Hello

More information

Database Management Systems, 2nd edition, Raghu Ramakrishnan, Johannes Gehrke, McGraw-Hill

Database Management Systems, 2nd edition, Raghu Ramakrishnan, Johannes Gehrke, McGraw-Hill Lecture Handout Database Management System Lecture No. 34 Reading Material Database Management Systems, 2nd edition, Raghu Ramakrishnan, Johannes Gehrke, McGraw-Hill Modern Database Management, Fred McFadden,

More information

Memory Hierarchy: Motivation

Memory Hierarchy: Motivation Memory Hierarchy: Motivation The gap between CPU performance and main memory speed has been widening with higher performance CPUs creating performance bottlenecks for memory access instructions. The memory

More information

Q.1 Explain Computer s Basic Elements

Q.1 Explain Computer s Basic Elements Q.1 Explain Computer s Basic Elements Ans. At a top level, a computer consists of processor, memory, and I/O components, with one or more modules of each type. These components are interconnected in some

More information

The Memory Hierarchy & Cache

The Memory Hierarchy & Cache Removing The Ideal Memory Assumption: The Memory Hierarchy & Cache The impact of real memory on CPU Performance. Main memory basic properties: Memory Types: DRAM vs. SRAM The Motivation for The Memory

More information

CMPSC 311- Introduction to Systems Programming Module: Caching

CMPSC 311- Introduction to Systems Programming Module: Caching CMPSC 311- Introduction to Systems Programming Module: Caching Professor Patrick McDaniel Fall 2014 Lecture notes Get caching information form other lecture http://hssl.cs.jhu.edu/~randal/419/lectures/l8.5.caching.pdf

More information

Memory Hierarchy: The motivation

Memory Hierarchy: The motivation Memory Hierarchy: The motivation The gap between CPU performance and main memory has been widening with higher performance CPUs creating performance bottlenecks for memory access instructions. The memory

More information

Lecture 12: Memory hierarchy & caches

Lecture 12: Memory hierarchy & caches Lecture 12: Memory hierarchy & caches A modern memory subsystem combines fast small memory, slower larger memories This lecture looks at why and how Focus today mostly on electronic memories. Next lecture

More information

Memory Organization MEMORY ORGANIZATION. Memory Hierarchy. Main Memory. Auxiliary Memory. Associative Memory. Cache Memory.

Memory Organization MEMORY ORGANIZATION. Memory Hierarchy. Main Memory. Auxiliary Memory. Associative Memory. Cache Memory. MEMORY ORGANIZATION Memory Hierarchy Main Memory Auxiliary Memory Associative Memory Cache Memory Virtual Memory MEMORY HIERARCHY Memory Hierarchy Memory Hierarchy is to obtain the highest possible access

More information

Fig 7.30 The Cache Mapping Function. Memory Fields and Address Translation

Fig 7.30 The Cache Mapping Function. Memory Fields and Address Translation 7-47 Chapter 7 Memory System Design Fig 7. The Mapping Function Example: KB MB CPU Word Block Main Address Mapping function The cache mapping function is responsible for all cache operations: Placement

More information

Concept of Memory. The memory of computer is broadly categories into two categories:

Concept of Memory. The memory of computer is broadly categories into two categories: Concept of Memory We have already mentioned that digital computer works on stored programmed concept introduced by Von Neumann. We use memory to store the information, which includes both program and data.

More information

Chapter Seven. SRAM: value is stored on a pair of inverting gates very fast but takes up more space than DRAM (4 to 6 transistors)

Chapter Seven. SRAM: value is stored on a pair of inverting gates very fast but takes up more space than DRAM (4 to 6 transistors) Chapter Seven emories: Review SRA: value is stored on a pair of inverting gates very fast but takes up more space than DRA (4 to transistors) DRA: value is stored as a charge on capacitor (must be refreshed)

More information

GUJARAT TECHNOLOGICAL UNIVERSITY MASTER OF COMPUTER APPLICATION SEMESTER: III

GUJARAT TECHNOLOGICAL UNIVERSITY MASTER OF COMPUTER APPLICATION SEMESTER: III GUJARAT TECHNOLOGICAL UNIVERSITY MASTER OF COMPUTER APPLICATION SEMESTER: III Subject Name: Operating System (OS) Subject Code: 630004 Unit-1: Computer System Overview, Operating System Overview, Processes

More information

Assignment 1 due Mon (Feb 4pm

Assignment 1 due Mon (Feb 4pm Announcements Assignment 1 due Mon (Feb 19) @ 4pm Next week: no classes Inf3 Computer Architecture - 2017-2018 1 The Memory Gap 1.2x-1.5x 1.07x H&P 5/e, Fig. 2.2 Memory subsystem design increasingly important!

More information

ECE Lab 8. Logic Design for a Direct-Mapped Cache. To understand the function and design of a direct-mapped memory cache.

ECE Lab 8. Logic Design for a Direct-Mapped Cache. To understand the function and design of a direct-mapped memory cache. ECE 201 - Lab 8 Logic Design for a Direct-Mapped Cache PURPOSE To understand the function and design of a direct-mapped memory cache. EQUIPMENT Simulation Software REQUIREMENTS Electronic copy of your

More information

Internal Memory Cache Stallings: Ch 4, Ch 5 Key Characteristics Locality Cache Main Memory

Internal Memory Cache Stallings: Ch 4, Ch 5 Key Characteristics Locality Cache Main Memory Lecture 3 Internal Memory Cache Stallings: Ch 4, Ch 5 Key Characteristics Locality Cache Main Memory Key Characterics of Memories / Storage (Sta06 Table 4.1) 26.1.2010 2 Goals I want my memory lightning

More information

Memory Design. Cache Memory. Processor operates much faster than the main memory can.

Memory Design. Cache Memory. Processor operates much faster than the main memory can. Memory Design Cache Memory Processor operates much faster than the main memory can. To ameliorate the sitution, a high speed memory called a cache memory placed between the processor and main memory. Barry

More information

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy Chapter 5A Large and Fast: Exploiting Memory Hierarchy Memory Technology Static RAM (SRAM) Fast, expensive Dynamic RAM (DRAM) In between Magnetic disk Slow, inexpensive Ideal memory Access time of SRAM

More information

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg Computer Architecture and System Software Lecture 09: Memory Hierarchy Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Midterm returned + solutions in class today SSD

More information

Cache Memory COE 403. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals

Cache Memory COE 403. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals Cache Memory COE 403 Computer Architecture Prof. Muhamed Mudawar Computer Engineering Department King Fahd University of Petroleum and Minerals Presentation Outline The Need for Cache Memory The Basics

More information

Cache Memory. Content

Cache Memory. Content Cache Memory Raul Queiroz Feitosa Content Memory Hierarchy Principle of Locality Some Definitions Cache Architectures Fully Associative Direct Mapping Set Associative Replacement Policy Main Memory Update

More information

The levels of a memory hierarchy. Main. Memory. 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms

The levels of a memory hierarchy. Main. Memory. 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms The levels of a memory hierarchy CPU registers C A C H E Memory bus Main Memory I/O bus External memory 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms 1 1 Some useful definitions When the CPU finds a requested

More information

COSC 6385 Computer Architecture - Memory Hierarchies (I)

COSC 6385 Computer Architecture - Memory Hierarchies (I) COSC 6385 Computer Architecture - Memory Hierarchies (I) Edgar Gabriel Spring 2018 Some slides are based on a lecture by David Culler, University of California, Berkley http//www.eecs.berkeley.edu/~culler/courses/cs252-s05

More information

William Stallings Copyright 2009

William Stallings Copyright 2009 A PPENDIX D V ICTIM C ACHE S TRATEGIES William Stallings Copyright 2009 D.1 VICTIM CACHE...2! D.2 SELECTIVE VICTIM CACHE...4! Incoming Blocks from Memory...4! Swap Between Direct-Mapped Cache and Victim

More information

Transistor: Digital Building Blocks

Transistor: Digital Building Blocks Final Exam Review Transistor: Digital Building Blocks Logically, each transistor acts as a switch Combined to implement logic functions (gates) AND, OR, NOT Combined to build higher-level structures Multiplexer,

More information

CS Computer Architecture

CS Computer Architecture CS 35101 Computer Architecture Section 600 Dr. Angela Guercio Fall 2010 An Example Implementation In principle, we could describe the control store in binary, 36 bits per word. We will use a simple symbolic

More information

Multilevel Memories. Joel Emer Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology

Multilevel Memories. Joel Emer Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology 1 Multilevel Memories Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Based on the material prepared by Krste Asanovic and Arvind CPU-Memory Bottleneck 6.823

More information

CPU Pipelining Issues

CPU Pipelining Issues CPU Pipelining Issues What have you been beating your head against? This pipe stuff makes my head hurt! L17 Pipeline Issues & Memory 1 Pipelining Improve performance by increasing instruction throughput

More information

Chapter 8 Virtual Memory

Chapter 8 Virtual Memory Operating Systems: Internals and Design Principles Chapter 8 Virtual Memory Seventh Edition William Stallings Modified by Rana Forsati for CSE 410 Outline Principle of locality Paging - Effect of page

More information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science ã Cengage Learning Objectives After studying this chapter, the student should be able to: q List the three subsystems of a computer. q Describe

More information

Memory Hierarchy. Cache Memory. Virtual Memory

Memory Hierarchy. Cache Memory. Virtual Memory MEMORY ORGANIZATION Memory Hierarchy Main Memory Cache Memory Virtual Memory MEMORY HIERARCHY Memory Hierarchy Memory Hierarchy is to obtain the highest possible access speed while minimizing the total

More information

CPUs. Caching: The Basic Idea. Cache : MainMemory :: Window : Caches. Memory management. CPU performance. 1. Door 2. Bigger Door 3. The Great Outdoors

CPUs. Caching: The Basic Idea. Cache : MainMemory :: Window : Caches. Memory management. CPU performance. 1. Door 2. Bigger Door 3. The Great Outdoors CPUs Caches. Memory management. CPU performance. Cache : MainMemory :: Window : 1. Door 2. Bigger Door 3. The Great Outdoors 4. Horizontal Blinds 18% 9% 64% 9% Door Bigger Door The Great Outdoors Horizontal

More information

Large and Fast: Exploiting Memory Hierarchy

Large and Fast: Exploiting Memory Hierarchy CSE 431: Introduction to Operating Systems Large and Fast: Exploiting Memory Hierarchy Gojko Babić 10/5/018 Memory Hierarchy A computer system contains a hierarchy of storage devices with different costs,

More information

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Computer Organization and Structure. Bing-Yu Chen National Taiwan University Computer Organization and Structure Bing-Yu Chen National Taiwan University Large and Fast: Exploiting Memory Hierarchy The Basic of Caches Measuring & Improving Cache Performance Virtual Memory A Common

More information

Memory. Lecture 22 CS301

Memory. Lecture 22 CS301 Memory Lecture 22 CS301 Administrative Daily Review of today s lecture w Due tomorrow (11/13) at 8am HW #8 due today at 5pm Program #2 due Friday, 11/16 at 11:59pm Test #2 Wednesday Pipelined Machine Fetch

More information

ECEC 355: Cache Design

ECEC 355: Cache Design ECEC 355: Cache Design November 28, 2007 Terminology Let us first define some general terms applicable to caches. Cache block or line. The minimum unit of information (in bytes) that can be either present

More information

Chapter 2: Memory Hierarchy Design Part 2

Chapter 2: Memory Hierarchy Design Part 2 Chapter 2: Memory Hierarchy Design Part 2 Introduction (Section 2.1, Appendix B) Caches Review of basics (Section 2.1, Appendix B) Advanced methods (Section 2.3) Main Memory Virtual Memory Fundamental

More information

Memory memories memory

Memory memories memory Memory Organization Memory Hierarchy Memory is used for storing programs and data that are required to perform a specific task. For CPU to operate at its maximum speed, it required an uninterrupted and

More information

Computer Organization

Computer Organization Objectives 5.1 Chapter 5 Computer Organization Source: Foundations of Computer Science Cengage Learning 5.2 After studying this chapter, students should be able to: List the three subsystems of a computer.

More information

The Memory Hierarchy & Cache The impact of real memory on CPU Performance. Main memory basic properties: Memory Types: DRAM vs.

The Memory Hierarchy & Cache The impact of real memory on CPU Performance. Main memory basic properties: Memory Types: DRAM vs. The Hierarchical Memory System The Memory Hierarchy & Cache The impact of real memory on CPU Performance. Main memory basic properties: Memory Types: DRAM vs. SRAM The Motivation for The Memory Hierarchy:

More information