1 / 18

Input/Output

Input/Output. 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). Devices. What are devices?. Obvious ones… Mouse Keyboard

kalani
Download Presentation

Input/Output

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 by the device it is sent to (output) • Computer interprets data received (input)

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

  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

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

  6. Peripherals These are the devices that actually do the physical input, output and data storage operations. Examples: keyboard printer mouse floppy disk VDU modem 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

  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

  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

  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)

  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)

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

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

  13. The Handshake Receiver acknowledges receipt Sender stops asserting data ready Receiver acknowledges transmission over Sender asserts data ready Sender puts data on lines

  14. Serial Interface (transmitter)

  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

  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

  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

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

More Related