Digital Design Laboratory Lecture 6 I/O

Similar documents
Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

Organisasi Sistem Komputer

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals

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

Input / Output. School of Computer Science G51CSA

Eastern Mediterranean University School of Computing and Technology INPUT / OUTPUT

Chapter 7 : Input-Output Organization

INPUT-OUTPUT ORGANIZATION


Advanced Parallel Architecture Lesson 4 bis. Annalisa Massini /2015

Input/Output Systems

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

Unit 1. Chapter 3 Top Level View of Computer Function and Interconnection

INPUT/OUTPUT ORGANIZATION

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

Where We Are in This Course Right Now. ECE 152 Introduction to Computer Architecture Input/Output (I/O) Copyright 2012 Daniel J. Sorin Duke University

Computer Architecture CS 355 Busses & I/O System

INPUT-OUTPUT ORGANIZATION

INPUT/OUTPUT ORGANIZATION

Modes of Transfer. Interface. Data Register. Status Register. F= Flag Bit. Fig. (1) Data transfer from I/O to CPU

Bus System. Bus Lines. Bus Systems. Chapter 8. Common connection between the CPU, the memory, and the peripheral devices.

Computer Organization

CSCI-GA Operating Systems I/O. Hubertus Franke

Unit 5. Memory and I/O System

C02: Interrupts and I/O

ECE 341. Lecture # 19

INPUT/OUTPUT DEVICES Dr. Bill Yi Santa Clara University

Chapter 11: Input/Output Organisation. Lesson 17: Standard I/O buses USB (Universal Serial Bus) and IEEE1394 FireWire Buses

Chapter 3. Top Level View of Computer Function and Interconnection. Yonsei University

Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION

ECE331: Hardware Organization and Design

Chapter 5 Input/Output Organization. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Introduction to Input and Output

ECE 1160/2160 Embedded Systems Design. Midterm Review. Wei Gao. ECE 1160/2160 Embedded Systems Design

OPERATING SYSTEMS CS136

INPUT/OUTPUT ORGANIZATION

CSE380 - Operating Systems. Communicating with Devices

The control of I/O devices is a major concern for OS designers

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

INPUT-OUTPUT ORGANIZATION

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Module 6: INPUT - OUTPUT (I/O)

Module 11: I/O Systems

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

Announcement. Computer Architecture (CSC-3501) Lecture 23 (17 April 2008) Chapter 7 Objectives. 7.1 Introduction. 7.2 I/O and Performance

Chapter 8. A Typical collection of I/O devices. Interrupts. Processor. Cache. Memory I/O bus. I/O controller I/O I/O. Main memory.

Digital System Design

Blog -

Digital Input and Output

EN1640: Design of Computing Systems Topic 07: I/O

Computer Architecture and Organization: L10: I/O Organization

Input/Output Interfaces: Ch

PC Interrupt Structure and 8259 DMA Controllers

1. Define Peripherals. Explain I/O Bus and Interface Modules. Peripherals: Input-output device attached to the computer are also called peripherals.

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Summary of Computer Architecture

Buses. Disks PCI RDRAM RDRAM LAN. Some slides adapted from lecture by David Culler. Pentium 4 Processor. Memory Controller Hub.

Programmed I/O Interrupt-Driven I/O Direct Memory Access (DMA) I/O Processors. 10/12/2017 Input/Output Systems and Peripheral Devices (02-2)

Chapter 11: Input/Output Organisation. Lesson 02: Accessing the I/O devices and Interface circuit

Input-Output (I/O) Input - Output. I/O Devices. I/O Devices. I/O Devices. I/O Devices. operating system must control all I/O devices.

5.b Principles of I/O Hardware CPU-I/O communication

Advanced Parallel Architecture Lesson 4. Annalisa Massini /2015

ECE232: Hardware Organization and Design

More on IO: The Universal Serial Bus (USB)

Introduction I/O 1. I/O devices can be characterized by Behavior: input, output, storage Partner: human or machine Data rate: bytes/sec, transfers/sec

CS510 Operating System Foundations. Jonathan Walpole

Input-Output Organization

Hardware OS & OS- Application interface

CSE 380 Computer Operating Systems

CS370 Operating Systems

CS330: Operating System and Lab. (Spring 2006) I/O Systems

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

CSC 2405: Computer Systems II

Interfacing Techniques in Embedded Systems

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

I/O Systems. Jo, Heeseung

Computer Organization

Computer Science 146. Computer Architecture

Ch 4. Standard Single Purpose Processors: Peripherals

操作系统概念 13. I/O Systems

5 Computer Organization

Chapter 1 Computer System Overview

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

11 ASYNCHRONOUS SERIAL PORTS

Computer System Overview

CSE 451: Operating Systems Winter I/O System. Gary Kimura

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

Input/Output. 198:231 Introduction to Computer Organization Lecture 15. Instructor: Nicole Hynes

Chapter 5 - Input / Output

Section I Section Real Time Systems. Processes. 1.6 Input/Output Management. (Textbook: A. S. Tanenbaum Modern OS - ch. 5)

