Use brackets to group conditions that go together.
Example: the alarm X sounds if the door is open (D) and the system is armed (S), or if the panic button (P) is pressed.
X = (D AND S) OR P
Quick check
?A greenhouse sprinkler W switches on when the soil is dry (D) and it is not raining (R), or when the manual override (M) is pressed. Which logic statement matches?
Mission check
?Three sensors, one alarm. How many different input combinations must the truth table cover?
8. Each sensor can be 0 or 1, so each one doubles the number of cases: 2 × 2 × 2 = 8. Counting in binary from 000 to 111 lists all 8 rows, so no case is missed.
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.
System software manages the computer's resources, e.g. the OS and utility software. Application software does tasks for the user, e.g. a web browser or a game.
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
The user interface lets you control the computer, e.g. a graphical user interface (GUI) with windows, icons, menus and a pointer, or a command-line interface where you type commands.
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 managing, repairing and converting tools, compression, defragmentation, backup 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 (antivirus and anti-spyware) 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.
Other utilities manage files (copy, rename, organise) and convert files from one format to another.
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.
An assembler translates assembly language into machine code.
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.
Pearson pseudocode
SET total TO 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.
Assembly is translated by an assembler: each assembly instruction becomes one machine code instruction.
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 and runs the code one line at a time. 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.
An assembler is used when a program is written in assembly, e.g. for embedded systems or device drivers.
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
Every input and output is 1 (TRUE) or 0 (FALSE). A truth table lists every combination of inputs.
AND: 1 only if both inputs are 1. OR: 1 if at least one input is 1. NOT: reverses its one input.
Work out brackets first; NOT applies only to what comes straight after it.
3 inputs give 8 rows: count in binary from 000 to 111, and add working columns for each part.
Turn a problem into a statement by giving each condition a letter and mapping "and", "or", "not".
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 the user interface.
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; assemblers translate assembly language.
🏆
Mini-lesson complete!
⭐⭐⭐
You've worked through Logic, software and programming languages for Pearson Edexcel International GCSE Computer Science (4CP0). 🎉
Mission 1"Tea or coffee?" Would a computer's OR let you have both?
Mission 2Three sensors, one alarm: how many cases must you test?
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?
Specification points and sources for this lesson are listed at the bottom of the page.
Sources (9)
The specification points and sources behind this lesson.
1 Pearson Edexcel International GCSE 4CP0 spec, 4.3.1
2 Pearson Edexcel International GCSE 4CP0 spec, 4.3.1–4.3.2
3 Edexcel IGCSE 4CP0 spec, 4.4.1, 4.4.4
4 Edexcel IGCSE 4CP0 spec, 4.4.2
5 Edexcel IGCSE 4CP0 spec, 4.5.1
6 Edexcel IGCSE 4CP0 spec, 4.5.2
7 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
8 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