The worksheetDownload the PDF
Answers

A9.9 Input, output and storage

Computer architecture · A level · OCR H446 1.1.3, AQA 7517 4.7.4.1, Eduqas A500QS 2.1 · about 25 min

BugBotLab

What this lesson is about

How barcode readers, cameras, laser printers and RFID work; magnetic, optical and flash storage; RAM, ROM and virtual storage.

Questions 6 marks in all

  1. [1 mark]How does a passive RFID tag get the power to send its data?

    1. AThe reader's radio waves induce a current in the tag's antenna
    2. BFrom a small battery in the tag
    3. CFrom light falling on it
    4. DIt does not send data; the reader photographs it
    Answer: A. Passive tags have no battery, which is why they are cheap but short range.
  2. [1 mark]Which part of a laser printer melts the toner onto the paper?

    1. AThe fuser
    2. BThe drum
    3. CThe laser
    4. DThe toner cartridge
    Answer: A. Heat and pressure from the fuser fix the toner permanently.
  3. [1 mark]What does the controller in an SSD do?

    1. AManages where data is stored in the NAND flash, including wear levelling and erasing blocks
    2. BSpins the platters
    3. CMoves the read/write head
    4. DConverts light into data
    Answer: A. An SSD is NAND flash plus a controller that hides its limits.
  4. [1 mark]Why does a hard disk take longer to access data than an SSD?

    1. AThe head must move to the track and wait for the sector to rotate under it
    2. BHard disks store less data
    3. CMagnetic data must be decompressed first
    4. DHard disks read data with a laser
    Answer: A. Seek time and rotational latency are mechanical delays an SSD does not have.
  5. [1 mark]What is virtual storage?

    1. APhysical storage from several devices presented as if it were one storage device
    2. BUsing part of the hard disk as extra RAM
    3. CStorage inside the processor
    4. DRead only memory
    Answer: A. Cloud storage is an example; virtual memory is a different idea.
  6. [1 mark]Which storage is best for a small robot that vibrates as it moves?

    1. AFlash memory
    2. BA hard disk drive
    3. CA DVD
    4. DMagnetic tape
    Answer: A. Flash has no moving parts to be damaged by vibration, and it is small and low power.

The task: how much flash does a camera need?

Use the robot's camera to work out storage needs. Take one frame with camera_image(32, 24), which returns a list of rows, each row a list of pixels, and each pixel a tuple of three bytes (red, green, blue). - Count the pixels from the image you took, by measuring the lists, and print pixels: 768. - Work out how many bytes one frame needs, uncompressed, at 3 bytes a pixel, and print bytes per frame: 2304. - Work out how many whole frames fit in a 16 MiB flash chip (1 MiB is 1,048,576 bytes), and print frames in 16 MiB: 7281. - The camera itself sees 320 by 240 pixels. Print how many whole frames of that size fit in the same flash, as full-size frames in 16 MiB: 72. Do not type the answers in as numbers. The robot does not move.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

image = camera_image(32, 24)

The hint students can ask for: An image is a list of rows, so the number of rows and the length of a row give the pixel count. Bytes per frame follows from bytes per pixel. For the flash, find the capacity in bytes first, then ask how many whole frames fit, throwing away any part frame.

A solution

from bugbot import *
connect()
image = camera_image(32, 24)
pixels = len(image) * len(image[0])
print(f"pixels: {pixels}")
frame_bytes = pixels * 3
print(f"bytes per frame: {frame_bytes}")
flash = 16 * 1024 * 1024
print(f"frames in 16 MiB: {flash // frame_bytes}")
print(f"full-size frames in 16 MiB: {flash // (320 * 240 * 3)}")

Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.