1/1/ / faculty of Electrical Engineering eindhoven university of technology Input/Output devices Part 1: Parallel, serial, disk and tape controllers dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital Information Systems
1/1/ / faculty of Electrical Engineering eindhoven university of technology What will we talk about ? A subset of available input/output controllers –Basic and extended parallel I/O –Different types of serial I/O, including LANs –Disk controllers –Display controllers of different complexity –Programmable I/O controllers More is available, but only mentioned here –Analog digital conversion –Data compression/expansion, encryption/decryption –Motor controllers
1/1/ / faculty of Electrical Engineering eindhoven university of technology Parallel I/O: more bits at the same time In principle faster than 1 bit at a time serial I/O Needs multiple physically separate signal paths –Cabling and send/receive electronics are expensive ! Use low(er) cost simple electronics and cables –Parallel I/O is generally only used for short distances Actual speed not much higher than serial I/O !
1/1/ / faculty of Electrical Engineering eindhoven university of technology Parallel I/O synchronisation Different sets of 'handshake' signals in use busy strobe data busy strobe data valid DEVICEPROC acknowledge data available data 'dav' 'ack' data valid Device initiates transfer by indicating 'not busy' Processor initiates transfer by indicating 'data available' DEVICEPROC request acknowl. req ack Device initiates transfer by indicating request' For input handshake: PROC DEVICE
1/1/ / faculty of Electrical Engineering eindhoven university of technology Bidirectional parallel input/output Extra rules needed to prevent problems –'Never output data while the ack output is active' Higher level protocol needed to switch direction ack out dav out dataack in dav in DEVICEPROC dav out ack out data dav in ack in valid outvalid in
1/1/ / faculty of Electrical Engineering eindhoven university of technology power supplyfrequency metercomputer Multi-directional parallel I/O buses (1) 'General Purpose Interface Bus' for laboratories –Devices function as 'talkers', 'listeners' and 'controllers' –Very complex bus protocol (> 1 controller allowed) –Max. distance 20 metres, up to 500 KiloBytes/second 20 MHz 'device under test' on/off/voltage readings GPIB
1/1/ / faculty of Electrical Engineering eindhoven university of technology Multi-directional parallel I/O buses (2) The 'Small Computer Systems Interface' (SCSI) –A (byte-parallel) connection between computers and tape/disk storage devices, scanners, printers... –Up to 8 devices can be controlled at the same time –Speed > 1.5 MegaByte/second, distance < 10 metres 'SCSI' is of a family of 'standard' interfaces For all kinds of parallel input/output interfaces, specialised interface components exist !
1/1/ / faculty of Electrical Engineering eindhoven university of technology Serial I/O: one bit at a time Handshake signals merged with actual data bits –Number of physical connections reduced to minimum High quality cable and send/receive electronics –Greater distances can be handled (even worldwide) –High bit rates possible (fiber: > 1 GigaBits/second !) Parallel I/O signal timing skew problem eliminated Multi-directional communication possible –A 'Local Area Network' is a complex serial I/O protocol
1/1/ / faculty of Electrical Engineering eindhoven university of technology Problems to solve for serial I/O 1)Where are the boundaries between the bits ? –We need to know where the real data bits start and end in order to communicate 2)Where are the boundaries between the words ? –Processors are generally word-oriented and must know which bits belong to the same word 3)Which words belong together ? –This information is vital if several communicating partners make use of the same channel (LANs !)
1/1/ / faculty of Electrical Engineering eindhoven university of technology Asynchronous serial I/O Each word is sent separately The start transition is not synchronised: 'asynchronous' Bit positions determined by fixed time delays The transmitters time t must be known by the receiver! bit 0bit 1bit 2bit 6bit 7 start bit' t stop bit(s) 2t line signal 2t N x 2t data bits
1/1/ / faculty of Electrical Engineering eindhoven university of technology Remarks on asynchronous serial I/O In its basic form very simple to implement standard on most single-chip micro-computers Error detection can be provided by transmitting a 'parity' bit (XOR of data bits) after last data bit No protocols for grouping words or handshaking –Some ASCII control codes (mis)used for these 'DC1'/'DC3' and 'ACK'/'NAK' for flow control 'STX'/'ETX' for grouping (start of text / end of text) XON/XOFF
1/1/ / faculty of Electrical Engineering eindhoven university of technology Synchronous serial I/O: more efficient Bit boundary detection synchronises on each line transition, two tricks ensure enough transitions –'Non Return to Zero Invert': a '1' bit keeps the line state stable, a '0' bit lets the line make a transition –Bit stuffing': after 5 consecutive '1' bits, the transmitter inserts a '0' bit (which is removed again by the receiver) Data words are always grouped in 'frames' –Frames start and end with a 'flag': the fixed bit pattern ' (cannot be data through the bit stuffing !) NO start and stop bits needed !
1/1/ / faculty of Electrical Engineering eindhoven university of technology Synchronous serial I/O protocol family The presence of frames makes the synchronous serial I/O protocol very powerful 'HDLC', 'SDLC' and 'X-25' are family members –First bytes of a frame contain address and control info –A 'Cyclic Redundancy Check is used to detect errors Remainder of dividing frame contents by a fixed value Basic synchronous serial I/O is rather simple to implement, but a complete protocol is very complex !
1/1/ / faculty of Electrical Engineering eindhoven university of technology Disk and tape controllers Data is stored as sequential streams of bits: a specialised form of serial I/O –Controllers also need logic to position the read/write heads and control disk/tape movement Magnetic/optical media do not allow continuous streams of '0' or '1' bits to be stored directly –Encoding must be used to ensure enough transitions –'Bit stuffing' is impossible because it removes the direct relation between the number of bits stored and written !
1/1/ / faculty of Electrical Engineering eindhoven university of technology Disk/tape data modulation (1) Frequency Modulation makes a transition at each bit cell boundary and halfway a '1' bit Modified Frequency Modulation transitions halfway a '1' bit and between two '0' bits –This modulation method has problems with repeated '110' patterns... MFM: FM: '1''0' '1' '0' 'cell'
1/1/ / faculty of Electrical Engineering eindhoven university of technology Disk/tape data modulation (2) Run Length Limited encodes groups of 4 bits in 5 cells with transitions only at cell boundaries –The length of a 'run' of consecutive '0' or '1' cells is limited by the chosen encoding All modulation techniques try to use as few transitions as possible for each bit –Limit the frequency bandwidth and lower the highest frequency in the signal this simplifies the analog parts of the system!
1/1/ / faculty of Electrical Engineering eindhoven university of technology Disk and tape data formats Data is stored in fixed-size data fields, each preceeded by a separate control field crc 'index mark' 'data mark' position info: head/track/sector or track/block position info: head/track/sector or track/block actual data block: 256, 512, bytes actual data block: 256, 512, bytes CRC or 'Error Correcting Code' written during 'format'rewritten on each data block write –The 'marks' are a kind of start of frame flags –Position info is checked before actual writing is done !
1/1/ / faculty of Electrical Engineering eindhoven university of technology Floppy and hard disk controllers These are standard (off the shelf) items –Tape drives use disk-like formats and interfaces ! They differ in how they handle multiple drives –Read/write one drive while 'seeking' on others ? They differ in their DMA capabilities –One block to several tracks with a single command –Separate commands to command list driven Complex ones are complete disk/tape coprocessors!