CDA-4101 Lecture 6 Notes



Input/Output

  • Final topic under computer organization
  • We've talked about processing data and storing data
  • Now we discuss how the data gets in and out of the processor and memories.
  • short on details, but it is important to have a general idea of how these devices work

Buses

school-bus.gif bus1.gif magical-mystery.jpg

Controllers

  • I/O Device has the controller (special purpose processor) and the actual hardware component itself. Its jobs:
    • accessing the bus (dataa and control signals)
    • operate the hardware (service requests)
  • At the lowest level it needs to put bits on the wire and read bits from the wire (i.e., bus).
  • The controller is either:
    • on the device itself
    • a card plugged into the motherboard where device is plugged into the controller card
    • built into the motherboard

CPUs Role


DMA - direct memory access


Interrupts

  • the CPU wants to know when an I/o device is finished.
  • it should not have to wait for the I/O device to read the data since it is wasting a lot of CPU cycles
  • it also would be a waste to even periodically "poll" the device to see if it is done.
  • interrupts are implemented in hardware as a way to interrupt the processor to make it temporarily handle an event (e.g., I/O complete or data is ready)
  • IRQ settings in PC world

Interrupt Handlers


Bus Contention

  • as discussed, there are many devices sitting on the same bus
  • the bus can only carry one piece of data at a time
  • need to make sure devices do not conflict in their use of the bus
  • a bus arbiter is a chip that sits on the bus and acts as the judge about who gets to use the bus
  • I/O devices givcen preferrences since they are more timing dependent
  • the CPU can operate while the bus is being used by devices, but it it needs the bus it may waste cycles waiting for the I/O device to finish using it

Bus Evolution

IBM's PS/2 machine bus: book omits the reason clone makers didn't adopt the new bus.

Plethora of I/O Devices

Digital Cameras Keyboards
Mice Modems
Modems Printers
Punch Card Readers Scanners
Speakers Terminals
Joysticks Steering Wheels
Network Interface Cards (NICs) MIDI instruments/devices
Touch Screens Video Monitors
And many, many more...

Terminals

  • two parts:
    • something to input the data
    • something to show the data
  • input is typically a keyboard
  • output is typical some form of Monitor
  • When these are integrrated together an hooked to a computer it is usually called a terminal.
  • In the PC world, keyboard and monitor are separate (and mouse adds more input)
  • the terminal I used was a keyboard hooked up to a dot matrix printer for the output

Keyboards

  • Physical results of pressing a key:
    • complete the circuit of a swith (mechanical)
    • pass magnetic field through a coil (electromechanical)
  • Logical results of pressing a key
    • an interrupt is generated, specifically a keyboard interrupt
    • interrupt handler will read a register from the keyboard controller which indicates which key was pressed
    • multi-key sequences handled by interrupt handler

CRT Monitors

  • CRT = cathode ray tube (cathode is a source of electrons)
  • deflection plates are copper windings that create a magnetic field when current passes through them
  • electric fields bend in the presence of a magnetic field (physics)
  • putting more or les current through deflection plate windings alter the amount of deflection and "aims" the electron beam
  • inside surface is coated with a material that gives off visible light when hit with electrons
  • moving the beam left-to-right, top-to-bottom paints the screen
  • repeat many times each second and it looks like continuous motion

Flat Panel Displays

LCD (liquid crystal display)

  • a liquid material whose molecular orientation defines its reflective properties and whose molecules can be aligned by passing a current through it.
  • thus, an electrical signal can control whether the liquid is opaque or transparent (translucent?)
  • need polarized light and a whole mess of intricate electronics, wire meshes, etc to get three visible light colors
  • some details in book, many more on the web
Pros Cons
lighter more expensive
smaller lower refresh rates
Uses less power fewer colors/weirder colors

Terminal Types (Logical Arrangement)


Character Mapped Terminals

  • Information is passed in a simplified character-based protocol
  • One byte for the character attribute and one byte for the character itself.
  • attribute can be: color, underline, blinking, bold, etc.
  • typical 25x80 character screen then needs 25x80x2= 4,000 bytes
  • the video controller is responsible for fetching the characters and attributes from video memory and converting this to the right signals to send to the CRT
  • The font is decided by the video controller (it can be changed, but only on a global basis)

