Sei sulla pagina 1di 49

INPUT/OUTPUT

CHAPTER # 6 Computer Organization & Architecture


External Devices
S H E H E R YAR MALI K

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

Chapter # 6 Computer Organization & Architecture 2


Input/Output Problems
S H E H E R YAR MALI K

 Wide variety of peripherals


 Delivering different amounts of data
 At different speeds
 In different formats
 All slower than CPU and RAM
 Need I/O modules

Chapter # 6 Computer Organization & Architecture 3


Input/Output Module
S H E H E R YAR MALI K

 Interface to CPU and Memory


 Interface to one or more peripherals

Chapter # 6 Computer Organization & Architecture 4


Generic Model of I/O Module
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 5


External Device Block Diagram
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 6


I/O Module Function
S H E H E R YAR MALI K

 Control & Timing


 CPU Communication
 Device Communication
 Data Buffering
 Error Detection

Chapter # 6 Computer Organization & Architecture 7


I/O Steps
S H E H E R YAR MALI K

 CPU checks I/O module device status


 I/O module returns status
 If ready, CPU requests data transfer
 I/O module gets data from device
 I/O module transfers data to CPU
 Variations for output, DMA, etc.

Chapter # 6 Computer Organization & Architecture 8


I/O Module Diagram
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 9


I/O Module Decisions
S H E H E R YAR MALI K

 Hide or reveal device properties to CPU


 Support multiple or single device
 Control device functions or leave for CPU
 Also O/S decisions
 e.g. Unix treats everything it can as a file

Chapter # 6 Computer Organization & Architecture 10


Input Output Techniques
S H E H E R YAR MALI K

 Programmed I/O
 Interrupt driven I/O
 Direct Memory Access (DMA)

Chapter # 6 Computer Organization & Architecture 11


Three Techniques for Input of a Block of Data
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 12


Programmed I/O
S H E H E R YAR MALI K

 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

Chapter # 6 Computer Organization & Architecture 13


Programmed I/O - Detail
S H E H E R YAR MALI K

 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

Chapter # 6 Computer Organization & Architecture 14


I/O Commands
S H E H E R YAR MALI K

 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

Chapter # 6 Computer Organization & Architecture 15


Addressing I/O Devices
S H E H E R YAR MALI K

 Under programmed I/O data transfer is very like


memory access (CPU viewpoint)
 Each device given unique identifier
 CPU commands contain identifier (address)

Chapter # 6 Computer Organization & Architecture 16


I/O Mapping
S H E H E R YAR MALI K

 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

Chapter # 6 Computer Organization & Architecture 17


Interrupt Driven I/O
S H E H E R YAR MALI K

 Overcomes CPU waiting


 No repeated CPU checking of device
 I/O module interrupts when ready

Chapter # 6 Computer Organization & Architecture 18


Interrupt Driven I/O Basic Operation
S H E H E R YAR MALI K

 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

Chapter # 6 Computer Organization & Architecture 19


Simple Interrupt Processing
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 20


CPU Viewpoint
S H E H E R YAR MALI K

 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

Chapter # 6 Computer Organization & Architecture 21


Changes in Memory and Registers for an Interrupt
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 22


Design Issues
S H E H E R YAR MALI K

 How do you identify the module issuing the


interrupt?
 How do you deal with multiple interrupts?
 i.e. an interrupt handler being interrupted

Chapter # 6 Computer Organization & Architecture 23


Identifying Interrupting Module
S H E H E R YAR MALI K

 Multiple Interrupt Lines


 Different line for each module
 Limits number of devices
 Software poll
 CPU asks each module in turn
 Slow
 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. PCI & SCSI
Chapter # 6 Computer Organization & Architecture 24
Multiple Interrupts
S H E H E R YAR MALI K

 Each interrupt line has a priority


 Higher priority lines can interrupt lower priority lines
 If bus mastering only current master can interrupt

Chapter # 6 Computer Organization & Architecture 25


Direct Memory Access
S H E H E R YAR MALI K

 Interrupt driven and programmed I/O require active


CPU intervention
 Transfer rate is limited
 CPU is tied up
 DMA is the answer

Chapter # 6 Computer Organization & Architecture 26


DMA Function
S H E H E R YAR MALI K

 Additional Module (hardware) on bus


 DMA controller takes over from CPU for I/O

Chapter # 6 Computer Organization & Architecture 27


Typical DMA Module Diagram
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 28


DMA Operation
S H E H E R YAR MALI K

 CPU tells DMA controller


 Read/Write
 Device address
 Starting address of memory block for data
 Amount of data to be transferred
 CPU carries on with other work
 DMA controller deals with transfer
 DMA controller sends interrupt when finished

Chapter # 6 Computer Organization & Architecture 29


DMA Transfer Cycle Stealing
S H E H E R YAR MALI K

 DMA controller takes over bus for a cycle


 Transfer of one word of data
 Not an interrupt
 CPU does not switch context
 CPU suspended just before it accesses bus
 i.e. before an operand or data fetch or a data write
 Slows down CPU but not as much as CPU doing
transfer

Chapter # 6 Computer Organization & Architecture 30


DMA Configurations
S H E H E R YAR MALI K

 Single Bus, Detached DMA controller


 Each transfer uses bus twice
 I/O to DMA then DMA to memory
 CPU is suspended twice

Chapter # 6 Computer Organization & Architecture 31


DMA Configurations
S H E H E R YAR MALI K

 Single Bus, Integrated DMA controller


 Controller may support >1 device
 Each transfer uses bus once
 DMA to memory
 CPU is suspended once

Chapter # 6 Computer Organization & Architecture 32


DMA Configurations
S H E H E R YAR MALI K

 Separate I/O Bus


 Bus supports all DMA enabled devices
 Each transfer uses bus once
 DMA to memory
 CPU is suspended once
Chapter # 6 Computer Organization & Architecture 33
Intel 8237A DMA Controller
S H E H E R YAR MALI K

 Interfaces to 80x86 family and DRAM


 When DMA module needs buses it sends HOLD signal to processor
 CPU responds HLDA (hold acknowledge)
 DMA module can use buses
 E.g. transfer data from memory to disk
1. Device requests service of DMA by pulling DREQ (DMA request) high
2. DMA puts high on HRQ (hold request),
3. CPU finishes present bus cycle (not necessarily present instruction) and puts
high on HDLA (hold acknowledge). HOLD remains active for duration of DMA
4. DMA activates DACK (DMA acknowledge), telling device to start transfer
5. DMA starts transfer by putting address of first byte on address bus and
activating MEMR; it then activates IOW to write to peripheral. DMA
decrements counter and increments address pointer. Repeat until count
reaches zero
6. DMA deactivates HRQ, giving bus back to CPU

Chapter # 6 Computer Organization & Architecture 34


8237 DMA Usage of Systems Bus
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 35


Fly-By
S H E H E R YAR MALI K

 While DMA using buses, processor is idle


 Processor using bus, DMA is idle
 Known as fly-by DMA controller
 Data does not pass through and is not stored in DMA
chip
 8237 contains four DMA channels
 Programmed independently
 Any one active
 Numbered 0, 1, 2, and 3

Chapter # 6 Computer Organization & Architecture 36


I/O Channels
S H E H E R YAR MALI K

 I/O devices getting more sophisticated


 e.g. 3D graphics cards
 CPU instructs I/O controller to do transfer
 I/O controller does entire transfer
 Improves speed
 Takes load off CPU
 Dedicated processor is faster

Chapter # 6 Computer Organization & Architecture 37


I/O Channel Architecture
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 38


The Evolution of the I/O Function
S H E H E R YAR MALI K

 Programmed I/O
 The CPU directly controls a peripheral device
 Simple microprocessor controlled devices
 I/O Module
 A controller or I/O module is added
 The CPU uses programmed I/O without interrupts
 CPU somewhat divorced from the details of external device interfaces
 Interrupt Driven
 Now interrupts are employed
 The CPU need not spend time waiting for an I/O operation to be performed
 thus increasing efficiency
 DMA
 The I/O module is given direct access to memory via DMA
 It can now move a block of data to or from memory without involving the CPU,
except at the beginning and end of the transfer

Chapter # 6 Computer Organization & Architecture 39


The Evolution of the I/O Function
S H E H E R YAR MALI K

 I/O Channel
 The I/O module is enhanced to become a processor in its own right,
with a specialized instruction set tailored for I/O
 The CPU directs the I/O processor to execute an I/O program in
memory
 The I/O processor fetches and executes these instructions without CPU
intervention
 I/O Processor
 The I/O module has a local memory of its own
 A large set of I/O devices can be controlled, with minimal CPU
involvement

Chapter # 6 Computer Organization & Architecture 40


Parallel and Serial I/O
S H E H E R YAR MALI K

 Parallel interface
 multiple lines connecting the
peripheral
 multiple bits are transferred
simultaneously
 Serial interface
 Only one line used to transmit
data
 bits must be transmitted one at a
time

Chapter # 6 Computer Organization & Architecture 41


Point-to-Point vs Multipoint interface
S H E H E R YAR MALI K

 Connection between an I/O module in a computer


system and external devices can be either:
 point-to-point
 multiport
 Point-to-point interface
 provides a dedicated line between the I/O module and the
external device
 On small systems (PCs, workstations) typical point-to-point links
include those to the keyboard, printer, and external modem
 Multipoint external interfaces
 used to support external mass storage devices (disk and tape
drives) and multimedia devices (CD-ROMs, video, audio)

Chapter # 6 Computer Organization & Architecture 42


Thunderbolt
S H E H E R YAR MALI K

 Most recent and fastest peripheral connection technology to become


available for general-purpose use
 Developed by Intel with collaboration from Apple
 The technology combines data, video, audio, and power into a single high-
speed connection for peripherals such as hard drives, RAID arrays, video-
capture boxes, and network interfaces
 Provides up to 10 Gbps throughput in each direction and up to 10 Watts of
power to connected peripherals
 A Thunderbolt-compatible peripheral interface is considerably more
complex than a simple USB device
 First generation products are primarily aimed at the professional-
consumer market such as audiovisual editors who want to be able to move
large volumes of data quickly between storage devices and laptops
 Thunderbolt is a standard feature of Apple’s MacBook Pro laptop and iMac
desktop computers

Chapter # 6 Computer Organization & Architecture 43


Thunderbolt in a Computer Configuration
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 44


Thunderbolt Protocol Layers
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 45


InfiniBand
S H E H E R YAR MALI K

 Recent I/O specification aimed at the high-end server


market
 First version was released in early 2001
 Standard describes an architecture and specifications for
data flow among processors and intelligent I/O devices
 Has become a popular interface for storage area
networking and other large storage configurations
 Enables servers, remote storage, and other network
devices to be attached in a central fabric of switches and
links
 The switch-based architecture can connect up to 64,000
servers, storage systems, and networking devices
Chapter # 6 Computer Organization & Architecture 46
InfiniBand Switch Fabric
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 47


InfiniBand Links and Data Throughput Rates
S H E H E R YAR MALI K

Chapter # 6 Computer Organization & Architecture 48


zEnterprise 196
S H E H E R YAR MALI K

 Introduced in 2010
 IBM’s latest mainframe computer offering
 System is based on the use of the z196 chip
 5.2 GHz multi-core chip with four cores
 Can have a maximum of 24 processor chips (96 cores)
 Has a dedicated I/O subsystem that manages all I/O operations
 Of the 96 core processors, up to 4 of these can be dedicated for I/O use,
creating 4 channel subsystems (CSS)
 Each CSS is made up of the following elements:
 System assist processor (SAP)
 Hardware system area (HSA)
 Logical partitions
 Subchannels
 Channel path
 Channel

Chapter # 6 Computer Organization & Architecture 49

Potrebbero piacerti anche