Chapter 6 System Integration and Performance. Chapter goals Describe the implementation of the system bus and bus protocol. Describe how the CPU and bus.

Slides:



Advertisements
Similar presentations
Cis303a_chapt06.ppt Copyright© 2002 Morris Fulcher Chapter 6 System Integration and Performance System Bus Bus Parallel communications lines that connect.
Advertisements

SCSC 311 Information Systems: hardware and software
Computer Architecture
System Integration and Performance
Categories of I/O Devices
CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Computer System Overview
1 Computer System Overview OS-1 Course AA
System Integration and Performance
1 CSIT431 Introduction to Operating Systems Welcome to CSIT431 Introduction to Operating Systems In this course we learn about the design and structure.
Computer System Overview
Chapter 1 and 2 Computer System and Operating System Overview
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Computer System Overview Chapter 1. Basic computer structure CPU Memory memory bus I/O bus diskNet interface.
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Cis303a_chapt06_exam.ppt CIS303A: System Architecture Exam - Chapter 6 Name: __________________ Date: _______________ 1. What connects the CPU with other.
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
2 Systems Architecture, Fifth Edition Chapter Goals Describe the system bus and bus protocol Describe how the CPU and bus interact with peripheral devices.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
MICROPROCESSOR INPUT/OUTPUT
THE COMPUTER SYSTEM. Lecture Objectives Computer functions – Instruction fetch & execute – Interrupt Handling – I/O functions Interconnections Computer.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Top Level View of Computer Function and Interconnection.
Operating Systems and Networks AE4B33OSS Introduction.
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
EEE440 Computer Architecture
2 Systems Architecture, Fifth Edition Chapter Goals Describe the system bus and bus protocol Describe how the CPU and bus interact with peripheral devices.
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
Lecture 1: Review of Computer Organization
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Chapter 6 System Integration and Performance
Computer System Overview
ECEG-3202 Computer Architecture and Organization
Components of a CPU AS Computing - F451.
Chapter 1 Computer System Overview
Presentation transcript:

Chapter 6 System Integration and Performance

Chapter goals Describe the implementation of the system bus and bus protocol. Describe how the CPU and bus interact with peripheral devices. Describe the purpose and function of device controllers.

Chapter goals cont. Describe how interrupts coordinate actions of the CPU with secondary storage and I/O devices Describe how buffers, caches, and data compression improve computer system performance

Role of the system bus Bus is mechanism that allows computer components to work together Is made up of parallel communication lines connecting computer components CPU, hard drive, parallel port, modem, etc. Can connect two or more devices Information can travel in both directions

System bus (cont.) Can connect both internal (hard drive) and external (printer) devices System bus has three parts Data bus – carries data Address bus – used if RAM is involved Control bus – commands and status information Each bus line carries 1 bit of information

System bus

Bus Clock Like the CPU, the bus has a clock that acts as a timing device For CPU, each tick is trigger to execute an instruction For system bus, each tick is an opportunity to transmit data or a control message

Bus clock cont. Bus clock is MUCH slower than CPU clock Think of CPU as the highway and the system bus as the local streets

Why slower? Data on bus must travel a longer physical distance than data in CPU Even though data is traveling at the speed of light it still needs more time to travel over a greater distance Need to allows time to factor out noise, interference Also allows time to operate controller logic in peripheral devices

Bus data transfer rate Called the bus data capacity Expresses how much data can travel across bus over time Is a combination of Bus clock speed Data transfer unit (usually a word) Is used to calculate things like Time required to load large files (i.e. video)

Bus protocol Data transportation rules that ensure the smooth transfer of information without error Dictates the format, content, and timing of data, memory addresses, and messages Every peripheral device (no matter the manufacturer) must follow the bus protocol rules

Bus protocol cont. Protocol can impact (reduce) data transfer rates Protocols often require exchanges of control signals Control signals consume bus cycles that could otherwise send data

