DOC PREVIEW
SJSU CS 147 - Cache Memory

This preview shows page 1-2-16-17-18-33-34 out of 34 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Cache memoryProblemNumber Of Flip-Flops NeededSteps To Solve The ProblemState TableK-Maps for QA+ and QB+JK Truth TableT Truth TableK-Map for TK-Map for J and KDraw Flip-Flop DiagramTwo Basic Types of Memory2 Basic Types of MemoryMemory HierarchySlide 15The Memory HierarchyCache MemoryCache Memory - Three Levels ArchitectureSlide 19Slide 20Slide 21Cache (2)Where can a block be placed in Cache? (1)Slide 24Current CPUsCache PerformanceAssociative CacheDirect-Mapped Cache2-Way Set Associative CacheAssociative Cache (FIFO Replacement Policy)Two-way set associative cache (LRU Replacement Policy)Associative Cache with 2 byte line size (FIFO Replacement Policy)Direct-mapped Cache with line size of 2 bytesTwo-way set Associative Cache with line size of 2 bytesCache memoryProf. Sin-Min LeeDepartment of Computer ScienceProblemImplement the following state diagram using T Flip-Flop(s) and J-K Flip-Flop(s)Number Of Flip-Flops NeededNeed 2 Flip-Flops1 T Flip-Flop2 JK Flip-FlopSteps To Solve The ProblemStep 1 – Create state tableStep 2 – K-Maps for QA+ and QB+Step 3 – K-Maps for T and JK Flip-FlopsStep 4 – Draw Flip-Flop diagramState TableDerived directly from the state diagram:K-Maps for QA+ and QB+QA+QB+JK Truth TableLet’s revisit JK Flip-Flops:T Truth TableLet’s revisit T Flip-Flops:K-Map for TT = QA’QBK-Map for J and KJKJ = XQA’+ X’ QAK = XDraw Flip-Flop DiagramTwo Basic Types of MemoryRAM (Random Access Memory)Used to store programs and data that computer needs when executing programsVolatile and loses information once power is turned off2 Basic Types of MemoryROM (Read-Only Memory)Stores critical information necessary to operate the system, such as program necessary to boot computerNot volatile and always retains its dataAlso embedded in systems where programming does not need to changeMemory HierarchyHierarchal MemoryApproach in which computer systems use combination of memory types to provide best performance at best costBasic types that constitute hierarchal memory system include registers, cache, main memory and secondary memoryMemory HierarchyToday’s computers each have small amount of very high-speed memory, called cache where data from frequently used memory locations may be temporarily storedCache is connected to main memory, which is typically medium-speed memoryMain memory is complemented by secondary memory, composed of hard disk and various removable mediaThe Memory HierarchyCache MemoryPhysical memory is slow (more than 30 times slower than processor)Cache memory uses SRAM chips.Much fasterMuch expensiveSituated closest to the processorCan be arranged hierarchicallyL1 cache is incorporated into processorL2 cache is outsideCache Memory- Three LevelsArchitectureAddress PointerMemoryMulti-GigabytesLarge and Slow160 X16XL3 CacheMemoryCache ControlLogicL2 CacheMemoryL1 CacheMemory2X8X16 Megabytes128 Kilobytes32 Kilobytes 2 Gigahertz Clock Featuring Really Non-Deterministic ExecutionCache (2)Every address reference goes first to the cache; if the desired address is not here, then we have a cache miss;The contents are fetched from main memory into the indicated CPU register and the content is also saved into the cache memoryIf the desired data is in the cache, then we have a cache hitThe desired data is brought from the cache, at very high speed (low access time)Most software exhibits temporal locality of access, meaning that it is likely that same address will be used again soon, and if so, the address will be found in the cacheTransfers between main memory and cache occur at granularity of cache lines or cache blocks, around 32 or 64 bytes (rather than bytes or processor words). Burst transfers of this kind receive hardware support and exploit spatial locality of access to the cache (future access are often to address near to the previous one)Where can a block be placed in Cache? (1)Our cache has eight block frames and the main memory has 32 blocksCurrent CPUsCache PerformanceCache hits and cache misses.Hit ratio is the percentage of memory accesses that are served from the cacheAverage memory access timeTM = h TC + (1- h)TPTc = 10 nsTp = 60 nsAssociative CacheAccess order A0 B0 C2 A0 D1 B0 E4 F5 A0 C2 D1 V0 G3 C2 H7 I6 A0 B0Tc = 10 nsTp = 60 nsFIFOh = 0.389TM = 40.56 nsDirect-Mapped CacheAccess order A0 B0 C2 A0 D1 B0 E4 F5 A0 C2 D1 V0 G3 C2 H7 I6 A0 B0Tc = 10 nsTp = 60 nsh = 0.167TM = 50.67 ns2-Way Set Associative CacheAccess order A0 B0 C2 A0 D1 B0 E4 F5 A0 C2 D1 V0 G3 C2 H7 I6 A0 B0Tc = 10 nsTp = 60 nsLRUh = 0.31389TM = 40.56 nsAssociative Cache(FIFO Replacement Policy)Data A B C A D B E F A C D B G C H I A BCACHEA A A A A A A A A A A A A A A I I I B B B B B B B B B B B B B B B A A C C C C C C C C C C C C C C C B D D D D D D D D D D D D D D E E E E E E E E E E E E F F F F F F F F F F F G G G G G G H H H HHit?   *  *   * * * *  *    Hit ratio = 7/18Hit ratio = 7/18A0 B0 C2 A0 D1 B0 E4 F5 A0 C2 D1 B0 G3 C2 H7 I6 A0 B0Two-way set associative cache(LRU Replacement Policy)Hit ratio = 7/18Hit ratio = 7/18A0 B0 C2 A0 D1 B0 E4 F5 A0 C2 D1 B0 G3 C2 H7 I6 A0 B0Data A B C A D B E F A C D B G C H I A BCACHE0 A-0 A-1 A-1 A-0 A-0 A-1 E-0 E-0 E-1 E-1 E-1 B-0 B-0 B-0 B-0 B-0 B-1 B-00 B-0 B-0 B-1 B-1 B-0 B-1 B-1 A-0 A-0 A-0 A-1 A-1 A-1 A-1 A-1 A-0 A-11 D-0 D-0 D-0 D-1 D-1 D-1 D-0 D-0 D-0 D-0 D-0 D-0 D-0 D-01 F-0 F-0 F-0 F-1 F-1 F-1 F-1 F-1 F-1 F-1 F-12 C-0 C-0 C-0 C-0 C-0 C-0 C-0 C-0 C-0 C-0 C-0 C-0 C-0 C-1 C-1 C-12 I-0 I-0 I-03 G-0 G-0 G-1 G-1 G-1 G-13 H-0 H-0 H-0 H-0Hit?   *  *    * *   *   * *Associative Cache with 2 byte line size (FIFO Replacement Policy)Hit ratio = 11/18Hit ratio = 11/18A0 B0 C2 A0 D1 B0 E4 F5 A0 C2 D1 B0 G3 C2 H7 I6 A0 B0A and J; B and D; C and G; E and F; and I and HA and J; B and D; C and G; E and F; and I and HData A B C A D B E F A C D B G C H I A BCACHE A A A A A A A A A A A A A A I I I I J J J J J J J J J J J J J J H H H H B B B B B B B B B B B B B B B A A D D D D D D D D D D D D D D D J J C C C C C C C C C C C C C C C B G G G G G G G G G G G G G G G


View Full Document

SJSU CS 147 - Cache Memory

Documents in this Course
Cache

Cache

24 pages

Memory

Memory

54 pages

Memory

Memory

70 pages

Lecture 1

Lecture 1

53 pages

Cisc

Cisc

18 pages

Quiz 1

Quiz 1

4 pages

LECTURE 2

LECTURE 2

66 pages

RISC

RISC

40 pages

LECTURE 2

LECTURE 2

66 pages

Lecture 2

Lecture 2

67 pages

Lecture1

Lecture1

53 pages

Chapter 5

Chapter 5

14 pages

Memory

Memory

27 pages

Counters

Counters

62 pages

Load more
Download Cache Memory
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Cache Memory and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Cache Memory 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?