A Level · Computer Science · Input, output and storage devices: notes and practice

Input, output and storage devices: notes and practice

Free PDF · 11 pages · 111 KB

Page 1 of Input, output and storage devices: notes and practice
Page 2 of Input, output and storage devices: notes and practice

Opens inside this page. Prefer your own PDF app? Open the PDF.

Check yourself

5 quick questions on A Level Computer Science

Tap an answer to see if you are right, and why. Free, no sign-up.

Start the free test

Full text of Input, output and storage devices: notes and practice

These revision notes cover the hardware part of Cambridge International AS & A Level Computer Science (9618), syllabus section 3.1, Computers and their components. You will learn how common input and output devices work, the types of primary memory (RAM and ROM), how magnetic, solid state and optical storage hold data, what an embedded system is, and how monitoring and control systems use sensors, actuators and feedback. Worked examples show how to choose a device for a scenario and justify the choice. The notes end with a list of examiner traps, a key terms table and 17 quick-check questions with answers.

Devices named in the 9618 syllabus list for "principal operation": laser printer, 3D printer, microphone, speakers, magnetic hard disk, solid state (flash) memory, optical disc reader/writer, touchscreen and virtual reality headset. Learn these first. Sections marked "Background" are not named in that list but are useful for scenario questions.

1. Input devices

An input device captures data from the outside world and changes it into a digital form the processor can use. Many inputs start as analogue signals, which change continuously, so an analogue-to-digital converter (ADC) is needed.

Keyboard

Background: not named in the 9618 syllabus list, but useful for scenario questions.

  • Under the keys is a grid (matrix) of circuits in rows and columns.
  • Pressing a key closes the circuit where one row crosses one column.
  • A microcontroller inside the keyboard scans the matrix, finds which row and column are connected, and looks up the matching character code in a key map.
  • The code is sent to the computer and held in a keyboard buffer until the processor reads it.

Optical mouse

Background: not named in the 9618 syllabus list, but useful for scenario questions.

  • An LED shines light onto the surface under the mouse.
  • Reflected light passes through a lens onto a small image sensor (usually CMOS), which takes hundreds or thousands of pictures of the surface each second.
  • A digital signal processor (DSP) compares each picture with the one before and works out how far the pattern has moved and in which direction.
  • The change in x and y is sent to the computer, which moves the pointer. Button clicks and scroll-wheel turns are sent as separate signals.

Scanner (flatbed)

Background: not named in the 9618 syllabus list, but useful for scenario questions.

  • The document is placed face down on a glass plate and the lid is closed.
  • A bright light moves slowly along the document under the glass.
  • Reflected light is directed by mirrors and a lens onto a charge-coupled device (CCD) or similar sensor.
  • The sensor turns the light level at each point into an electrical (analogue) signal; an ADC changes this into digital values.
  • The result is stored as a bitmap image. Optical character recognition (OCR) software can then turn images of text into editable text.

Microphone

  • Sound waves make a thin diaphragm vibrate.
  • In a dynamic microphone the diaphragm moves a coil inside a magnetic field, inducing a small varying current. (In a condenser microphone the vibration changes a capacitance instead.)
  • This analogue signal is sampled by an ADC at regular intervals to make digital sound data.

Touchscreens

FeatureResistiveCapacitive
ConstructionA flexible top layer and a rigid bottom layer (glass or rigid plastic), each with a conductive coating, separated by a tiny gap (spacer dots)Glass panel coated with a transparent conductor that holds an electrostatic field
How a touch is detectedPressure pushes the layers together; the point of contact changes the voltage, which is measured to calculate the positionA finger (which conducts) draws charge and changes the capacitance at that point; sensors at the edges or in a grid measure this and the controller calculates the position
Works with gloves or plastic stylus?Yes: any pressure worksNot with ordinary gloves or a plastic stylus; needs a conductive object
Multi-touch (pinch, zoom)Usually noYes
Image clarityLower: extra layers reduce lightHigher
DurabilityTop layer can be scratched or wornGlass surface is harder wearing, but may crack
CostCheaperMore expensive

