The answersDownload the PDF
Worksheet

F9.6 Memory

Logic and computer systems · GCSE · OCR J277 1.2.1, AQA 8525 3.4.5, Edexcel 1CP2 3.1.1 · about 15 min

BugBotLab
NameClassDate

What this lesson is about

RAM, ROM, cache and virtual memory.

Questions 5 marks in all

  1. [1 mark]What does volatile mean?

    1. AThe contents are lost when the power is off
    2. BIt can only be read
    3. CIt is very fast
    4. DIt is stored on a disk
  2. [1 mark]What is ROM used for?

    1. AHolding the boot program that starts the computer
    2. BHolding the programs currently running
    3. CStoring a user's files
    4. DSpeeding up the CPU with copies of data
  3. [1 mark]What is virtual memory?

    1. APart of secondary storage used as extra RAM when RAM is full
    2. BMemory inside the CPU
    3. CRAM that keeps its contents without power
    4. DMemory on another computer
  4. [1 mark]Why does a computer slow down when it uses virtual memory a lot?

    1. ASecondary storage is much slower than RAM
    2. BVirtual memory uses more power
    3. CThe CPU stops while it is used
    4. DVirtual memory is smaller than RAM
  5. [1 mark]Put these in order from fastest to slowest.

    Number the lines 1 to 4 to put them in the right order.

    1. Registers
    2. Cache
    3. Secondary storage
    4. RAM

The task: out of RAM

A computer has 4 GB of RAM, and the operating system always uses 1 GB. The apps in apps are opened in order. For each one, while it does not fit, move the app that has been in RAM longest to virtual memory and print moved <name> to virtual memory. Then load it and print <name> -> RAM. At the end, print RAM used: <n> GB and in virtual memory: <names>, the names joined with , .

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

ram_size = 4
os_size = 1
apps = [("browser", 1.5), ("game", 2.0), ("music", 0.5), ("editor", 1.0)]

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f9-6-memory/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Change ram_size to 8. How many moves to virtual memory are there now?
  2. Reopen the browser at the end. What has to move out for it to come back?
  3. Why does a robot's boot program live in ROM rather than RAM?