Contents. Main Memory Memory access time Memory cycle time. Types of Memory Unit RAM ROM

Similar documents
UNIT-V MEMORY ORGANIZATION

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

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

Memory memories memory

8051 INTERFACING TO EXTERNAL MEMORY

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

chapter 8 The Memory System Chapter Objectives

Microcontroller Systems. ELET 3232 Topic 11: General Memory Interfacing

William Stallings Computer Organization and Architecture 8th Edition. Chapter 5 Internal Memory

a) Memory management unit b) CPU c) PCI d) None of the mentioned

Unit IV MEMORY SYSTEM PART A (2 MARKS) 1. What is the maximum size of the memory that can be used in a 16-bit computer and 32 bit computer?

Introduction read-only memory random access memory

PRATHYUSHA INSTITUTE OF TECHNOLOGY AND MANAGEMENT

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

COMP3221: Microprocessors and. and Embedded Systems. Overview. Lecture 23: Memory Systems (I)

Embedded Systems Design: A Unified Hardware/Software Introduction. Outline. Chapter 5 Memory. Introduction. Memory: basic concepts

Embedded Systems Design: A Unified Hardware/Software Introduction. Chapter 5 Memory. Outline. Introduction

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

EE414 Embedded Systems Ch 5. Memory Part 2/2

Memory & Simple I/O Interfacing

Address connections Data connections Selection connections

Chapter TEN. Memory and Memory Interfacing

CENG3420 Lecture 08: Memory Organization

CPE300: Digital System Architecture and Design

Cache memory. Lecture 4. Principles, structure, mapping

UMBC. Select. Read. Write. Output/Input-output connection. 1 (Feb. 25, 2002) Four commonly used memories: Address connection ... Dynamic RAM (DRAM)

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

UNIT:4 MEMORY ORGANIZATION

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

ECE 341. Lecture # 16

Allmost all systems contain two main types of memory :

COMPUTER ARCHITECTURE AND ORGANIZATION

CENG4480 Lecture 09: Memory 1

ECSE-2610 Computer Components & Operations (COCO)

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

Computer Organization. 8th Edition. Chapter 5 Internal Memory

Computer Organization and Assembly Language (CS-506)

CPS101 Computer Organization and Programming Lecture 13: The Memory System. Outline of Today s Lecture. The Big Picture: Where are We Now?

machine cycle, the CPU: (a) Fetches an instruction, (b) Decodes the instruction, (c) Executes the instruction, and (d) Stores the result.

Memory. Lecture 22 CS301

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

,e-pg PATHSHALA- Computer Science Computer Architecture Module 25 Memory Hierarchy Design - Basics

Computer Memory Basic Concepts. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

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

Discovering Computers 2012

Large and Fast: Exploiting Memory Hierarchy

MIPS) ( MUX

Read and Write Cycles

Chapter 6 Objectives

MARTHANDAM COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY TWO MARK QUESTIONS AND ANSWERS

COSC 6385 Computer Architecture - Memory Hierarchies (III)

Logic and Computer Design Fundamentals. Chapter 8 Memory Basics

Memory Overview. Overview - Memory Types 2/17/16. Curtis Nelson Walla Walla University

Menu. word size # of words byte = 8 bits

Chapter 4 Main Memory

Memory Hierarchy. Cache Memory. Virtual Memory

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

MEMORY. Objectives. L10 Memory

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

UMBC D 7 -D. Even bytes 0. 8 bits FFFFFC FFFFFE. location in addition to any 8-bit location. 1 (Mar. 6, 2002) SX 16-bit Memory Interface

Internal Memory. Computer Architecture. Outline. Memory Hierarchy. Semiconductor Memory Types. Copyright 2000 N. AYDIN. All rights reserved.

ECE 485/585 Midterm Exam

Introduction to cache memories

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422)

Memory hierarchy and cache

Computer Organization & Architecture M. A, El-dosuky

Chapter 5 Internal Memory

1. Explain in detail memory classification.[summer-2016, Summer-2015]

The check bits are in bit numbers 8, 4, 2, and 1.

Donn Morrison Department of Computer Science. TDT4255 Memory hierarchies

ECE 485/585 Midterm Exam

Summer 2003 Lecture 18 07/09/03

UNIT V (PROGRAMMABLE LOGIC DEVICES)

211: Computer Architecture Summer 2016

Structure of Computer Systems

Lecture 14: Cache Innovations and DRAM. Today: cache access basics and innovations, DRAM (Sections )

The Memory Hierarchy Part I