Sensors

A sensor measures a physical quantity and sends a signal to a computer. Examples: temperature, light, pressure, humidity, infrared (movement), sound, gas, pH, proximity. Most sensors give an analogue output, so an ADC is used before the processor reads the value. Sensors are used in monitoring systems and in control systems (see section 5).

Learn this: A sensor does not make decisions. It only measures and sends data. The processor compares the reading with stored values and decides what to do.

2. Output devices

Inkjet printer

Background: not named in the 9618 syllabus list, but useful for scenario questions.

  • The print head moves from side to side across the paper on a belt driven by a stepper motor; a second motor moves the paper forward after each pass.
  • Tiny droplets of liquid ink are fired through nozzles onto the paper.
  • Thermal method: a heating element makes a vapour bubble which pushes a droplet out; when the bubble collapses, fresh ink is drawn in.
  • Piezoelectric method: a crystal changes shape when a voltage is applied, squeezing a droplet out.
  • Data waiting to be printed is held in the printer's buffer.

Laser printer

  1. A rotating drum is given an even static electric charge.
  2. A laser beam, steered by a rotating mirror, sweeps across the drum. Where it strikes, the charge is removed, leaving an electrostatic image of the page.
  3. Charged toner (fine powder) is attracted to the parts of the drum that match the image.
  4. The paper is given a charge opposite to that of the toner, which pulls the toner from the drum onto the paper.
  5. A fuser unit heats and presses the paper so the toner melts and sticks.
  6. The drum's remaining charge is removed and any leftover toner is cleaned off, ready for the next page.

The data for the whole page is stored in the printer's memory (buffer) before printing starts, so laser printers need enough memory to hold a full page. They are fast and cheap per page for large volumes of text.

3D printer

  • A 3D model is designed in CAD software, then slicing software divides it into thin horizontal layers.
  • The object is built layer by layer (additive manufacturing).
  • Common methods: a heated nozzle melts plastic filament and lays it down (fused deposition), or a UV light hardens liquid resin one layer at a time.
  • Uses: prototypes, spare parts, medical implants and prosthetics, custom models.

Speaker

  1. Digital sound data is changed to an analogue signal by a digital-to-analogue converter (DAC).
  2. The signal is amplified and passed through a coil of wire attached to a cone.
  3. The current makes the coil an electromagnet. Its changing magnetic field is attracted and repelled by the field of a permanent magnet, so the coil and cone move backwards and forwards.
  4. The cone vibrates the air, making sound waves.

Virtual reality (VR) headset

  • Two screens (or one screen split in two) show a slightly different image to each eye. The brain combines them, giving a stereoscopic 3D effect.
  • Lenses between the screens and the eyes focus and reshape each image so it fills a wide field of view.
  • Gyroscopes and accelerometers (and sometimes cameras for head, eye or hand tracking) detect how the user's head moves.
  • The processor uses these readings to update the images in real time, so the view moves as the head moves and the user feels inside the scene.
  • Headphones give 3D (spatial) sound, which adds to the immersive experience. Hand controllers may be used for input.

Actuators

An actuator is an output device that turns an electrical signal into physical movement or action, for example a motor, solenoid, valve, pump or relay. In a control system, the processor sends a signal (through a DAC if needed) to the actuator, for example to switch on a cooling fan in a server room.

LCD and LED screens

Background: not named in the 9618 syllabus list, but useful for scenario questions.

  • LCD: each pixel has red, green and blue sub-pixels containing liquid crystals. A voltage changes how the crystals twist, which controls how much polarised light passes through. LCDs do not make their own light, so they need a backlight.
  • Most modern LCD panels use LEDs as the backlight; these are often sold as "LED screens".
  • In an OLED (organic LED) screen, each pixel gives out its own light, so no backlight is needed. This allows thinner, flexible screens with true black and high contrast, and lower power use for dark images.