Bit-mapped Terminals

  • instead of organizing the screen as a matrix of characters, it is simple a matrix of dots, a.k.a. pixels
  • typical matrix sizes:
    • 640x480, 800x600, 1024x768,1280x960,1600x1200
    • aspect ratios 4:3 match television sizes
    • Recently: Viewsonic: 22.2 inch, 3840x2400 for $8K

Bit-mapped Terminals (cont.)


Video Memory Requirements


RS-232-C Terminals

  • standard defined to let terminals interoperate with any computer
  • defines the physical characteristics of the connector, cable, voltages and the meanings of each pin and voltage signal
  • since telephone lines predate the RS-232-C standard, and it was a desired way to connect to remote computers, a modem is used between the computer and terminal

Mice

  • The command line approach was fine for programmers and sophistictaed users, but as more novice users started to interface with computers a there was a need to present a more intuitive interface.
  • pointing at images and words would help, but need a way to point
  • mice technologies
    • mechanical
    • optical
    • optomechanical
  • when mouse moves some minimum distance a signal (interrupt) is sent to the computer about how far it moved, in what direction and which if any buttons were pressed

Printers


Issues in Printing

  • scanned image will have dots and intensity (e.g., gray-scale values)
  • b/w printer only has the presence of ink or the absence of ink for each dot.
  • need to simulate greys through halftoning

Color Printers

  • monitor colors are transmitted light (RGB: additive primary colors)
  • printer colors are reflective light
  • In theory, all colors can be constructed with Cyan, Yellow and Magenta (subtractive primary colors),
  • in reality, exact pigments and mixtures are not ideal, especially causes problems producing black.
  • most decent color printers will have the three primary subtractive colors and a separate dedicated black color (CMYK)
  • producing exact color is very tricky
  • no device can produce all the real-world colors
  • the set of RGB and CMYK colors are different
  • color printers come in ink-jet and laser printer versions as well as a few other technologies

Modems

  • phone lines have physical characteristics that make make the transmission of a two level signal impossible to achieve reliably (e.g., +0 volts and +5 volts)
  • phone lines do allow reliable transmission of a pure sine wave signal in the 1000 to 2000 Hz range.
  • Need a way to "encode" the 0's and 1' (two voltage levels) within this sine wave signal.
  • The pure sine wave is the base line and is the equivalent of no data or complete silence.

Sine Wave Encoding

  • Data is encoded by altering the sine wave, which there are three possible things to be altered:
    • frequency (pitch) e.g., FM Radio
    • amplitude (volume) e.g., AM Radio
    • phase
      • baud rate is the number of number of time intervals in which the phase can be shifted
      • can encode more than one bit of information per time interval by shifting wave different amounts to represent different values

Modems and POTS

  • The more wires we have the more data we can get through (parallel transmissions)
  • phone lines have only one wire for the data (two total), so we have to sequence the bits over the wire (serial transmission)
  • the modem is what converts the computer data into a phone line signal and what converts the phone signal into data.
  • transmission rates on phone lines are 28Kb/s to 57Kb/s (POTS line = plain old telephone service)
  • note that these transmission limits have more to do with the hardware on either ends of the wire trhan with the wire itself.
  • full duplex: data both ways at the same time (using different frequencies)
  • half duplex: only one way at a time
  • simplex: only one way

Faster Than a Speeding POTS Line

  • ISDN - integrated services digital network
  • DSL - digital subscriber line
  • ADSL - asymetric DSL, higher bandwidth downloads than uploads
  • CATV - using the cable TV companies existing coaxial (or satellite)

Note that there is still a modem device that converts the data to be carried along the wire.


Character Codes

  • Just like the transmission from a big-endian to little endian machine requires translation of some form, transmission of characters also have to worry about the same problem.
  • historically, ASCII became a standard that most used and this presented little problem.
  • the older schemes (e.g., EBCDIC) faded away
  • ASCII was extended from 128 chars to 256 chars called Latin-1

Unicode

  • However, ASCII is English-centric, but the world is not
  • Unicode is attempting to become the standard
  • each character is 16 bits, for 56K possible chars
  • used Latin-1 as first 256 to be backward compatible
  • there are more than 200K chars in all languages though, so some chars will not make it