CS1104: Computer Organisation School of Computing National University of Singapore.

Slides:



Advertisements
Similar presentations
Computer System Organization Computer-system operation – One or more CPUs, device controllers connect through common bus providing access to shared memory.
Advertisements

CMPE 421 Parallel Computer Architecture MEMORY SYSTEM.
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
What is memory? Memory is used to store information within a computer, either programs or data. Programs and data cannot be used directly from a disk or.
Modified from notes by Saeid Nooshabadi COMP3221: Microprocessors and Embedded Systems Lecture 25: Cache - I Lecturer:
Memory Subsystem and Cache Adapted from lectures notes of Dr. Patterson and Dr. Kubiatowicz of UC Berkeley.
1 Lecture 20 – Caching and Virtual Memory  2004 Morgan Kaufmann Publishers Lecture 20 Caches and Virtual Memory.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 20 - Memory.
COMP3221 lec33-Cache-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 12: Cache Memory - I
Computer ArchitectureFall 2008 © October 27th, 2008 Majd F. Sakr CS-447– Computer Architecture.
1 Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon, Oct 31, 2005 Topic: Memory Hierarchy Design (HP3 Ch. 5) (Caches, Main Memory and.
331 Lec20.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
CIS629 - Fall 2002 Caches 1 Caches °Why is caching needed? Technological development and Moore’s Law °Why are caches successful? Principle of locality.
CIS °The Five Classic Components of a Computer °Today’s Topics: Memory Hierarchy Cache Basics Cache Exercise (Many of this topic’s slides were.
Computer ArchitectureFall 2007 © November 7th, 2007 Majd F. Sakr CS-447– Computer Architecture.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
L18 – Memory Hierarchy 1 Comp 411 – Fall /30/2009 Memory Hierarchy Memory Flavors Principle of Locality Program Traces Memory Hierarchies Associativity.
Cs 61C L17 Cache.1 Patterson Spring 99 ©UCB CS61C Cache Memory Lecture 17 March 31, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson) www-inst.eecs.berkeley.edu/~cs61c/schedule.html.
Cs 61C L16 Review.1 Patterson Spring 99 ©UCB CS61C Memory Hierarchy Introduction and Eight Week Review Lecture 16 March 12, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson)
331 Lec20.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
Overview: Memory Memory Organization: General Issues (Hardware) –Objectives in Memory Design –Memory Types –Memory Hierarchies Memory Management (Software.
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.
©UCB CS 161 Ch 7: Memory Hierarchy LECTURE 14 Instructor: L.N. Bhuyan
DAP Spr.‘98 ©UCB 1 Lecture 11: Memory Hierarchy—Ways to Reduce Misses.
Memory. When we receive some instruction or information we retain them in our memory. Similarly a computer stores the instructions for solving a problem,
Computer Orgnization Rabie A. Ramadan Lecture 7. Wired Control Unit What are the states of the following design:
CPE432 Chapter 5A.1Dr. W. Abu-Sufah, UJ Chapter 5A: Exploiting the Memory Hierarchy, Part 1 Adapted from Slides by Prof. Mary Jane Irwin, Penn State University.
CMPE 421 Parallel Computer Architecture
EECS 318 CAD Computer Aided Design LECTURE 10: Improving Memory Access: Direct and Spatial caches Instructor: Francis G. Wolff Case.
1 CSCI 2510 Computer Organization Memory System I Organization.
Lecture 14 Memory Hierarchy and Cache Design Prof. Mike Schulte Computer Architecture ECE 201.
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)
CSIE30300 Computer Architecture Unit 08: Cache Hsin-Chou Chi [Adapted from material by and
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
Copyright © 2007 – Curt Hill Primary Memory and Electronic Storage Implementations.
EEL5708/Bölöni Lec 4.1 Fall 2004 September 10, 2004 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Review: Memory Hierarchy.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Primary Storage Primary storage is the storage that is directly available to the CPU. It is also known as: Main Memory Main Memory Direct Access Storage.
1010 Caching ENGR 3410 – Computer Architecture Mark L. Chang Fall 2006.
The Goal: illusion of large, fast, cheap memory Fact: Large memories are slow, fast memories are small How do we create a memory that is large, cheap and.
CSE378 Intro to caches1 Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early.
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.
CS.305 Computer Architecture Memory: Caches Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
CPE232 Cache Introduction1 CPE 232 Computer Organization Spring 2006 Cache Introduction Dr. Gheith Abandah [Adapted from the slides of Professor Mary Irwin.
COMPURT ORGANAZTION CHAPTER 5. Computer Organization We can divide the parts that make up a computer into 3 subsystems : 1. Central processing unit (CPU).
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.
CS2100 Computer Organisation Cache I (AY2015/6) Semester 1.
1  1998 Morgan Kaufmann Publishers Chapter Seven.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 14: Memory Hierarchy Chapter 5 (4.
What is it and why do we need it? Chris Ward CS147 10/16/2008.
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.
DIGITAL SYSTEMS Read Only– and Random Access Memory ( ROM – RAM) Rudolf Tracht and A.J. Han Vinck.
Lecture 2 (Memory) Dr. Muhammad Ayaz Computer Organization and Assembly Language. (CSC-210)
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
CACHE _View 9/30/ Memory Hierarchy To take advantage of locality principle, computer memory implemented as a memory hierarchy: multiple levels.
Advanced Computer Architecture CS 704 Advanced Computer Architecture Lecture 26 Memory Hierarchy Design (Concept of Caching and Principle of Locality)
CMSC 611: Advanced Computer Architecture
COSC3330 Computer Architecture
Computer Organization
Yu-Lun Kuo Computer Sciences and Information Engineering
The Goal: illusion of large, fast, cheap memory
Memory chips Memory chips have two main properties that determine their application, storage capacity (size) and access time(speed). A memory chip contains.
Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early days Primary memory.
CMSC 611: Advanced Computer Architecture
Morgan Kaufmann Publishers Memory Hierarchy: Introduction
MICROPROCESSOR MEMORY ORGANIZATION
Cache Memory and Performance
Lecture 2 (Memory) Computer Organization and Assembly Language. (CSC-210) Dr. Mohammad Ammad uddin.
Presentation transcript:

CS1104: Computer Organisation School of Computing National University of Singapore

CS1104-P2-8Memory Hierarchy2 PII Lecture 8: Memory Hierarchy  Memory Technologies  Memory Hierarchy Analogy  Illusion of Large, Fast, Cheap Memory  Principle of Locality  Terminology

CS1104-P2-8Memory Hierarchy3 PII Lecture 8: Memory Hierarchy  Reading:  Chapter 8 of textbook, which is Chapter 5 in “Computer Organization” by Hamacher, Vranesic and Zaky.

CS1104-P2-8Memory Hierarchy4 Memory Technologies  RAM (Random Access Memory): access time is the same for all locations (in nanoseconds).  DRAM: Dynamic RAM  High density, low power, cheap, slow (access time: ns).  Dynamic: needs to be “refreshed” regularly.  SRAM: Static RAM  Low density, high power, expensive, fast (access time: 5-25 ns).  Static: non-volatile – content lasts “forever” (until power is removed).

CS1104-P2-8Memory Hierarchy5 Memory Technologies (2)  ROM (Read-Only Memory): non-volatile, allows for read only.  PROM: Programmable ROM  EPROM: Erasable PROM  EEPROM: Electrically EPROM  Flash Memory  Similar to EEPROM  Difference: read a single cell, but write a block

CS1104-P2-8Memory Hierarchy6 Recap: Memory Organisation Another example: Organization of a 2M  32 memory module using 512K  8 static memory chips. Chip select 512K x 8 memory chip 19-bit address 8-bit data input/output

CS1104-P2-8Memory Hierarchy7 Technology Trends CapacitySpeed (latency) Processor:--4x in 3 yrs DRAM:4x in 3 yrs2x in 10 yrs Disk:4x in 3 yrs 2x in 10 yrs DRAM YearSizeCycle Time Kb250 ns Kb220 ns Mb190 ns Mb165 ns Mb145 ns Mb120 ns 1000:1!2:1!

CS1104-P2-8Memory Hierarchy8 Technology Trends (2) DRAM 9%/yr. (2X/10 yrs) µProc 60%/yr. (2X/1.5yr) Processor-Memory Performance Gap: (grows 50% / year) DRAM CPU Time

CS1104-P2-8Memory Hierarchy9 Analogy: Term Paper in Library  Working on a paper at a desk in library.  Option 1: Every time a book is needed…  Leave desk to go to shelves (or stacks)  Find the book  Bring one book back to desk  Read section interested in  When done, leave desk and go to shelves carrying book  Put book back on shelf  Return to desk to work

CS1104-P2-8Memory Hierarchy10 Analogy: Term Paper in Library (2)  Option 2: Every time a book is needed…  Leave some books on desk after fetching them  Only go to shelves when a book not on desk is needed  At the shelves, fetch related books in case you need them; sometimes you will need to return books not used recently to make space for new books on desk (replacement algorithm)  Return to desk to work  Illusion: whole library on your desk

CS1104-P2-8Memory Hierarchy11 Illusion of Large, Fast, Cheap Memory  Registers in processor: Very fast, in order of nanoseconds to picoseconds.  Disks: Very slow, in order of milliseconds.  Large memories (disks) are slow; fast memories (registers) are small.  How do we create a memory that is large, cheap and fast (most of the time)?  Memory hierarchy.

CS1104-P2-8Memory Hierarchy12 Memory Hierarchy Pyramid Central Processor Unit (CPU) “Upper” “Lower” Levels in memory hierarchy Increasing distance from CPU, decreasing cost/bit Size of memory at each level Level 1 Level 2 Level 3... Level n (Data cannot be in level i unless it is also in i+1.)

CS1104-P2-8Memory Hierarchy13 Principle of Locality  Principle of locality (or locality of reference):  Program accesses a relatively small portion of the address space at any instant of time.  Temporal locality and spatial locality. Address Space 02 n - 1 Probability of reference

CS1104-P2-8Memory Hierarchy14 Principle of Locality (2)  Temporal locality (locality in time):   Keep most recently accessed data items closer to the processor.  Library analogy: Recently read books are kept on desk.  Spatial locality (locality in space):   Move blocks consisting of contiguous words to ‘upper’ levels.  Block is a unit of transfer.  Library analogy: Bring back nearby books on shelves when fetching a book, hoping that you might need them soon.

CS1104-P2-8Memory Hierarchy15 Principle of Locality (3)  What programming constructs lead to principle of locality? SpatialTemporal Dataarraysloop counters Codeno branch/jumploop

CS1104-P2-8Memory Hierarchy16 Memory Hierarchy: Idea  Temporal locality: keep recently accessed data items closer to processor.  Spatial locality: move contiguous words in memory to upper levels of hierarchy.  Use smaller and faster memory technologies closer to the processor  If hit rate is high enough, hierarchy has access time close to the highest (fastest) level and size equal to the lowest (largest) level.

CS1104-P2-8Memory Hierarchy17 Memory Hierarchy: Terminology  Hit: data appears in some block in the upper level.  Hit rate: the fraction of memory access found in the upper level.  Analogy: fraction of time you find the book on desk.  Miss: data is not at upper level and needs to be retrieved from a block in the lower level.  Miss rate: 1 – Hit rate  Analogy: fraction of time you need to go to shelves for the book.

CS1104-P2-8Memory Hierarchy18 Memory Hierarchy: Terminology (2)  (Average) Hit time: time to access the upper level which consists of  Time to determine hit/miss + memory access time.  Analogy: time to find and pick up book from desk.  (Average) Miss penalty: time to replace a block in the upper level + time to deliver the block to the processor.  Analogy: time to go to shelves, find needed book, and return to your desk.  Hit time << Miss penalty.

CS1104-P2-8Memory Hierarchy19 Current Memory Hierarchy Increasing size Processor Primary cache Secondary cache Main memory Magnetic disk secondary memory Register L1 L2 Increasing speed Increasing cost per bit

CS1104-P2-8Memory Hierarchy20 Current Memory Hierarchy (2) Control Data path Processor Regs Second- ary Memory L2 Cache L1 $ Main Memory Speed(ns):0.5ns2ns6ns100ns10,000,000ns Size (MB): ,000 Cost ($/MB):--$100$30$1 $0.05 Technology:RegsSRAMSRAMDRAMDisk

CS1104-P2-8Memory Hierarchy21 Management of the Hierarchy  Registers  Memory  By compiler (or assembly programmer).  Cache  Main memory  By the hardware.  Main memory  Disks  By the hardware and operating system.  By the programmer (through files).

CS1104-P2-8Memory Hierarchy22 Virtual Memory  Main memory smaller than address space  Example: 32-bit address allows an address space of 4G bytes, but main memory may only be a few hundred megabytes.  Parts of program not in main memory are stored on secondary storage devices, such as disks.  Operating system moves programs and data automatically between the physical main memory and secondary storage (virtual memory).

CS1104-P2-8Memory Hierarchy23 Things To Remember  Principle of locality and hierarchy of memories of different speed and cost; exploit locality to improve cost- performance.  Terms: Hit, miss, hit rate, miss rate, hit time, miss penalty, block, upper-level memory, lower-level memory.

24 End of file