3. Primary memory: RAM and ROM

Primary memory is directly accessed by the processor. It holds the data and instructions currently in use.

RAM (random access memory): volatile memory that can be read from and written to; it holds the data and programs currently in use and loses its contents when the power is switched off.

ROM (read-only memory): non-volatile memory that is normally only read during use; it keeps its contents without power. Some types (EPROM, EEPROM) can be reprogrammed.

Static RAM (SRAM) and dynamic RAM (DRAM)

FeatureSRAMDRAM
How a bit is storedA flip-flop (several transistors)A single capacitor and a transistor
Needs refreshing?No: keeps data while poweredYes: capacitors leak charge, so every cell must be refreshed (recharged) regularly, typically every 64 ms
Access speedFasterSlower
Density (bits per chip)LowerHigher
Cost per bitHigherLower
Typical useCache memoryMain memory

Sources disagree about which type uses less power, because it depends on the chip and on whether it is busy or idle. In the exam, the safest comparison points are refresh, speed, density, cost and typical use.

Types of ROM

TypeCan it be changed?Typical use
ROM (mask ROM)No. Contents are set during manufactureLarge production runs of devices with fixed firmware
PROM (programmable ROM)Programmed once after manufacture using a special programmer; cannot then be changedSmall batches where code is final
EPROM (erasable PROM)Erased by shining ultraviolet light through a window on the chip, then reprogrammed. The chip usually has to be removedPrototypes and development
EEPROM (electrically erasable PROM)Erased and rewritten electrically while in the circuit, one byte (or block) at a timeFirmware that may need updates, such as BIOS/UEFI and settings in devices; flash memory is a type of EEPROM

Uses of ROM: storing the bootstrap loader (start-up program), firmware in embedded systems, and fixed settings that must survive a power loss.

4. Secondary storage

Secondary storage is non-volatile and is not directly accessed by the processor. Programs and data are loaded from it into RAM when needed.

Magnetic hard disk drive (HDD)

  • Data is stored on one or more rigid platters coated with a magnetisable material. The platters spin at high speed (for example 5400 or 7200 revolutions per minute).
  • Each surface is divided into circular tracks, and each track into sectors.
  • A read/write head on an actuator arm floats just above each surface. To write, the head changes the direction of magnetisation of tiny areas; the two directions represent 0 and 1. To read, the head detects these directions.
  • Before data can be read, the arm must move to the right track (seek time) and the right sector must spin under the head (rotational latency). This is why an HDD is slower than solid state storage, especially for data spread across the disk (fragmented files).

Solid state storage (flash memory)

  • Used in SSDs, USB flash drives and memory cards. It has no moving parts.
  • Data is stored in NAND flash cells. Each cell is a transistor with a floating gate (or charge trap) that can hold electrons, insulated so the charge stays without power.
  • A cell with trapped charge and one without represent different binary values. Modern cells can store more than one bit by holding different levels of charge.
  • Data is written in pages but erased in larger blocks. A controller spreads writes evenly across cells (wear levelling), because each cell survives only a limited number of write/erase cycles.

Optical discs (CD, DVD, Blu-ray)

  • Data is stored along a single spiral track running from the centre outward.
  • On a pressed disc the track contains pits (dips) and lands (flat areas).
  • A laser shines on the spinning disc. Light reflects differently from pits and lands; a sensor detects the changes in reflected light, which are decoded as binary data.
  • Recordable discs (-R) use a dye layer that the laser changes permanently. Rewritable discs (-RW) use a layer that the laser switches between two states, so it can be rewritten.
  • Blu-ray uses a shorter-wavelength blue-violet laser than DVD (red) or CD (infrared), so pits can be smaller and closer together, giving a higher capacity.

Comparing storage types