Sample protocol Example: if a disk drive transfers data to RAM as the result of an explicit CPU instruction, the following steps are followed: CPU sends command to the drive Drive send acknowledgement to CPU Drive carries out transfer Drive sends confirmation to CPU that transfer is complete

Why use protocols? Protocol regulates bus access Stops devices from interfering with each other I/O data transfer is the largest cause of errors in computers I/O commands need to be acknowledged and confirmed

What if two devices need the bus? When two (or more) peripheral devices need access to the bus at the same time that is called a collision Three solutions are in place to deal with this Master-slave Multiple master Peer to peer

Master-slave CPU is bus master Traditional computer architecture No device can access the bus unless in response to explicit command from CPU Allows a very simple protocol No collision is possible as long as CPU waits for response from device before proceeding to the next bus request

Master-slave cont. Overall system performance is severely degraded If devices can only communicate through the CPU, then transfers between devices, i.e. memory to disk, must pass through the CPU Every transfer takes at least 2 bus cycles CPU cannot execute software while it is managing the bus

A better solution System performance is improved if storage and I/O devices can transmit data among themselves without explicit CPU involvement Direct Memory Access (DMA) controller is attached to the bus and main memory DMA assumes the role of bus master for all transfers between memory and other storage or I/O devices CPU is free to do whatever

Multiple master bus Any device can assume control of the bus, or act as bus master for transfer to any other device (not just memory) Still only a single device can be master at one time Bus arbitration unit is a simple processor attached to a multiple master bus It decides which devices must wait when multiple devices want to become a bus master

Logical vs. Physical Access I/O port is a communication pathway from the CPU to a peripheral device I/O port is often implemented as a memory address that can be accessed (read or written to) by The CPU Or a single peripheral device

Logical and Physical Access

I/O Ports Each peripheral device may have several I/O ports and use them for different purposes Dedicated bus hardware controls data movement between I/O ports and peripheral devices CPU reads and writes to I/O ports using ordinary data movement instructions or dedicated I/O instructions

The CPU and I/O Ports I/O port is more than a memory address, it is a data conduit It is a logical abstraction used by the CPU and the bus to interact with each peripheral device in a similar way

Logical access CPU and the bus both interact with each peripheral device as if it was a storage device containing one or more bytes of contiguous memory CPU and the bus deals with each device the same way, but devices are different Storage capacity Internal data coding methods If storage or I/O device

Linear address space A read/write operation to/from this hypothetical device is called a logical access The set of sequentially numbered storage locations is called a linear address space

How logical becomes physical Logical access assumes device is similar to memory (RAM) Bus address lines carry the position within the linear address space being read or written Device controller makes the conversion via a conversion table or a simple algorithm

Conversion table for disk

Device controllers Storage devices have intermediaries that connect them to the system bus Translate logical access to physical access Handles bus protocol (receiving and acknowledging commands) Permits several devices to share a bus connection

Device controllers

Device controllers cont. Device controllers monitor the bus control lines for signals to peripheral devices Translates those signals into appropriate commands for its device

Interrupts Secondary storage and I/O device transfer rates are much slower than the CPU Why? Slower bus clock Peripheral devices have mechanical elements (access arm, spin mechanism) that are slower than speed of electricity

Interrupts cont. When the CPU issues a read/write instruction it ALWAYS has to wait This waiting time can translate into thousands, millions, or even billions of CPU cycles To allow CPU to be used more efficiently, interrupts are used

How interrupts work When a program (task, process, thread) needs I/O, CPU makes I/O request over the system bus Then puts your task aside (asleep) Does something else for the time being

Interrupts cont. When I/O is complete, interrupt signal is sent to the CPU CPU can now restart your task with I/O task being complete

CPU and Interrupts Portion of the CPU (separate from the fetch execute cycle) continuously monitors the bus for interrupt signals The signal is an interrupt code that indicates the bus port number of the device sending the interrupt CPU copies any interrupt signals it encounters into an interrupt register

