Syllabus coverage
- Understand what is meant by primary storage, including the role of random access memory (RAM) and read only memory (ROM) and why a computer needs both
- Understand what is meant by secondary storage, and why it is necessary for more permanent storage of data
- Describe the operation of magnetic storage, including platters divided into tracks and sectors and the use of electromagnets, with the hard disk drive as an example
- Describe the operation of optical storage, including the use of lasers to create and read pits and lands, with CD, DVD and Blu-ray as examples
- Describe the operation of solid-state (flash memory) storage, including NAND and NOR technology and the use of control gates and floating gates, with SSD, SD card and USB drive as examples
- Describe what is meant by virtual memory, how it is created and used, and why it is necessary
- Understand what is meant by cloud storage and explain the advantages and disadvantages of storing data on the cloud in comparison to storing it locally
Part of the O Level Computer Science syllabus 2210.
Primary storage: what it is and why the CPU needs it
Primary storage is the memory that the CPU can access directly. It is on the motherboard, it is close to the processor, and it holds the instructions and data that are in use at that moment. Because the CPU reads from and writes to it constantly, it has to be very fast, and because fast memory is expensive it is also comparatively small.
Primary storage is volatile in the case of RAM: its contents are lost when the power is switched off. That is not a fault, it is the design. RAM is a working area, and the permanent copy of everything lives in secondary storage. The two work as a pair: a program is loaded from secondary storage into RAM, runs from RAM, and its results are saved back to secondary storage.
The syllabus names two types of primary storage, RAM and ROM, and a computer needs both because they do different jobs. RAM holds the programs and data currently in use and can be read from and written to; ROM holds the start-up instructions and can only be read.
RAM and ROM: the difference
Random access memory (RAM) is the main working memory. It is volatile, so its contents are lost when the power goes off, and it is read/write, so the processor can change what is stored there. Programs and the data they are working on are copied into RAM from secondary storage before they can run, and the operating system itself runs from RAM. More RAM allows more programs to be open at once, and larger documents to be handled, without the computer having to swap data out to disk.
'Random access' means that any location can be reached directly in the same amount of time, rather than having to work through the memory in order. That is what makes RAM suitable as working memory: the CPU can jump to any address it needs.
Read only memory (ROM) is non-volatile, so it keeps its contents when the power is off, and it is read only, so its contents cannot normally be changed. It holds the bootstrap loader (the start-up instructions) and the basic input/output system, the code that tests the hardware and loads the operating system when the computer is switched on. The computer needs ROM because at the moment of switching on there is nothing in RAM: something fixed has to tell the processor where to find the operating system, and that something cannot be allowed to be erased by a power cut.
| Feature | RAM | ROM |
|---|---|---|
| Volatility | Volatile: contents are lost when the power is switched off | Non-volatile: contents are kept when the power is switched off |
| Read or write | Read and write: the processor can change the contents | Read only: the contents cannot normally be changed |
| What it holds | The programs and data currently in use, including the operating system | The bootstrap loader and start-up routines that load the operating system |
| Effect of more of it | More programs can be open and larger documents handled at once | Not applicable: ROM is fixed and small |
| Why the computer needs it | To hold the instructions and data being processed, because the CPU can access it directly and quickly | To hold the start-up instructions that cannot be lost when the power is off |
Secondary storage: what it is and why it is needed
Secondary storage is storage that the CPU cannot access directly. Its contents have to be copied into primary storage before the processor can use them. It is non-volatile, so it keeps data permanently without power, and it is much cheaper per unit of capacity than RAM, which is why a computer has far more of it.
It is necessary for more permanent storage of data. RAM is emptied when the computer is switched off, so the operating system, the applications and every file the user creates have to be kept somewhere that survives. Secondary storage also holds far more than primary storage, so it is where the photographs, videos and documents that would never fit in RAM live.
The three types the syllabus requires are magnetic, optical and solid-state (flash). They differ in how they record a 1 and a 0, and that difference explains their speed, capacity, durability and cost.
Magnetic storage: hard disk drives
Magnetic storage records data by magnetising a surface. A hard disk drive (HDD) contains one or more rigid platters coated in a magnetic material, mounted on a spindle and spun at high speed. Each platter surface has a read/write head on a moving arm that floats a tiny distance above it.
The surface of each platter is divided into tracks, which are concentric circles, and each track is divided into sectors. A sector is the smallest unit that can be written or read, and the address of a piece of data is given by its platter surface, track and sector. Because the head can move to any track and the platter spins to any sector, the drive can reach data without reading everything before it.
Data is read and written using electromagnets. To write, a current is passed through the head, which produces a magnetic field that magnetises the spot on the platter beneath it in one direction or the other, and the two directions represent 1 and 0. To read, the head passes over the magnetised spots and the changing magnetic field induces a small current in it, which is detected and converted back into binary.
A hard disk drive offers a very large capacity at a low cost per gigabyte, which makes it suitable for archives, backups and bulk storage. Its weakness is that it has moving parts: it is slower than solid-state storage because the head has to move and the platter has to rotate, it is noisy, it uses more power, and it can be damaged by a shock while it is running.
| Part | What it is |
|---|---|
| Platter | A rigid disc coated in magnetic material, mounted on a spindle and spun at high speed |
| Track | A concentric circle on the surface of a platter |
| Sector | A subdivision of a track; the smallest unit that can be read or written |
| Read/write head | An electromagnet on a moving arm that magnetises the surface to write and detects the field to read |
Optical storage: CDs, DVDs and Blu-ray discs
Optical storage records data as pits and lands on a reflective surface, and reads it with a laser. A pit is a small depression pressed or burned into the surface; a land is the flat area between pits. The boundary between a pit and a land is what carries the data, because the change in depth changes how the light is reflected.
To write, a laser is focused onto a dye layer or a phase-change layer and heats it, changing its state at that point so that it forms a pit or leaves a land. To read, a laser of lower power is shone at the surface and the reflected light is measured by a sensor. Light reflected from a land comes back strongly; light reflected from a pit is partly cancelled by interference. The pattern of strong and weak reflections is converted into binary.
The three examples differ mainly in the wavelength of the laser and therefore in the size of the pits, which sets how much data fits on a disc of the same size. A CD uses an infra-red laser and holds about 700 MiB; a DVD uses a red laser with smaller pits and holds about 4.7 GiB per layer; a Blu-ray disc uses a blue laser with smaller pits still and holds about 25 GiB per layer.
Optical media are cheap, light and portable, and the disc cannot be affected by a magnetic field, which makes them suitable for distributing music, films and software, and for archiving. Their weaknesses are that they are slow, that a read-only disc cannot be rewritten, and that the recording surface is easily scratched.
Solid-state storage: flash memory
Solid-state storage has no moving parts. It stores data electrically in flash memory chips, using NAND or NOR technology. In both, each cell is built from transistors, and the important parts are the control gate and the floating gate.
The floating gate is surrounded by an insulating layer, so charge placed on it cannot leak away, and it is this trapped charge that stores the bit. To write, a voltage on the control gate is used to push electrons through the insulator onto the floating gate. To erase, a voltage in the opposite direction pulls them off. To read, a small voltage is applied and the cell is tested: if charge is trapped on the floating gate it changes the voltage at which the transistor conducts, so the cell reads as one value, and if there is no charge it reads as the other. Because the charge stays on the floating gate with the power off, flash memory is non-volatile.
NAND and NOR differ in how the cells are connected and therefore in how they are used. NAND is cheaper and denser, so it is used for bulk storage such as SSDs, SD cards and USB drives. NOR allows individual bytes to be addressed and read quickly, so it is used for code that has to execute directly, such as firmware.
Solid-state storage is much faster than a hard disk because there is no head to move and no platter to spin, and it is silent, low-powered and resistant to shock. Its weaknesses are that it costs more per gigabyte, that each cell can only be written and erased a limited number of times, and that recovering data from a failed drive is difficult.
| Type | How data is stored | Examples |
|---|---|---|
| Magnetic | Spots on a spinning magnetic platter are magnetised in one of two directions by an electromagnet | Hard disk drive (HDD) |
| Optical | Pits and lands on a reflective surface, written and read by a laser | CD, DVD, Blu-ray |
| Solid-state (flash) | Charge trapped on a floating gate in a transistor cell, controlled by a control gate | SSD, SD card, USB drive |
Choosing between the three types
Exam questions often ask you to choose a storage medium for a context and justify it, so learn the trade-offs rather than a list of facts about each one.
Choose magnetic when capacity and cost per gigabyte matter more than speed, such as a backup drive or a server holding large archives. Choose solid-state when speed, silence and resistance to shock matter, such as a laptop that is carried around, a phone, or a camera card. Choose optical when the data is to be distributed cheaply and does not need to be changed, such as a film or a music album, or when a long-lived archive copy is needed.
The comparison always comes back to four things: capacity, speed, durability and cost. Answer in those terms and tie each one to the context in the question.
| Criterion | Magnetic (HDD) | Optical (CD/DVD/Blu-ray) | Solid-state (flash) |
|---|---|---|---|
| Capacity | Very large | Small to moderate | Large and rising |
| Speed | Moderate: moving parts | Slow | Very fast: no moving parts |
| Durability | Can be damaged by shock while running | Surface is easily scratched | Resistant to shock, but cells wear with use |
| Cost per gigabyte | Low | Very low for the disc, but limited capacity | High |
| Best for | Archives, backups, bulk storage | Distributing music, films and software | Portable devices, operating systems, cameras |
Virtual memory
Virtual memory is a section of secondary storage used as an extension of RAM when RAM is full. It is created by the operating system, which reserves an area of the hard disk or SSD for the purpose, often as a file, and treats it as though it were additional memory.
It is used through paging. Both RAM and virtual memory are divided into fixed-size blocks called pages. When RAM is full and another program or page is needed, the operating system moves a page that is not currently being used out of RAM and writes it to virtual memory, freeing space. When that page is needed again, it is copied back into RAM, and another page is moved out to make room. A page that is needed but is not in RAM causes a page fault, and the operating system fetches it from virtual memory.
It is necessary because RAM is limited and expensive. Without virtual memory a computer could only run programs that fit entirely in RAM at once, so a large application would fail to open and multitasking would be restricted. Virtual memory allows programs that are larger than the available RAM to run, and allows more applications to be open at the same time.
The cost is speed. Secondary storage is far slower than RAM, so every transfer between them takes time, and if the system spends most of its time swapping pages in and out rather than processing, performance falls sharply. That is why adding more RAM is a better cure for a slow computer than relying on virtual memory.
| Term | Meaning |
|---|---|
| Virtual memory | An area of secondary storage used by the operating system as an extension of RAM when RAM is full |
| Page | A fixed-size block into which RAM and virtual memory are divided |
| Paging | Moving pages between RAM and virtual memory as they are needed |
| Page fault | Occurs when a page that is needed is not in RAM, so it must be fetched from virtual memory |
Cloud storage: advantages and disadvantages
Cloud storage is data stored on physical servers owned by a provider and accessed over the internet, rather than on a disk in the user's own machine. The files are not on the user's device at all: the device sends them to the provider's servers, and fetches them back when they are needed. Physical servers and storage are still needed, but they belong to the provider and are in a data centre somewhere else.
The advantages come from that separation. Data can be accessed remotely from any device with an internet connection, so a file saved at school can be opened at home. The provider handles backup and maintenance, so a failed laptop does not mean lost files. Capacity can be scaled up or down without buying hardware, several people can share and work on the same file at once, and there is no cost of buying and housing the storage yourself.
The disadvantages come from the same separation. It needs a reliable internet connection: with no connection, the files are out of reach. Access depends on the provider, so an outage or a change in terms affects the user, and the ongoing subscription can cost more over time than a single disk. The data is held on someone else's equipment, which raises security and privacy concerns, and it may be stored in another country with different laws. Uploading and downloading large files uses bandwidth and is slower than reading a local disk, and the user has less control over where the data actually is.
| Advantages of cloud storage | Disadvantages of cloud storage |
|---|---|
| Data can be accessed remotely from any device with an internet connection | A reliable internet connection is required; without one the data cannot be reached |
| The provider backs up the data and maintains the hardware | Access depends on the provider, and an outage or a change of terms affects the user |
| Storage can be increased or reduced without buying hardware | The ongoing subscription can cost more over time than buying a local disk |
| Files can be shared and edited by several people at once | Data is held on someone else's servers, raising security and privacy concerns |
| A local device failure does not lose the data | Uploading and downloading large files uses bandwidth and is slower than local access |
Key terms you must be able to define
- Primary storage
- Memory that the CPU can access directly, holding the instructions and data currently in use. It includes RAM and ROM.
- Secondary storage
- Storage that the CPU cannot access directly and whose contents must be copied into primary storage before use. It is non-volatile and is necessary for more permanent storage of data.
- RAM
- Random access memory: the volatile, read/write working memory that holds the programs and data currently in use. Any location can be reached directly.
- ROM
- Read only memory: non-volatile memory that holds the start-up instructions and cannot normally be changed.
- Volatile
- Describes memory whose contents are lost when the power is switched off. RAM is volatile; ROM and secondary storage are not.
- Track
- A concentric circle on the surface of a magnetic platter, along which data is recorded.
- Sector
- A subdivision of a track on a magnetic disk; the smallest unit that can be written or read.
- Pit and land
- The two states of an optical disc surface: a pit is a depression burned or pressed into the surface and a land is the flat area between pits. The transition between them carries the data.
- Flash memory
- Solid-state storage that holds data as charge trapped on a floating gate in a transistor cell, using NAND or NOR technology. It has no moving parts.
- Floating gate
- The insulated part of a flash memory cell that traps charge and so stores a bit. Charge is pushed on with the control gate to write and pulled off to erase.
- Virtual memory
- An area of secondary storage used by the operating system as an extension of RAM when RAM is full, with pages moved between the two as they are needed.
- Page
- A fixed-size block into which RAM and virtual memory are divided so that data can be moved between them.
- Page fault
- Occurs when a page that is needed is not in RAM, so the operating system must fetch it from virtual memory.
- Cloud storage
- Data stored on physical servers owned by a provider and accessed over the internet, rather than on a disk in the user's own device.
- Non-volatile
- Describes storage that keeps its contents when the power is switched off, such as ROM, a hard disk and flash memory.
In context
2210 sets its questions inside systems a student already uses - a school network, a phone, a supermarket till, a vending machine, a website. These show how the theory is applied to a context you have not seen before, then you answer for the system you are given.
The laptop has an SSD for secondary storage and RAM for working memory. When a document is opened, it is copied from the SSD into RAM, and the processor works on it there; when it is saved, the changes are written back to the SSD. The SSD is fast enough that the copy takes almost no time, which is why an SSD makes a laptop feel far quicker than the same laptop with a hard disk.
A console installs games on a hard disk or SSD because they are far too large for RAM. Only the level being played and the assets in view are loaded into RAM. The console's operating system also uses virtual memory so that a game can keep running while other services are open, but the game slows noticeably when pages have to be swapped, which is why consoles are built with as much RAM as the design can afford.
Staff save lesson resources to cloud storage rather than to the laptop's own disk. A teacher can open the same file at home or in another classroom, and if a laptop fails the files are still there because the provider keeps the only copy that matters. The drawback appears when the internet connection drops: the files cannot be opened at all, so the school keeps the most important resources on a local drive as well.
A CD stores music as pits and lands read by a laser, and it is cheap to press in large numbers, which is why it was the standard way to distribute an album. The same album on a USB drive uses flash memory and can be rewritten, but it costs more per gigabyte. A hard disk holding thousands of albums is the cheapest per gigabyte of the three, but it has moving parts and can be damaged if it is dropped.
A phone has no hard disk. Its storage is flash memory in an SD card or built in, chosen because it has no moving parts and survives being carried in a pocket. The phone's operating system also uses part of that flash memory as virtual memory when RAM is full, which is why a phone with many apps open becomes slow: it is swapping pages between RAM and much slower flash storage.
Flashcards
Click a card to flip it. Mark honestly — the tracker uses this.
Exam-style questions
8 questions, 24 marks. Write your answer and press Mark my answer — it is marked against the scheme and tells you which points you made and what would gain the next mark. You can still reveal the scheme and mark it yourself instead.
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Exam technique for this topic
- For a storage medium, describe the mechanism in order: the platter spins and the head magnetises spots; a laser burns pits and a weaker laser reads the reflections; charge is pushed onto a floating gate and sensed on read. A description that only says what the medium is used for earns nothing.
- Learn the RAM and ROM comparison as pairs: volatile against non-volatile, read/write against read only, working memory against start-up instructions. Questions usually award one mark per correct pair.
- For virtual memory, say how it is created (the operating system reserves an area of secondary storage), how it is used (pages are swapped in and out, a page fault occurs when a page is missing) and why it is necessary (RAM is limited and expensive). All three parts are usually required.
- For the cloud comparison, give both sides and tie each point to the context. An answer that lists only advantages cannot score the evaluation marks, however many it lists.
- Name the example with the medium: hard disk drive for magnetic, CD, DVD or Blu-ray for optical, and SSD, SD card or USB drive for solid-state. A medium described without its example loses the example mark.
Why students lose marks here
Where this fits in O Level Computer Science 2210
This page is one topic of Cambridge O Level Computer Science 2210. O Level Computer Science 2210 is the course home: every area and every topic in Cambridge's own order, the papers you sit and what each one tests, and the exam-practice tools. The full topic list, with each topic linked to its revision page, is on the O Level Computer Science 2210 syllabus page.