FactorMagnetic (HDD)Solid state (SSD/flash)Optical
Typical capacityVery high (several TB)High (hundreds of GB to several TB)Low: CD about 700 MB, DVD 4.7 GB (single layer), Blu-ray 25 GB per layer
Access speedMediumFastestSlowest
Cost per GBLowest for large capacitiesHigher than HDDLow per disc, but high per GB for large backups
DurabilityMoving parts; can be damaged by knocks, especially while runningNo moving parts; resists shock; limited write cyclesEasily scratched; no damage from magnets
PortabilityHeavier and bulkierSmall and lightThin and light, but needs a drive to read
Power useHigher (motor)LowNeeds a drive motor and laser
Exam tip: In "identify and justify" questions, the device usually earns 1 mark and each justification earns 1 mark, up to the maximum. Each justification must be linked to the scenario. One linked point is enough for one mark; you do not need two points in the same sentence. Worked example 1: choosing storage

A geologist uses a laptop outdoors on rough ground and in a vehicle. She wants the laptop to start quickly and the battery to last. Identify a suitable type of internal storage and justify your choice. [3]

Step 1: pick out the needs. Rough use → must survive knocks. Quick start → fast access. Long battery → low power.
Step 2: match to a device. Solid state (SSD) meets all three.
Step 3: justify, linking each feature to the scenario.
1 mark: solid state drive (SSD) [1].
Max 2 from:
• no moving parts, so it is less likely to be damaged when the laptop is knocked or moved in a vehicle [1]
• faster access times, so the operating system loads and the laptop starts quickly [1]
• lower power use (no motor), so the battery lasts longer [1] Worked example 2: capacity calculation

A school wants to archive 30 GB of exam photographs on single-layer DVDs (4.7 GB each). Calculate the minimum number of DVDs needed. [2]

Step 1: Divide the total data by the capacity of one disc: 30 ÷ 4.7 = 6.38 (to 2 d.p.).
Step 2: A part-disc still needs a whole disc, so round up.
30 ÷ 4.7 = 6.38… [1], so 7 DVDs are needed [1].
Check: 6 discs hold 6 × 4.7 = 28.2 GB, which is less than 30 GB; 7 discs hold 32.9 GB, which is enough. Worked example 3: choosing a touchscreen

A food factory needs a touchscreen control panel for workers who wear thick protective gloves. The panel will be splashed with water and flour. Identify the most suitable touchscreen technology and justify it. [3]
1 mark: resistive touchscreen [1].
Max 2 from:
• it detects pressure, not electrical conductivity, so it works when workers wear gloves [1]
• it does not rely on changes in an electrostatic field, so water splashes are less likely to register false touches [1]
• it is cheaper, so it costs less to replace if damaged in the factory [1]

5. Embedded systems, monitoring and control

Embedded system: a computer system with a dedicated function, built into a larger mechanical or electrical system.
  • Usually based on a microcontroller: a processor, RAM, ROM/flash and input/output ports on one chip.
  • The control program (firmware) is stored in ROM or flash memory, so it runs as soon as power is applied.
  • Typically takes input from sensors or buttons and drives actuators or a small display.
  • Examples: washing machine, microwave oven, car engine management, traffic lights, digital thermostat, fitness tracker.
BenefitsDrawbacks
Small, cheap to mass-produce, low power useHard or impossible to upgrade the hardware
Reliable: designed for one taskFirmware updates may be difficult; the whole device may be thrown away if it fails
Can run with little or no user inputDevices connected to the internet can be targets for hackers

Monitoring and control systems

Monitoring vs control systems

Monitoring system: sensors take readings; the processor compares them with stored values and records, displays or gives a warning. It does not change the environment. Example: a hospital patient monitor reads heart rate and blood oxygen and sounds an alarm if a reading is outside safe limits, but it does not treat the patient.

Control system: sensors take readings, the processor compares them with stored values, and it sends signals to actuators that change the conditions. Examples: central heating, a server room cooling system.