The CPU and Interrupts cont. As an extra step in the fetch execute cycle, the CPU checks the interrupt register after completing an instruction but before fetching another one If interrupt register has a non-zero value CPU must respond to the interrupt

CPU and Interrupts If CPU is to process an interrupt it does the following: Puts aside (suspends) current task Resets interrupt register to 0 (zero) Processes interrupt by calling interrupt handler After interrupt processing is complete, resumes suspended program

Interrupt handlers Interrupts are a mechanism for calling (invoking) system software processes and programs Operating system (OS) provides low- level processing routines (service calls) Examples: reading data in from the keyboard Writing to a file

Interrupt handlers cont. There is a unique individual interrupt handler (i.e. program) to process each possible interrupt Each handler is a separate program stored in a separate part of main memory

Interrupt table A conversion table in main memory that has a list of all interrupt codes Interrupt code is used as an index into interrupt table For each interrupt code, interrupt table has the memory address of each interrupt handler

Interrupt handlers Supervisor (OS) examines the interrupt code, uses it as an index into the interrupt table Looks up memory location of needed interrupt handler Loads that memory location into the PC (program counter) Interrupt handler begins executing

Multiple interrupts It is possible (even likely) that interrupts will interrupt each other OS has an algorithm to determine what goes first Assigns priorities to different interrupts based on Error conditions Critical hardware failures

Suspending a process Whenever a process is suspended or interrupted the system must save whatever information is necessary to allow the process to restart again Typically that involved saving PC and IR Any other specialized or general purpose registers that were in use

Saving a process The collection of information needed to restart a process is called the “machine state” It is saved in a special storage location called the stack

The Stack The stack is a specialize storage location in RAM It is a data structure where you add and delete information from the same end Therefore the last process saved by the CPU is the first one it will pick up

Interrupt process

Buffers Buffers are a mechanism that uses RAM to overcome slow data transfer rate to peripheral devices Small storage area (in RAM) used to hold data in transit from one device to another

Buffers and printing Printed version of document with formatting information is copied to RAM When full page is ready it is released from the buffer Document is written from RAM to printer Also have input buffers – keyboard, modem, etc.

Buffers

Cache Pronounced “cash” Separate high speed storage area specifically managed to improve overall system performance Idea is most often needed data is kept in the cache Must be managed intelligently

Cache cont. Data content is not automatically removed (unlike buffer) Used for bi-directional data transfer Used only for storage device access Larger than buffer

Cache cont. Basic idea is that access to high speed cache is faster than hard drive During a write operation cache acts as a buffer Data written to cache then to drive

Cache controller Manages the content of the cache It must “guess” which files should be in the cache, i.e. what data the CPU will ask for Cache hit – when data is found in the cache Cache miss – when data is not found Cache swap – old data removed and new data inserted

Cache cont. Even a small cache can significantly improve performance Ratio of primary storage to cache of 10,000 to 1 can result in cache hit rate of 90%

Compression Technique to reduce the number of bits used to encode a set of related data items, i.e. a file or stream of video Some formats (MP3, GIF) are intentionally compressed data formats

Compression cont. Compression is accomplished by the application of a compression algorithm (specific mathematical technique) Also need corresponding de- compression algorithms to restore data to its original state

Compression cont. Compression algorithms vary What types of data are appropriate Whether any data is lost Amount by which data is compressed Lossless compression (zip) – no loss of data Lossy – some loss of data (audio or video)

Compression cont. Compression rate – size before and after compression Used to reduce secondary storage requirements Transmit over Internet Package files together

Data compression

MP3 encoding elements

MP3 How MP3 works tm tm

Summary The system bus is the communication pathway that connects the CPU with memory and other devices The CPU communicates with peripheral devices through I/O ports

Summary cont. Application programs use interrupt processing to coordinate data transfers to or from peripheral devices, notify the CPU of errors, and call operating system service programs A buffer is a region of memory that holds a single unit of data for transfer to or from a device Compression reduces the number of bits required to encode a data set or stream, effectively increasing the capacity of a communication channel or storage device