MICROPROCESSOR MEMORY ORGANIZATION

Similar documents
Chapter 1 Computer System Overview

CSC 553 Operating Systems

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

Computer Systems Overview

Chapter 1 Computer System Overview

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

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

Lecture 2 Microcomputer Organization: Fig.1.1 Basic Components of Microcomputer

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

In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Trace flag, Interrupt flag, Direction flag, and Sign flag.

An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal)

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Computer System Overview

Microcomputer Architecture and Programming

Computer System Overview. Chapter 1

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

System Unit. By: Khadeeja Farkash

Operating system Dr. Shroouq J.

What Operating Systems Do An operating system is a program hardware that manages the computer provides a basis for application programs acts as an int

Computer System Overview

Q.1 Explain Computer s Basic Elements

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

OS And Hardware. Computer Hardware Review PROCESSORS. CPU Registers. CPU Registers 02/04/2013

Computer Organization and Assembly Language (CS-506)

COSC 243. Input / Output. Lecture 13 Input/Output. COSC 243 (Computer Architecture)

Chapter 5 Internal Memory

The Central Processing Unit

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Computer Organization

Lecture-7 Characteristics of Memory: In the broad sense, a microcomputer memory system can be logically divided into three groups: 1) Processor

Memory Study Material

Module 2: Computer-System Structures. Computer-System Architecture

Operating Systems: Internals and Design Principles, 7/E William Stallings. Chapter 1 Computer System Overview

Chapter 4 Main Memory

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION

Memory hierarchy and cache

Chapter 1 Computer System Overview

Unit - II. Computer Concepts and C Programming 06CCP13. Unit II

Architecture of 8085 microprocessor

Microcontroller Systems. ELET 3232 Topic 11: General Memory Interfacing

Explain the functions of the main components of a basic computer system (Part 2) S. Neebar

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

Types of Interrupts:

COA. Prepared By: Dhaval R. Patel Page 1. Q.1 Define MBR.

THE MICROCOMPUTER SYSTEM CHAPTER - 2

CSCI-375 Operating Systems

UNIT:4 MEMORY ORGANIZATION

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

Inside the Computer System

Computer Organization. 8th Edition. Chapter 5 Internal Memory

Pharmacy college.. Assist.Prof. Dr. Abdullah A. Abdullah

UNIT-V MEMORY ORGANIZATION

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

FINALTERM EXAMINATION Fall 2008 CS501- Advance Computer Architecture (Session - 1) Marks: 75

Introduction to Microprocessor

MEMORY BHARAT SCHOOL OF BANKING- VELLORE

SYSTEM BUS AND MOCROPROCESSORS HISTORY

Microprocessors/Microcontrollers

QUIZ Ch.6. The EAT for a two-level memory is given by:

COMPUTER BASICS Processing/Storage

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

CS370 Operating Systems

8086 Interrupts and Interrupt Responses:

Q1. Describe C.P.U and its subunits with the help of diagram?

Computer Systems Organization

MICROPROCESSOR MCQs. 1) What does the microprocessor comprise of? a. Register section b. One or more ALU c. Control unit d.

Basic Organization Memory Cell Operation. CSCI 4717 Computer Architecture. ROM Uses. Random Access Memory. Semiconductor Memory Types

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

Computer Organization

Operating Systems: Internals and Design Principles. Chapter 1 Computer System Overview Seventh Edition By William Stallings

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

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

Homeschool Enrichment. The System Unit: Processing & Memory

Input / Output. School of Computer Science G51CSA

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

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

GUJARAT TECHNOLOGICAL UNIVERSITY MASTER OF COMPUTER APPLICATION SEMESTER: III

Computer Architecture and Assembly Language. Spring

Module 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1

FE Review Computer Terms

Computer Organization

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

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

Sample Copy. Not For Distribution.

QUESTION BANK CS2252 MICROPROCESSOR AND MICROCONTROLLERS

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

Principles of Operating Systems CS 446/646

