Input, output and the keyboard, mouse and monitor
Input devices turn physical actions into electrical signals the computer can process. A keyboard turns key presses into codes. A mouse turns movement and button clicks into position changes and click signals.
Output devices do the reverse. A monitor turns digital image data into light on a screen. Speakers and printers are other common output devices.
How a key press or a mouse movement becomes data
Each key on a keyboard sits in a grid of circuits. A small controller inside the keyboard detects which crossing point has been connected and sends a scan code to the computer. The operating system then maps that code to a character or action, depending on the keyboard layout.
Most modern mice use an optical sensor. The sensor takes many small images of the surface each second and compares them to work out how far the mouse has moved. The mouse reports these movements to the computer, which moves the pointer on screen.
The computer receives these signals through a port or a wireless link, such as USB or Bluetooth. A driver, which is software that lets the operating system talk to a device, interprets the signals.
Worked example: key press to letter
Suppose a user presses the key for the letter A. The keyboard controller sends a scan code to the computer. The operating system reads the code and, with a standard layout, decides the character is A.
The program in use stores the letter and asks the graphics system to redraw the screen. The monitor then shows the new picture. A screen with 1920 by 1080 pixels has 1920 x 1080 = 2,073,600 pixels. Each pixel is set to a colour, and the letter A is just a small group of those pixels changed.
At a refresh rate of 60 hertz, the monitor redraws the image 60 times per second. Each redraw takes about 1 / 60 = 0.017 seconds, or roughly 17 milliseconds.
Common misconceptions
Some people think a device is either input or output. Many devices do both. A touchscreen takes touch as input and shows images as output. A network card and a storage drive also send and receive data.
Another belief is that the monitor does the computing. The monitor only displays the image it is sent. The processing happens in the CPU and graphics hardware, which are separate components.
Where input and output devices show up
Desktop computers use a separate keyboard, mouse and monitor. Laptops and tablets build the same functions into one body, using a trackpad, a built-in screen and often a touchscreen.
Other examples are microphones, cameras and scanners for input, and speakers, projectors and printers for output. Industrial machines, point-of-sale tills and game consoles use the same idea with specialised controls.
Key terms
- Input device
- Hardware that sends data or commands into a computer.
- Output device
- Hardware that presents results from a computer to a user.
- Driver
- Software that lets the operating system communicate with a hardware device.
- Scan code
- A code a keyboard sends to identify which key was pressed or released.
- Pixel
- The smallest controllable point of colour on a display.
- Refresh rate
- The number of times per second a display redraws its image, measured in hertz.