Today: I/O Systems. Architecture of I/O Systems

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter ,

Comp 204: Computer Systems and Their Implementation. Lecture 18: Devices

I/O Organization John D. Carpinelli, All Rights Reserved 1

I/O. CS 416: Operating Systems Design Department of Computer Science Rutgers University

Silberschatz and Galvin Chapter 12

3. Controtlto specify the mode of transfer such as read or write 4. A control to start the DMA transfer

IO System. CP-226: Computer Architecture. Lecture 25 (24 April 2013) CADSL

Computer Organization (Input-output)

Transcription:

ECE 280 / CSE 280 Digital Design Laboratory Lecture 6 I/O

Input/Output Module Interface to CPU and Memory Interface to one or more peripherals

Generic Model of I/O Module

External Devices Human readable Screen, printer, keyboard Machine readable Monitoring and control Communication Modem Network Interface Card (NIC)

External Device Block Diagram

Typical I/O Data Rates

I/O Module Function Control & Timing CPU Communication Device Communication Data Buffering Error Detection

Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)

Programmed I/O CPU has direct control over I/O Sensing status Read/write commands Transferring data CPU waits for I/O module to complete operation Wastes CPU time

Programmed I/O - detail 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

I/O Commands CPU issues address Identifies module (& device if >1 per module) CPU issues command Control - telling module what to do e.g. spin up disk Test - check status e.g. power? Error? Read/Write Module transfers data via buffer from/to device

Addressing I/O Devices Under programmed I/O data transfer is like memory access (CPU viewpoint) Each device given unique identifier CPU commands contain identifier (address)

I/O Mapping Memory mapped I/O Devices and memory share an address space I/O looks just like memory read/write No special commands for I/O Large selection of memory access commands available Isolated I/O Separate address spaces Need I/O or memory select lines Special commands for I/O Limited set

Interrupt Driven I/O 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

CPU Viewpoint Issue read command Do other work Check for interrupt at end of each instruction cycle If interrupted:- Save context (registers) Process interrupt Fetch data & store

Design Issues How do you identify the module issuing the interrupt? How do you deal with multiple interrupts? i.e. an interrupt handler being interrupted

Identifying Interrupting Module (1) Different line for each module PC Limits number of devices Software poll CPU asks each module in turn Slow

Identifying Interrupting Module (2) Daisy Chain or Hardware poll Interrupt Acknowledge sent down a chain Module responsible places vector on bus CPU uses vector to identify handler routine Bus Master Module must claim the bus before it can raise interrupt e.g. SCSI

Multiple Interrupts Each interrupt line has a priority Higher priority lines can interrupt lower priority lines If bus mastering only current master can interrupt

Polling vs. Interrupts Polling is faster than interrupts because Compiler knows which registers in use at polling point. Hence, do not need to save and restore registers (or not as many). Other interrupt overhead avoided (pipeline flush, trap priorities, etc). Polling is slower than interrupts because Overhead of polling instructions is incurred regardless of whether or not handler is run. This could add to inner-loop delay. Device may have to wait for service for a long time.

Polling vs. Interrupts When to use one or the other? Multi-axis tradeoff Frequent/regular events good for polling, as long as device can be controlled at user level. Interrupts good for infrequent/irregular events Interrupts good for ensuring regular/predictable service of events.

I/O module I/O without Interrupts Polling based I/O CPU idle prepare to write

I/O without Interrupts I/O module CPU writing idle

I/O without Interrupts I/O module idle CPU processing complete write

I/O with Interrupts I/O module CPU idle prepare to write

I/O with Interrupts I/O module CPU writing processing

I/O with Interrupts I/O module idle CPU processing complete write

Interfacing Connecting devices together Bit of wire? Dedicated processor/memory/buses? Similar characteristics to processor/memory buses E.g. RS-232, USB, PS/2, FireWire, InfiniBand, SCSI, IDE

Data Transmission How do you synchronize the signal? Transmit clock with data OK for short distances Recover clock from transmission signal Requires PLL Network transmission Disk/Tape read Synchronize data to local clock Not as fast Simpler to design

Data Transmission RS-232-3 to -15V for logic 1 +3 to +15V for logic 0 Up to 192Kbps

Data Transmission Transmission Line Characteristics Attenuation - wire resistance causes signal loss Reflection - Caused by improper resistance termination

Data Transmission Adjacent signais will have cross-coupled capacitances and inductances that will degrade signal Can be minimized by putting ground signals between each data signal External EM effects can be reduced with adequate shielding or using twisted pair

Lab 5 PS/2 Keyboard controller Keyboard reader Serial port state machine gets scancodes from PS/2 port Convert scancodes to ASCII Reader state machine handles special keys - shift, ctrl, alt LED display Gets data_available interrupt from keyboard reader Holds onto last eight ASCII characters received

Lab 5 ps2_clk ps2_data

Lab 5 Scancodes are 11 bits long 0 start bit 8 scancode bits Odd parity bit 1 stop bit

Lab 5 Keyboard scancodes Scancode F0 followed by key scancode indicates key up