Memory Principles.

Slides:



Advertisements
Similar presentations
Computer Organization and Architecture
Advertisements

Computation I pg 1 Embedded Computer Architecture Memory Hierarchy: Cache Recap Course 5KK73 Henk Corporaal November 2014
+ CS 325: CS Hardware and Software Organization and Architecture Internal Memory.
CMPE 421 Parallel Computer Architecture MEMORY SYSTEM.
The Memory Hierarchy CPSC 321 Andreas Klappenecker.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
1 Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
Caching I Andreas Klappenecker CPSC321 Computer Architecture.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
11/3/2005Comp 120 Fall November 10 classes to go! Cache.
Overview: Memory Memory Organization: General Issues (Hardware) –Objectives in Memory Design –Memory Types –Memory Hierarchies Memory Management (Software.
Revision Mid 2 Prof. Sin-Min Lee Department of Computer Science.
1 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.
Overview Booth’s Algorithm revisited Computer Internal Memory Cache memory.
CH05 Internal Memory Computer Memory System Overview Semiconductor Main Memory Cache Memory Pentium II and PowerPC Cache Organizations Advanced DRAM Organization.
Faculty of Information Technology Department of Computer Science Computer Organization and Assembly Language Chapter 5 Internal Memory.
1 CSCI 2510 Computer Organization Memory System I Organization.
Chapter 5 Large and Fast: Exploiting Memory Hierarchy CprE 381 Computer Organization and Assembly Level Programming, Fall 2013 Zhao Zhang Iowa State University.
Lecture 19 Today’s topics Types of memory Memory hierarchy.
EEE-445 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output Cache Main Memory Secondary Memory (Disk)
A Detailed Discussion of SRAM Niels Asmussen Maggie Hamill William Hunt.
Chapter 3 Internal Memory. Objectives  To describe the types of memory used for the main memory  To discuss about errors and error corrections in the.
CPEN Digital System Design
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 10 Memory Hierarchy.
+ CS 325: CS Hardware and Software Organization and Architecture Memory Organization.
Computer system & Architecture
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Caches Hiding Memory Access Times. PC Instruction Memory 4 MUXMUX Registers Sign Ext MUXMUX Sh L 2 Data Memory MUXMUX CONTROLCONTROL ALU CTL INSTRUCTION.
1 Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4.
Semiconductor Memory Types
1 Chapter Seven. 2 Users want large and fast memories! SRAM access times are ns at cost of $100 to $250 per Mbyte. DRAM access times are ns.
Lecture 5: Memory Performance. Types of Memory Registers L1 cache L2 cache L3 cache Main Memory Local Secondary Storage (local disks) Remote Secondary.
Caches 1 Computer Organization II © McQuain Memory Technology Static RAM (SRAM) – 0.5ns – 2.5ns, $2000 – $5000 per GB Dynamic RAM (DRAM)
The Memory Hierarchy (Lectures #17 - #20) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
Chapter 5 Large and Fast: Exploiting Memory Hierarchy.
1 Chapter Seven. 2 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.
Computer Organization CS224 Fall 2012 Lessons 37 & 38.
The Memory Hierarchy Cache, Main Memory, and Virtual Memory Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
Introduction to computer architecture April 7th. Access to main memory –E.g. 1: individual memory accesses for j=0, j++, j
Memory Hierarchy and Cache. A Mystery… Memory Main memory = RAM : Random Access Memory – Read/write – Multiple flavors – DDR SDRAM most common 64 bit.
Computer System Structures Storage
CMSC 611: Advanced Computer Architecture
COSC3330 Computer Architecture
Chapter 5 Internal Memory
William Stallings Computer Organization and Architecture 7th Edition
Reducing Hit Time Small and simple caches Way prediction Trace caches
The Goal: illusion of large, fast, cheap memory
Morgan Kaufmann Publishers Large and Fast: Exploiting Memory Hierarchy
How will execution time grow with SIZE?
Morgan Kaufmann Publishers Memory & Cache
Morgan Kaufmann Publishers
The Memory Hierarchy Chapter 5
William Stallings Computer Organization and Architecture 7th Edition
CACHE MEMORY.
William Stallings Computer Organization and Architecture 8th Edition
Computer Architecture
William Stallings Computer Organization and Architecture 7th Edition
William Stallings Computer Organization and Architecture 8th Edition
10/16: Lecture Topics Memory problem Memory Solution: Caches Locality
Morgan Kaufmann Publishers Memory Hierarchy: Introduction
AKT211 – CAO 07 – Computer Memory
Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early days Primary memory.
Dr. Hadi AL Saadi Faculty Of Information Technology
William Stallings Computer Organization and Architecture 8th Edition
Chapter Five Large and Fast: Exploiting Memory Hierarchy
Cache Memory and Performance
Presentation transcript:

Memory Principles

Locality Temporal Locality Spatial Locality Items recently used are likely to be used again Instructions in loop Local variables Spatial Locality Items near recently used items are likely to be used soon Sequential instructions Arrays

Memory Technologies

SRAM SRAM : Static Random Access Memory Circuit that maintains state 6-8 transistors per circuit Equal access speed to all addresses

DRAM DRAM : Dynamic RAM Each cell = one transistor an one capacitor Capacitor charge represents value Denser than SRAM Slower to read/write than SRAM Charge must be refreshed frequently

DRAM Synchronous DRAM DDR SDRAM Clock controlled DDR : Dual Data Rate Xfer rising and falling clock S : Synchronous

DRAM Details Changing rows is slower than cols

DRAM Details Multiple banks used in parallel: Spatial Locality Byte 0: Row 0, Col 0 From Banks 0-7 Byte 1: Row 0, Col 1 From Banks 8-15 Byte 2: Row 0, Col 2 From Banks 16-23 Spatial Locality

DRAM Stats Access speed groth slowed substantially

Hard Drives Hard Drive Nonvolitile (no power required) Rotating Magnetic storage

Hard Drives Data arranged in sectors Seek Time Time for read/write head to be positioned and data to spin past it

Flash Flash Memory USB sticks Memory cards Solid State Drives

Flash Transistor…

Flash Strong current used to inject/remove electrons from floating gate

Flash Charged floating gate = off Uncharged = on

Flash vs HDD HDD : Flash Denser Longer lifespan Much faster seek Faster reads

Choices Ideal memory Access time of SRAM Capacity and cost/GB of disk

Since 1980, CPU has outpaced DRAM ... 3 cycle delay for memory access

Since 1980, CPU has outpaced DRAM ... Intel i7-6700 42 cycles + 51 ns (~200 cycles) delay for main memory access

Memory Hierarchy

Hierarchy Memory Heirarchy Information moved from larger/slower units to smaller faster as needed

Hierarchy Cache Memory : Provide invisible speedup to main memory

Cache Cache memory Small, fast (SRAM) memory Stores subset of main memory we think is most important

Differences Modern cache all on CPU May be local to one core or shared May be split Instruction Data

Cache How important is it?

Memory Units Main memory Byte addressed

Memory Units Main memory Machine Word Byte addressed 2-8 bytes … Main memory Byte addressed Machine Word 2-8 bytes 32 bit = 4 64 bit = 8

Memory Units Main memory Machine Word Cache Byte addressed 2-8 bytes Line 0 Line 1 … Main memory Byte addressed Machine Word 2-8 bytes Cache Line or block of 1+ words

Process I need memory location 0x000E Is it in L1 cache? Is it in L2? Yes : Hit – return it No : Miss – go search next level and bring back whole line Is it in L2? Yes : Hit – return line No : Miss – go search next level bring back whole line Is it in L3… Is it in memory…

Direct Mapping Direct mapping : every memory block has one cache entry it can use

Direct Mapped Cache Example : Cache has 4 entries Each entry holds 1 word Cache location = Word # mod 4

Direct Mapped Cache Need to track who is in the slot ???

Address Breakdown 4 cache entries 2 bits Last 2 bits of word # specify cache index

Direct Mapped Cache Tag: Identifies which word is in cache All the rest address bits

Book Cache Usage Sample 8 blocks, 1 word per block Valid bit tracks if cache line actually has data

Book Cache Usage Sample

Book Cache Usage Sample

Book Cache Usage Sample

Book Cache Usage Sample

Book Cache Usage Sample

Address Subdivision Cache system with 1024, 1 word entries 4 byte words 64 bit memory addresses

Direct Mapped Cache Address format based on 4 bytes per word 2 bits 1 words per line 0 bits 1024 cache lines 10 bits for index Rest is tag

Address Subdivision Cache system with 256, 16 word entries 4 byte words 32 bit memory addresses

Direct Mapped Cache Address format based on 4 bytes per word 2 bits 16 words per line 4 bits to pick word out of line 256 cache lines 8 bits for index Rest is tag

Direct Mapped Cache Where is this address in cache? 0010 0101 1111 0010 0000 0000 1010 1110

Direct Mapped Cache Where is this address in cache? 0010 0101 1111 0010 0000 0000 1010 1110 Cache index 0000 0010 (2 of the 256 lines) Word 1011 (11 of the 16 in the cache line) Byte 10 (2 of 4)

Size Considerations Bigger lines take advantage of spatial locality

Size Considerations Bigger lines take advantage of spatial locality At the expense of fewer entries More competition!!

Bad Situations for Cache Large 2D arrays traversed in column major order… 1 2 76 82 83 84 94 88 93 Row Major Access Col Major Access 1 2 3 4 5 6 7 8 76 82 83 84 94 88 93

Bad Situations for Cache Data with poor locality Complex object oriented programming structure

Bad Situations for Cache Data with good locality Packed structures: