Presentation is loading. Please wait.

Presentation is loading. Please wait.

Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted.

Similar presentations


Presentation on theme: "Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted."— Presentation transcript:

1

2 Input/Output

3 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted by the device it is sent to (output) Computer interprets data received (input)

4 3 Devices Obvious ones… Mouse Keyboard Printer Modem Not so obvious ones… Floppies CD-ROM Hard disc drives What are devices?

5 4 The Bus - Reminder A collection of wires which carry data between the CPU, memory and I/O devices Address Bus: carries memory address values from the CPU to the memory and I/O Data Bus: carries all data, including machine codes, in all directions Control Bus: a small number of wires carrying the read/write and enable signals, and a few other ‘control’ signals

6 5 I/O Devices Address bus Data bus Control bus I/O Port Peripheral Interface between computer’s bus and I/O device Device-specific communication link Actual I/O device

7 6 Peripherals These are the devices that actually do the physical input, output and data storage operations. Examples:keyboardprinter mousefloppy disk VDUmodem They do not connect directly to the computer’s bus. A peripheral is anything connected to the computer except the CPU, memory and power supply

8 7 I/O Ports These are the devices that provide interfaces between the computer’s buses and the peripherals. In general, they do the following: Recognise when they are being addressed, or selected Provide at least one (but typically at least two) addressable locations that can be read and/or written like a memory location. These locations are called I/O registers, and can be classified into data registers and control registers

9 8 I/O Ports Respond to commands from the CPU –CPU writes to the control registers For input devices: transfer data from device to input data registers –CPU can then read data from these registers For output devices: transfer data from data registers to device –CPU will have already written data to registers

10 9 I/O Ports Provide a variety of protocols for data transfer to and from the peripheral, all under CPU control Provide status and error information to the CPU e.g. ready, broken, run out of paper etc Issue interrupts to signal the occurrence of certain events (e.g. data received), as specified by the CPU (more later)

11 10 Parallel and Serial Interfaces I/O ports can be classified according to the type of interface they implement. The two commonest are:- parallel interface (e.g. to a printer) serial interface (e.g. to a VDU or modem)

12 11 Parallel Interface (typical) Think: pins on a printer cable before USB!

13 12 Example protocol: Handshake RDY: sender says data is ready ACK: receiver acknowledges receipt

14 13 The Handshake Sender puts data on lines Sender asserts data readyReceiver acknowledges receiptSender stops asserting data ready Receiver acknowledges transmission over

15 14 Serial Interface (transmitter)

16 15 The Serializer The serializer takes the (8 bits of) input, and translates them to a single stream of data It tells the CPU (status and control register) when data transmission is complete It reads from the status & control register information about how to format the data, and what speed to send it

17 16 USB A bit different… Four wires –Two for data transmission –One for ground –One for voltage (+5V) Data sent in packets, addressed to destination Lower noise, fewer errors => faster data transfer than traditional serial and parallel ports

18 17 Firewire Like USB but better –Nearly twice as fast (USB2.0=480Mb/s; Firewire800=800Mb/s) –Allows longer cables (USB2.0 max 4.5m; Firewire 100m And also more expensive –Which is why, although Firewire has been around since 1995 (Apple created it), USB is more used For really fast connections (e.g. video) Firewire is best; for others, it doesn’t matter

19 18 Test Yourself! 1.Think of some peripherals. Do they use serial or parallel interfaces? 2.What is an I/O port? 3.How does handshaking work? 4.Can you draw a timing diagram for parallel interface handshaking? 5.What about the serial interface?


Download ppt "Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted."

Similar presentations


Ads by Google