Feedback: in a control system, the output affects the next sensor reading. This loop keeps conditions within the set range.

Worked example of feedback (central heating set to 21 °C):
1. The sensor reads 19 °C. The processor compares this with 21 °C: too cold.
2. The processor switches on the boiler/heater (actuator).
3. The room warms up. The next reading is 21.5 °C, so the processor switches the heater off.
4. The room slowly cools; when the reading falls below 21 °C again, the heater is switched back on. The loop repeats all the time. Examiner traps
  • "The sensor decides what to do" → the sensor only measures; the processor compares the reading and decides.
  • "The laser burns the image onto the paper" → the laser removes charge from the drum; the fuser's heat and pressure fix the toner.
  • "An SSD stores data magnetically" → flash stores data as electric charge trapped in floating-gate transistors.
  • "ROM stores the operating system" → ROM stores the bootstrap loader and firmware; the operating system is on secondary storage and is loaded into RAM.
  • "An ADC converts the data" → say it converts an analogue signal into digital data.
  • "It is bigger / faster" with no context → link each feature to the scenario, for example "faster access, so the laptop starts quickly".

Key terms

TermDefinition
ADCConverts an analogue signal into digital data
DACConverts digital data into an analogue signal
ActuatorAn output device that produces physical movement from an electrical signal
SensorAn input device that measures a physical quantity
BufferTemporary memory that holds data being passed between devices working at different speeds
VolatileLoses its contents when power is removed
SRAMRAM using flip-flops; no refresh needed; fast; used for cache
DRAMRAM using capacitors; must be refreshed; cheaper and denser; used for main memory
EEPROMROM that can be erased and reprogrammed electrically in the circuit
FirmwareSoftware stored in ROM or flash that controls a device's hardware
Wear levellingSpreading writes evenly across flash cells to extend their life
Pits and landsDips and flat areas on an optical disc track that reflect laser light differently
StereoscopicShowing a slightly different image to each eye to give a 3D effect, as in a VR headset
Embedded systemA computer system with a dedicated function inside a larger device
Monitoring systemUses sensors to record or display readings and give warnings, without changing the environment
Control systemUses sensors and actuators to keep conditions within set limits
FeedbackWhen the output of a control system affects its next input, so conditions stay in range

Quick check

  1. State two differences between RAM and ROM. [2]
  2. Identify the type of RAM used for cache memory and give one reason why. [2]
  3. Give one difference between EPROM and EEPROM. [1]
  4. Explain why a microphone needs an ADC before its data can be stored. [2]
  5. Explain why a capacitive touchscreen may not work when the user wears gloves. [2]
  6. Describe how an optical mouse detects movement. [3]
  7. Describe how data is read from a magnetic hard disk. [3]
  8. Describe how data is stored in solid state (flash) memory. [3]
  9. Explain why a Blu-ray disc can store more data than a DVD. [2]
  10. Describe how a speaker produces sound from digital data. [4]
  11. Describe the steps a laser printer takes to print a page. [5]
  12. Describe how a 3D printer produces an object. [3]
  13. Describe how a VR headset gives the user an immersive 3D experience. [3]
  14. State two drawbacks of embedded systems. [2]
  15. Explain the difference between a monitoring system and a control system. [2]
  16. A photographer needs to back up 2 TB of images each month as cheaply as possible and keep the backup in a drawer. Identify a suitable storage device and justify your choice. [3]
  17. A reptile vivarium uses an embedded system to keep the temperature between 26 °C and 32 °C. Explain how sensors, the microcontroller and actuators work together. [4]

1. One mark per difference, max 2: RAM is volatile, ROM is non-volatile [1]; RAM can be read and written, ROM is (normally) read only [1]; RAM holds programs and data in current use, ROM holds fixed start-up instructions or firmware [1].

2. SRAM [1]; it has faster access speed / does not need refreshing, so the processor waits less [1].

