Computer architecture · A level · OCR H446 1.1.3, AQA 7517 4.7.4.1, Eduqas A500QS 2.1 · about 25 min
How barcode readers, cameras, laser printers and RFID work; magnetic, optical and flash storage; RAM, ROM and virtual storage.
[1 mark]How does a passive RFID tag get the power to send its data?
[1 mark]Which part of a laser printer melts the toner onto the paper?
[1 mark]What does the controller in an SSD do?
[1 mark]Why does a hard disk take longer to access data than an SSD?
[1 mark]What is virtual storage?
[1 mark]Which storage is best for a small robot that vibrates as it moves?
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.
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.