CPSC 352. Chapter 7: Memory. Computer Organization. Principles of Computer Architecture by M. Murdocca and V. Heuring

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 7: Memory Organization Part II

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

Lecture 18: Memory Systems. Spring 2018 Jason Tang

LECTURE 11. Memory Hierarchy

MEMORY SYSTEM MEMORY TECHNOLOGY SUMMARY DESIGNING MEMORY SYSTEM. The goal in designing any memory system is to provide

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

Chapter 2: Memory Hierarchy Design (Part 3) Introduction Caches Main Memory (Section 2.2) Virtual Memory (Section 2.4, Appendix B.4, B.

Computer Architecture A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

MEMORY BHARAT SCHOOL OF BANKING- VELLORE

Sir Sadiq s computer notes for class IX. Chapter no 4. Storage Devices

Chapter 5B. Large and Fast: Exploiting Memory Hierarchy

The Memory Component

Caches. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 7: Processor and Memory

CS 261 Fall Mike Lam, Professor. Memory

Chapter 4 The Components of the System Unit

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

1/19/2009. Data Locality. Exploiting Locality: Caches

CENG 3420 Computer Organization and Design. Lecture 08: Cache Review. Bei Yu

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

eaymanelshenawy.wordpress.com

CS 320 February 2, 2018 Ch 5 Memory

Transcription:

Memory Organization

Contents Main Memory Memory access time Memory cycle time Types of Memory Unit RAM ROM Memory System Virtual Memory Cache Memory - Associative mapping Direct mapping Set-associative mapping Replacement algorithm Memory Interleaving

Main Memory ( 1 ) Main Memory part of computer where program and data are stored during execution. It consists of a number of cells (or locations), each of which can store a piece of information (data, instruction, character or number). The size of the cell can be single byte or several successive bytes (word) -byte-addressable or wordaddressable computer

Main Memory ( 2 ) Each cell has a reference number, called address, by which program can refer to it. If a memory address has k bits, the maximum number of cell directly addressable is 2 k.example: For 16-bit addressing, the maximum number of cells will be: 2 16 = 65536 memory cells The maximum size of address references available in main memory for a computer system is called the size of the main

Main Memory ( 3 ) The basic unit of memory is the binary digit bit. A bit contains a 0 or 1. The most common definition of the word length of a computer is the number of bits actually stored or retrieved in one memory access. Word length and address length are independent. Connection of the memory to the processor.

Main Memory ( 4 ) Memory Access Time - The time that elapses between the initiation and the completion of a memory access operation. - e.g., the time between the READ and MFC signals Memory Cycle Time - The minimum time delay required between two successive memory access operations. - The cycle time is usually slighter longer than the access time.

Types of Memory Unit ( 1 ) Random-Access Memory (RAM) Any location can be accessed for a Read or Write operation in some constant amount of time that is independent of the memory location. Static RAM (SRAM) Memories that consist of circuits capable of retaining their state as long as power is applied. SRAMs are fast (a few nanoseconds access time) but their cost is high. Dynamic RAM (DRAM)These memory units are capable of storing information for only tens of milliseconds, thus require periodical refresh to maintain the contents.

Control Control Select Cell Data in Select Cell Sense (a) Write (b) Read Figure 5.1 Memory Cell Operation

Types of Memory Unit ( 2 ) Read-Only Memory (ROM) - Nonvolatile memory - Data are written into a ROM when it is manufactured. Normal operation involves only reading of stored data. - ROM are useful as control store component in a micro-programmed CPU (micro-coded CPU). - ROM is also commonly used for storing the bootstrap loader, a program whose function is to load the boot program from the disk into the memory when the power is turn on.

Types of Memory Unit ( 3 ) PROM (Programmable ROM) - data is allowed to be loaded by user but this process is irreversible - provide a faster and less expensive approach when only a small number of data are required EPROM (Erasable, Programmable ROM) - stored data can be erased by exposing the chip to ultraviolet light and new data to be loaded EEPROM - stored data can be erased electrically and selectively - different voltages are needed for erasing, writing, and reading the stored data

Types of Memory Unit ( 4 ) Flash memory similar to EEPROM technology - it is possible to read the contents of a single cell, but it is only possible to write an entire block of cells - greater density, higher capacity, lower cost per bit, low power consumption - typical applications: hand-held computers, digital cameras, MP3 music players - large memory modules implementation: flash cards and flash drives

Types of Memory Unit ( 5)

Memory Systems (1) Implement a 64K X 8 memory using 16K X 1 memory chips Number of rows = 64K/16K = 4 Number of columns = 8/1 = 8. 64K = 16 bit address. Each small chip needs 14 bit (16K) address. 16-14 = 2 bits for selecting one of the four rows.

Memory Systems (2)

A memory system with 2M words (32 bits) formed by 512K 8 memory chips. Memory Systems (3)

Memory Systems ( 4 ) Each chip has a control input called Chip Select (CS) used to enable the chip. 21 address bits are needed to select a 32-bit word. - The high-order 2 bits are decoded to determined which of the 4 CS control signals are activated. - The remaining 19 bits are used to access specific byte locations inside each chip of the selected row.

Memory Systems ( 5 ) Single In-line Memory Modules (SIMMs) and Dual In-line Memory Modules (DIMMs) - An assembly of several memory chips on a separate small board that plugs vertically into a single socket on the motherboard - Occupy a smaller amount of space. - Allow easy expansion.

+ Cache Addresses Virtual memory Virtual Memory Facility that allows programs to address memory from a logical point of view, without regard to the amount of main memory physically available When used, the address fields of machine instructions contain virtual addresses For reads to and writes from main memory, a hardware memory management unit (MMU) translates each virtual address into a physical address in main memory

Logical address MMU Physical address Processor Cache Main memory Data (a) Logical Cache Logical address MMU Physical address Processor Cache Main memory Data (b) Physical Cache Figure 4.7 Logical and Physical Caches

Mapping Function Because there are fewer cache lines than main memory blocks, an algorithm is needed for mapping main memory blocks into cache lines Three techniques can be used: Direct The simplest technique Maps each block of main memory into only one possible cache line Associative Permits each main memory block to be loaded into any line of the cache The cache control logic interprets a memory address simply as a Tag and a Word field To determine whether a block is in the cache, the cache control logic must simultaneously examine every line s Tag for a match Set Associative A compromise that exhibits the strengths of both the direct and associative approaches while reducing their disadvantages

Cache Memory ( 1 ) During the execution of a typical program it is often occurred in a few localized areas of the program (in memory) at any given interval of time Locality of Reference - temporal: a recently executed instructions is likely to be executed again very soon, e.g., loop, stack. - spatial: instructions in close proximity to a recently executed instruction are also likely to be executed soon.

Cache Memory ( 2 ) Cache memory used to store the active segments of the program will then reduce the average memory access time, resulting faster execution for the program. It is usually implemented using SRAM, which are very fast memory (a few ns access time) but expensive.

Word Transfer Block Transfer CPU Cache Main Memory Fast Slow (a) Single cache CPU Level 1 (L1) cache Level 2 (L2) cache Level 3 (L3) cache Main Memory Fastest Fast Less fast Slow (b) Three-level cache organization Figure 4.3 Cache and Main Memory

System Bus Address Address buffer Processor Control Cache Control Data buffer Data Figure 4.6 Typical Cache Organization

Cache Memory ( 3 ) In a read operation, the block containing the location specified is transferred into the cache from the main memory, if it is not in the cache (a miss). Otherwise (a hit), the block can be read from the cache directly. The performance of cache memory is frequently measured in terms of hit ratio. High hit ratio verifies the validity of the local reference property.

Cache Memory ( 4 ) Two different ways of write access for system with cache memory : - (1) Write-through method the cache and the main memory locations are updated simultaneously. - (2) Write-back method - cache location updated during a write operation is marked with a dirty or modified bit. The main memory location is updated later when the block is to be removed from the cache.

Cache Memory ( 5 ) The correspondence between the main memory blocks and those in the cache is specified by a mapping function. - Direct Mapping - Associative Mapping - Set-associative Mapping To explain the mapping procedures more, we consider - a 2K cache consisting of 128 blocks of 16 words each, and - a 64K main memory addressable by a 16-bit address, 4096 blocks of 16 words each.

Direct Mapping ( 1 ) Blockjof the main memory maps onto block jmodulo 128 of the cache. The 7-bit cache block field determines the cache position. The high-order 5 tag bits identify which of the 32 blocks is currently resident in the cache

Direct Mapping ( 2 ) Since more than one memory block is mapped onto a given cache block position, contention may arise for that position even when the cache is not full. This technique is easy to implement, but it is not flexible.

Associative Mapping ( 2 ) The cost of an associative cache is relatively high because of the need to search all 128 tags to determine whether a given block is in the cache. For performance reasons, associative search must be done in parallel.

Set-Associative Mapping ( 1 ) Blocks of the cache are grouped into sets, and the mapping allows a block of the main memory to reside in any block of a specific set. A cache that has k blocks per set is referred to as a k-way set-associative cache. The contention problem of the direct method is eased. The hardware cost of the associative method is reduced

Replacement Algorithms (1) Difficult to determine which blocks to kick out Least Recently Used (LRU) block The cache controller tracks references to all blocks as computation proceeds. Increase / clear track counters when a hit/miss occurs

Replacement Algorithms (2) For Associative & Set-Associative Cache Which location should be emptied when the cache is full and a miss occurs? First In First Out (FIFO) Least Recently Used (LRU) Distinguish an Empty location from a Full one Valid Bit

RAS CAS WE OE Timing and Control Refresh Counter MUX A0 A1 Row Address Buffer Row Decoder Memory array (2048 2048 4) A10 Column Address Buffer Refresh circuitry Column Decoder Data Input Buffer Data Output Buffer D1 D2 D3 D4 Figure 5.3 Typical 16 Megabit DRAM (4M 4)

A19 A16 A15 A12 A7 A6 A5 A4 A3 A2 A1 A0 D0 D1 D2 Vss 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1M 8 32 31 30 29 28 27 26 25 32 Pin Dip 24 0.6" 23 22 21 20 19 18 17 Top View Vcc A18 A17 A14 A13 A8 A9 A11 Vpp A10 CE D7 D6 D5 D4 D3 Vcc D0 D1 WE RAS NC A10 A0 A1 A2 A3 Vcc 1 2 3 4 5 6 7 8 9 10 11 12 4M 4 24 23 22 21 20 19 24 Pin Dip 18 0.6" 17 16 15 14 13 Top View Vss D3 D2 CAS OE A9 A8 A7 A6 A5 A4 Vss (a) 8 Mbit EPROM (b) 16 Mbit DRAM Figure 5.4 Typical Memory Package Pins and Signals

Decode 1 of 512 Decode 1 of 512 Memory address register (MAR) 512 words by 512 bits Chip #1 9 9 Decode 1 of 512 bit-sense Memory buffer register (MBR) 1 2 3 4 5 6 7 8 512 words by 512 bits Chip #8 Decode 1 of 512 bit-sense Figure 5.5 256-KByte Memory Organization

Memory Interleaving ( 1 ) Main memory is structured as a number of physical modules (chip). Each memory module has its own Address Buffer Register(ABR) and Data Buffer Register(DBR). Memory access may proceed in more than one module simultaneously the aggregate rate of transmission of words to and from the main memory can be increased. How individual addresses are distributed over the modules is critical in determining the average number of modules that can be kept busy.

Interleaved Memory Composed of a collection of DRAM chips Grouped together to form a memory bank Each bank is independently able to service a memory read or write request K banks can service K requests simultaneously, increasing memory read or write rates by a factor of K If consecutive words of memory are stored in different banks, the transfer of a block of memory is speeded up

Memory Interleaving ( 2 ) There are two memory address layouts : (a) Consecutive words in a module - The address consists of : (1) high-order kbits identify a single module (0 to n-1) (2) low-order mbits point to a particular word in that module (3) Accessing consecutive addresses will keep modulebusy.

Memory Interleaving ( 4 ) (b) Consecutive words in consecutive modules The address consists of : (1) low-order k bits determine a module (2) high-order m bits name a location within that module (3) Accessing consecutive addresses will keep several modules busy at any one time - It is called Memory Interleaving. - Faster access to a block of data. - Higher average utilization of the memory system.

Example -Memory Interleaving ( 1 ) Calculate the loading time difference between no memory interleaving and 4-modules memory interleaving when a cache read miss occurs where main memory have to be accessed and subsequent transfer data to the cache. Size of block needed to transfer from memory to cache = 8 words - Access time for main memory (1stword) = 8 cycles/word - Access time for main memory (2ndto 8thword) = 4 cycles/word(no address decoding is necessary for same memory module.) - Access/transfer time from main memory to cache = 1 cycle/word

Example -Memory Interleaving ( 2 ) No memory interleaving :Loading time = cache miss + (1stword + 2ndto 8thword) + 1 cache transfer = 1 + 8 + (7 4) + 1 = 38 cycles Memory interleaving :Loading time = cache miss + (1st word in 4 modules + 2nd word in 4 modules) + 4 cache transfers = 1 + (8 + 4) + 4 = 17 cycles Memory interleaving reduces block transfer by a factor of 2.