3. Any one: EPROM is erased with ultraviolet light, EEPROM is erased electrically [1]; EPROM usually has to be removed from the circuit to be erased, EEPROM can be rewritten while in the circuit [1]; EPROM is erased all at once, EEPROM can be erased one byte (or block) at a time [1]. Max 1.

4. The microphone produces an analogue (continuously varying) signal [1]; a computer can only store and process digital (binary) data, so the signal must be sampled and converted [1].

5. A capacitive screen detects a touch by a change in capacitance (in its electrostatic field), which needs a conductive object such as a bare finger [1]; ordinary gloves are insulators, so no charge is drawn and the touch is not detected [1].

6. An LED lights the surface under the mouse [1]; a sensor takes many images of the surface every second [1]; a processor (DSP) compares consecutive images to calculate the direction and distance moved [1].

7. The platters spin at high speed [1]; the actuator arm moves the read/write head to the correct track [1]; when the required sector passes under it, the head detects the direction of magnetisation of each area, which represents 0 or 1 [1].

8. Max 3 from: data is stored in NAND flash cells, each a transistor with a floating gate [1]; a voltage traps electrons in the floating gate, and insulation keeps them there without power [1]; whether a cell holds charge (or the level of charge) represents 0 or 1 [1]; data is written in pages and erased in blocks [1].

9. Blu-ray uses a laser with a shorter wavelength [1], so the pits and track can be smaller and closer together, fitting more data on the same area [1].

10. A DAC converts the digital data to an analogue signal [1]; the signal is amplified and sent through a coil [1]; the current makes the coil an electromagnet, which is attracted and repelled by a permanent magnet, so the coil and cone move backwards and forwards [1]; the cone vibrates the air, creating sound waves [1].

11. One mark per step, max 5: drum is given an even static charge [1]; laser (steered by a mirror) removes charge where the page image is, forming an electrostatic image [1]; charged toner is attracted to the image areas on the drum [1]; paper is given a charge opposite to the toner, so toner is pulled onto it [1]; fuser heats and presses the toner so it bonds to the paper [1]; drum is discharged and cleaned ready for the next page [1].

12. Max 3 from: the object is designed as a 3D model in CAD software [1]; slicing software divides the model into thin layers [1]; the object is built layer by layer, each layer added on top of the one before [1]; for example, a heated nozzle melts plastic filament and lays it down, or UV light hardens liquid resin [1].

13. Max 3 from: two screens (or a split screen) show a slightly different image to each eye, giving a stereoscopic 3D effect [1]; lenses focus the images to fill a wide field of view [1]; gyroscopes/accelerometers detect head movement [1]; the image is updated in real time to match the head movement [1]; headphones give 3D (spatial) sound [1].

14. Any two: hard or impossible to upgrade the hardware [1]; firmware updates may be difficult [1]; the whole device may have to be thrown away if it fails [1]; devices connected to the internet can be targets for hackers [1]. Max 2.

15. A monitoring system uses sensors to record, display or warn about readings but does not change the environment [1]; a control system also uses actuators to change the conditions based on the readings (using feedback) [1].

16. 1 mark: an external magnetic hard disk drive [1].
Max 2 from: very high capacity, so the whole 2 TB backup fits on one device [1]; lowest cost per GB, so monthly backups stay cheap [1]; it is kept still in a drawer and not moved while running, so its moving parts are unlikely to be damaged [1].
(Optical discs are not suitable: 2 TB = 2000 GB, so 2000 ÷ 25 = 80 single-layer Blu-ray discs would be needed every month.)

17. Temperature sensors measure the temperature and send readings (through an ADC) to the microcontroller [1]. The microcontroller compares each reading with the stored limits of 26 °C and 32 °C [1]. If the temperature is below 26 °C it sends a signal to switch on a heat lamp; if above 32 °C it switches off the heat lamp and/or switches on a fan (actuators) [1]. The process repeats continuously, so it is a feedback loop: the output affects the next input [1].