Usually small, cheap, low power and reliable. Its program is stored permanently, often in ROM.
A general-purpose computer, such as a PC or laptop, runs many different programs.
Quick check
?Which of these is not an embedded system?
Mission check
?ENIAC took days to reprogram. Why can your phone swap apps instantly?
ENIAC's program was set by its wiring, so a new job meant rewiring. In your phone, programs are stored in memory as instructions, just like data. The CPU fetches, decodes and executes whatever instructions are there, so switching apps just means running different instructions.
Mission 2
One storage firm runs 300,000+ spinning hard disks. Why not SSDs?
Make a guess: One storage firm runs 300,000+ spinning hard disks. Why not SSDs?
Hardware · secondary storage
Why secondary storage?
Secondary storage is non-volatile: it keeps the operating system, programs and files with the power off.
It holds far more than RAM, for much less money per gigabyte.
The CPU does not access it directly. Programs and data are copied into RAM (main memory) first.
To choose a device, compare its capacity, speed, portability, durability, reliability and cost.
Hardware · secondary storage
Magnetic storage
A hard disk drive (HDD) stores data on spinning magnetic platters.
Platters are divided into circular tracks, split into sectors.
A moving read/write head uses an electromagnet to magnetise tiny areas (one way for 1, the other for 0) and to read them.
Moving parts: slower, and easily damaged if dropped. But huge and cheap per gigabyte.
Hardware · secondary storage
Solid-state storage
Solid-state storage uses flash memory: electrical circuits that keep data with the power off. No moving parts.
Examples: SSD (solid-state drive), SD card, USB flash drive.
Fast, light, low power and robust. But it costs more per gigabyte, and cells wear out after many rewrites.
Hardware · secondary storage
Optical storage
A laser reads the surface of a spinning disc. Pits and lands reflect the light differently, giving 1s and 0s.
To write, a laser changes the surface of a recordable disc.
Examples: CD (about 700 MB), DVD (4.7 GB), Blu-ray (25 GB per layer).
Cheap and light to post, but low capacity, slow and easily scratched. Downloads and flash drives have largely replaced it.
Calculate
?A 4,000 GB hard disk costs £80. A 2,000 GB SSD costs £120. How many times more does the SSD cost per gigabyte?
Quick check
?A travel photographer copies 60 GB of photos a day to a small device kept loose in a rucksack. Which is the best choice?
Mission check
?One storage firm runs 300,000+ spinning hard disks. Why not SSDs?
When you store vast amounts of data, cost per gigabyte matters most. Hard disks give far more capacity for the money. SSDs are faster and tougher, so they are used where speed matters, such as in laptops.
Mission 3
One CPU core, three apps at once. How is that possible?
Make a guess: One CPU core, three apps at once. How is that possible?
Systems software · operating systems
The manager between apps and hardware
The operating system (OS) is system software that manages the hardware and provides a platform for applications to run on.
Apps don't control the hardware themselves: they ask the OS.
The OS loads apps into memory, starts them and closes them.
Systems software · operating systems
Sharing the processor and memory
Each running program is a process. One core runs one instruction at a time.
The OS schedules processes: each gets a short time slice on the CPU, then the OS switches to the next.
Switching is so fast that programs seem to run at once: multitasking.
Quick check
?On a single-core laptop you play music, download a file and type an essay. What keeps all three going?
Systems software · operating systems
Devices and files
The OS manages peripherals (input, output and storage devices) and the data passing between them and the processor.
A device driver lets the OS communicate with one particular device. It translates OS commands into ones that device understands.
File management: the OS organises files into folders and lets you name, save, move, copy and delete them.
Systems software · operating systems
Interface, users and security
User management: the OS creates user accounts, checks logins and gives each account access rights to particular files and programs.
Quick check
?A new printer is detected, but every page comes out as strange symbols. Which software most likely needs installing or updating?
Mission check
?One CPU core, three apps at once. How is that possible?
They don't really run at the same moment. The operating system schedules the processes, giving each a short time slice on the core and switching between them so quickly that all three appear to run at once.
Mission 4
Why could shuffling files around make an old hard drive faster?
Make a guess: Why could shuffling files around make an old hard drive faster?
Systems software · utility software
Housekeeping software
Utility software is system software that helps to maintain, protect or configure a computer.
It carries out housekeeping tasks that the operating system may not do, or may not do well enough, on its own.
Some utilities come with the OS; others are installed separately.
Examples: file repair, backup, data compression, disk defragmentation and anti-malware software.
Systems software · utility software
Fragmented files
A magnetic hard disk stores files in blocks. The read/write head moves to each block to read it.
As files are saved and deleted, free space becomes scattered gaps, so new files get split up: they are fragmented.
Reading a fragmented file needs many slow head movements.
A disk defragmenter moves each file's pieces next to each other (contiguous) and groups the free space together, so files load faster.
Quick check
?Ali's new laptop has a solid state drive (SSD). Is it worth running a defragmenter on it?
Systems software · utility software
Backup, compression and encryption
Backup software copies files to another device or the cloud, so they can be restored if lost or damaged.
Compression software makes files smaller, so they use less storage space and transfer faster.
Systems software · utility software
Protecting and repairing files
Anti-malware software scans files and memory for malware, comparing them with known malware signatures and watching for suspicious behaviour. It quarantines or deletes what it finds.
File repair tools fix damaged or corrupted files so they can be opened again.
Quick check
?Mia's folder of reports and spreadsheets is 45 MB, but her email allows attachments up to 20 MB. Which utility helps most?
Mission check
?Why could shuffling files around make an old hard drive faster?
Over time a hard disk's files get split into fragments scattered across the platter, and the read/write head wastes time jumping between them. A defragmenter moves each file's pieces next to each other and gathers free space together, so files are read with far less head movement.
Mission 5
Why write a 1999 hit game almost entirely in assembly?
Make a guess: Why write a 1999 hit game almost entirely in assembly?
Languages · levels of programming language
What the processor actually runs
A CPU can only execute machine code: instructions in binary.
Each instruction is a simple step, such as load a value, add, store a result or jump.
Each processor family has its own instruction set, so machine code for one family won't run on another.
Machine code and assembly language are low-level languages: they work directly with the processor's own instructions.
Languages · levels of programming language
Assembly language
Assembly language replaces binary with short mnemonics such as LDA (load), ADD and STA (store).
Each assembly instruction matches exactly one machine code instruction: a 1:1 correspondence.
Like machine code, it is specific to one processor family.
Assembly language (illustrative)
LDA price ; load price into the processor
ADD tax ; add tax to it
STA total ; store the result in total
Languages · levels of programming language
High-level languages
High-level languages use English-like keywords and maths-style expressions.
One statement often becomes several machine code instructions: the line below becomes the three assembly instructions you just met.
They are machine independent: the same source code can be translated to run on different processor families.
A compiler or interpreter must translate the code before the CPU can run it.
Most programs are high-level: they are quicker to write, read and debug.
Python
total = price + tax
Quick check
?A programmer writes the line STA total. What kind of code is this?
Calculate
?An assembly program has these 3 lines: LDA price, ADD tax, STA total. How many machine code instructions will it become?
Languages · levels of programming language
Choosing a level
High-level
Low-level
Reading and writing
easier: English-like
harder: mnemonics or binary
Debugging
easier to find and fix errors
harder
Portability
machine independent
works on one processor family
Hardware control
indirect, through the OS
direct control of registers and memory
Speed and memory
translated code may be less efficient
can be very fast and compact
Use low-level for device drivers, embedded systems and code where speed or memory is critical.
Use high-level for most applications, where quick development matters more.
Quick check
?A smart thermostat has a tiny chip with very little memory, and its program must control a temperature sensor directly. Which level of language suits it best?
Mission check
?Why write a 1999 hit game almost entirely in assembly?
Assembly gives the programmer direct control of the processor's own instructions, so the code can be very fast and compact. Its creator said a high-level language would have run too slowly on the PCs of 1999, or forced a simpler game. The price was code that is much harder to write, read and debug.
Mission 6
Why do some languages show all your errors, and others just one?
Make a guess: Why do some languages show all your errors, and others just one?
Languages · translators
Why translate?
The CPU can only execute machine code, so the source code that programmers write must be translated first.
A translator is a program that converts source code into a form the CPU can execute.
High-level code is translated by a compiler or an interpreter.
Languages · translators
Compiler or interpreter?
A compiler translates the whole program before it runs, producing an executable file of machine code that runs without the compiler.
An interpreter translates one line at a time into machine code and runs it. It is needed every time the program runs.
Errors: a compiler gives an error report for the whole program; an interpreter stops at the first error.
Quick check
?An 8-line program has errors on lines 4 and 7. What happens when you run it with an interpreter?
Languages · translators
Choosing a translator
Compiler
Interpreter
Translates
the whole program, before it runs
one line at a time, as it runs
Produces
an executable file
no executable file
Running speed
fast: already translated
slower: translated again every run
Finding errors
report after translating everything
stops at the error, easy to see where
After a change
must recompile the whole program
just run it again
Sharing
send the executable; source stays private
users need the source and an interpreter
An interpreter is mostly used while developing and testing a program; a compiler translates the final program for release.
Quick check
?A games studio is ready to release its finished game and doesn't want players to see its source code. Which translator should it use?
Mission check
?Why do some languages show all your errors, and others just one?
A compiler translates the whole program before it runs, so it can list every error it finds in one report. An interpreter translates and runs one line at a time, so it stops as soon as it reaches the first error.
Recap
Big ideas
Instructions and data are both stored in main memory; the CPU fetches, decodes and executes them, one after another, kept in step by the clock.
The address bus carries addresses, the data bus carries data and instructions, the control bus carries control signals.
An embedded system is a computer inside a larger device that does one dedicated job.
Secondary storage is non-volatile and keeps data for the long term; choose it by capacity, speed, portability, durability, reliability and cost.
Magnetic: huge and cheap per gigabyte, but moving parts. Solid state: fast and robust, but dearer per gigabyte.
Optical discs are read by a laser (pits and lands): cheap but low capacity.
The OS is system software that manages the hardware and gives applications a platform to run on.
It shares the processor between processes (multitasking) by scheduling short time slices, and manages peripherals using device drivers.
It also manages files and user accounts.
Utility software is system software that does housekeeping tasks to maintain, protect or configure the computer.
A defragmenter makes files contiguous on a magnetic hard disk so they load faster; it isn't needed on an SSD.
Backup, compression, file repair and anti-malware tools each protect, shrink or fix your files.
The CPU only runs machine code (binary); assembly uses mnemonics with a 1:1 match to machine code. Both are low-level and tied to one processor family.
High-level languages are easier to write, read and debug and are machine independent, but must be translated.
Low-level suits device drivers, embedded systems and speed-critical code; high-level suits most applications.
Source code must be translated before the CPU can run it: a compiler translates the whole program into an executable; an interpreter translates and runs it line by line.
Interpreters suit development and testing; compilers suit the final program.
🏆
Mini-lesson complete!
⭐⭐⭐
You've worked through Computers for Pearson Edexcel GCSE Computer Science (1CP2). 🎉
Mission 1ENIAC took days to reprogram. Your phone swaps apps instantly. Why?
Mission 2One storage firm runs 300,000+ spinning hard disks. Why not SSDs?
Mission 3One CPU core, three apps at once. How is that possible?
Mission 4Why could shuffling files around make an old hard drive faster?
Mission 5Why write a 1999 hit game almost entirely in assembly?
Mission 6Why do some languages show all your errors, and others just one?
9 Chris Sawyer (the game's creator), official site: FAQ "Chris Sawyer Software Development", Q "What language was RollerCoaster Tycoon programmed in?" ("99% written in x86 assembler/machine code … with a small amount of C code used to interface to MS Windows and DirectX"), https://chrissawyergames.com/faq3.htm; release "early in 1999": https://chrissawyergames.com/info.htm
10 Atari (publisher of the RollerCoaster Tycoon series), "Interview with RollerCoaster Tycoon's creator Chris Sawyer", Atari's own Medium publication Atari Club, Carly Francis, 27 March 2024; Sawyer's own answer to "Why did you write RollerCoaster Tycoon in assembly language … rather than a high level language like C?", https://medium.com/atari-club/interview-with-rollercoaster-tycoons-creator-chris-sawyer-684a0efb0f13