Three-box Model: These three boxes need interconnecting (usually done by wiring known as a bus. 1. Processor CPU e.g. Pentium 4 2.

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

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

Computer-System Architecture

Computer-System Architecture. Common Functions of Interrupts. Computer-System Operation. Interrupt Handling. Chapter 2: Computer-System Structures

Computer Organization ECE514. Chapter 5 Input/Output (9hrs)

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

Allmost all systems contain two main types of memory :

8255 Programmable Peripheral Interface Architecture MCT/UNIT III/NARASIMHARAJ/LECTURE NOTES /IV MECH A

CC411: Introduction To Microprocessors

Chapter 1: Introduction. Operating System Concepts 8th Edition,

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Transcription:

MICROPROCESSOR MEMORY ORGANIZATION 1

3.1 Introduction 3.2 Main memory 3.3 Microprocessor on-chip memory management unit and cache 2

A memory unit is an integral part of any microcomputer, and its primary purpose is to hold instructions and data. Memory system can be divided into three groups: 1. Microprocessor memory 2. Primary or main memory 3. Secondary memory 3

Microprocessor memory is a set of microprocessor registers, used to hold temporary results Main memory is the storage area in which all programs are executed, include ROM & RAM Secondary memory devices such as hard disks. The microcomputer cannot execute programs stored in the secondary memory directly, so to execute these programs the microcomputer must transfer them to its main memory by a program called the operating system. 4

Microprocessor memory main memory Secondary memory The fastest The slower The slowest The smallest The Larger The largest 5

An important characteristic of a memory is whether it is volatile or nonvolatile. The contents of a volatile memory are lost if the power is turned off. On the other hand, a nonvolatile memory retains its contents after power is switched off. ROM is a typical example of nonvolatile memory. RAM is a volatile memory. 6

Read Only Memory (ROM) A memory device that maintains its data permanently (or until the device is reprogrammed). Non-volatile: It maintains its data even without power supply. Used to store Programs such as the BIOS. Data such as look tables A ROM device can be 1. Masked ROM (Programmed by the manufacturer) 2. Programmable ROM (can be program-erased-reprogrammed many times Random Access Memory (RAM) A memory device that can be read and written. Volatile: It looses its data when the power supply is switched-off When the supply is switchedon it contains random data Used to store User programs that are loaded from a secondary memory (disk) Temporary data used by programs such as variables and arrays. A RAM device can be 1. Static 2. dynamic 7

The performance of a microprocessor system can be improved significantly by introducing a small, expensive, but fast memory between the microprocessor and main memory. 8

a cache memory is very small in size and its access time is less than that of the main memory by a factor of 5. Typically, the access times of the cache and main memories are 100 and 500 ns, respectively. A cache hit means : reference is found in the cache, A cache miss means : reference is not found in the cache, 9

The relationship between the cache and main memory blocks is established using mapping techniques. Three widely used mapping techniques are direct mapping, fully associative mapping, and set-associative mapping. 10

Direct mapping, The microprocessor first accesses the cache. If there is a hit, the microprocessor accepts the 16-bit word from the cache. In case of a miss, the microprocessor reads the desired 16-bit word from the main memory, and this 16- bit word is then written to the cache. A cache memory may contain instructions only (Instruction cache) or data only (data cache) or both instructions and data (unified cache). 11

Numerical example for Direct mapping 12

Example : (Direct mapping) as in the previous figure The content of index address 00 of cache is tag = 0 and data = 0 13F. Suppose that a microprocessor wants to access the memory address 100. The index address 00 is used to access the cache. Memory address tag 1 is compared with cache tag 0. This does not produce a match. Therefore, the main memory is accessed and the data 27 14 is transferred into the microprocessor. The cache word at index address 00 is then replaced by a tag of 1 and data of 27 14. 13

One of the main drawbacks of direct mapping is that numerous misses may occur if two or more words with addresses that have the same index but different tags are accessed several times. 14

Fully associative mapping The fastest and most expensive cache memory Each element in associative memory contains a main memory address and its content (data). 15

Fully associative mapping When the microprocessor generates a main memory address, it is compared associatively (simultaneously) with all addresses in the associative memory. If there is a match, the corresponding data word is read from the associative cache memory and sent to the microprocessor. If a miss occurs, the main memory is accessed and the address and its corresponding data are written to the associative cache memory. 16

Fully associative mapping 17

Set-associative mapping. a combination of direct and associative mapping. cache word stores two or more main memory words using the same index address. Each main memory word consists of a tag and its data word. An index with two or more tags and data words forms a set 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 18

Finally, microprocessors such as the Intel Pentium I1 support two levels of cache, L1 (level 1) and L2 ( level 2) cache memories. The L1 cache (smaller in size) is contained inside the processor chip while the L2 cache (larger in size) is interfaced external to the microprocessor. 19

The L 1 cache normally provides separate instruction and data caches. The processor can access the L1 cache directly and the L2 cache normally supplies instructions and data to the L1 cache. The L2 cache is usually accessed by the microprocessor only if L 1 misses occur. This two-level cache memory enhances microprocessor performance. 20

MICROPROCESSOR INPUT/OUTPUT 21

4.1 Introduction 4.2 Programmed I/O 4.3 Interrupt I/O 4.4 Direct Memory Access (DMA) 22

The technique of data transfer between a microcomputer and an external device is called input/output (I/O). Peripherals : are the I/O devices that connected to a microcomputer and provide an efficient means of communication between the microcomputer and the outside world. 23

Because the characteristics of I/O devices are normally different from those of a microcomputer like (speed and word length) we need interface hardware circuitry between the microcomputer and I/O devices Interface hardware provide all input and output transfers between the microcomputer and peripherals by using an I/O bus. An I/O bus carries three types of signals: device address, data, and command. 24

There are three ways of transferring data between a microcomputer and physical I/O devices : 1- programmed I/O, 2- interrupt I/O and 3- direct memory access. 25

Programmed I/O, the microprocessor executes a program to perform all data transfers between the microcomputer and the external device. The main characteristic of this type of I/O technique is that the external device carries out the functions dictated by the program inside the microcomputer memory. 26

Programmed I/O basically works in these ways: CPU requests I/O operation I/O module performs operation I/O module sets status bits CPU checks status bits periodically I/O module does not inform CPU directly I/O module does not interrupt CPU CPU may wait or come back later 27

Interrupt I/O, an external device (connected to a pin called the interrupt (INT) pin on the microprocessor chip)can force the microprocessor to stop executing the current program temporarily so that it can execute another program known as an interrupt service routine. After completing this program, a return from interrupt instruction can be executed at the end of the service routine to return control at the right place in the main program. 28

Overcomes CPU waiting No repeated CPU checking of device I/O module interrupts when ready Interrupt Driven I/O Basic Operation CPU issues read command I/O module gets data from peripheral whilst CPU does other work I/O module interrupts CPU CPU requests data I/O module transfers data 29

How Interrupt work?? 1. When the device needs an I/O transfer with the microcomputer, it activates the interrupt pin of the processor chip. 2. The microcomputer usually completes the current instruction and saves the contents of the current program counter and the status register in the stack. 30

There are typically three types of interrupts: 1. External interrupts 2. Traps or internal interrupts 3. Software interrupts External interrupts can be divided into: 1- Maskable 2- Nonmaskable. Nonmaskable interrupt cannot be enabled or disabled by instructions, whereas maskable interrupt: a microprocessor s instruction set contains instructions to enable or disable it, such as a power failure interrupt. 31

2. Internal interrupts, or Traps, are activated internally by exceptional conditions such as overflow, division by zero, or execution of an illegal op-code. Many microprocessors include software interrupts, or system calls. When one of these instructions is executed, the microprocessor is interrupted and serviced similarly to external or internal interrupts. 32

When a microprocessor is interrupted, it normally saves the program counter (PC) and the status register (SR) onto the stack so that the microprocessor can return to the main program with the original values of PC and SR after executing the service routine. 33

is a type of I/O technique in which data can be transferred between microcomputer memory and an external device such as the hard disk, without microprocessor involvement. A special chip called the DMA controller chip is typically used with the microprocessor for transferring data using DMA. 34