Computers – Chapter 4 | Painless Programming
Topic 4 · Edexcel IGCSE Computer Science (4CP0)

Computers

Hardware, software, logic and programming languages. From embedded microprocessors to distributed cloud systems — understand every layer of how computers work.

4.1 Computational Models4.2 Hardware4.3 Logic4.4 Software4.5 Languages

Students must be familiar with the hardware and software components that make up computer systems and recognise that computers take many forms — from embedded microprocessors to distributed cloud infrastructure.

4.1
Machines and Computational Modelling

Input-Process-Output Model (4.1.1)

The fundamental model of how a computer works. Every computer system can be described in terms of:

  • Input — data entered via input devices (keyboard, mouse, touchscreen, sensors, microphone, camera)
  • Process — CPU performs operations on the data according to program instructions
  • Output — results sent to output devices (monitor, printer, speakers, actuators)
  • Storage — data may be stored (RAM, secondary storage) before, during or after processing

Computational Models (4.1.2)

  • Sequential model — instructions executed one at a time in strict order. Standard single-core processors.
  • Parallel model — multiple instructions processed simultaneously using multiple cores. Used in graphics, scientific simulation.
  • Multi-agent model — multiple independent agents each follow their own rules and interact. Used in simulations (ant colonies, traffic systems, AI).
4.2
Hardware

Main Hardware Components (4.2.1)

  • CPU (Central Processing Unit) — executes program instructions. Performs arithmetic, logic, control and I/O operations.
  • Main memory (primary storage) — fast storage directly accessible by CPU. Holds currently running programs and data. RAM (volatile) and ROM (non-volatile).
  • Secondary storage — persistent storage for programs and data not in current use. Larger capacity, slower than main memory. HDD, SSD, optical discs.
  • Input devices — keyboard, mouse, touchscreen, scanner, microphone, webcam, barcode reader.
  • Output devices — monitor, printer, speakers, projector, LEDs, motors.
Types of Memory (4.2.2)

RAM

Volatile — contents lost when power removed. Stores currently running programs, data in use and OS. More RAM = more simultaneous programs.

ROM

Non-volatile — retains data without power. Pre-programmed at manufacture. Stores firmware such as BIOS/UEFI boot program.

Cache Memory

Very fast, small memory between CPU and RAM. Stores copies of frequently accessed data. L1 (fastest, smallest) to L3 (larger, slower).

Virtual Memory

Portion of secondary storage used as extension of RAM when physical RAM is full. Much slower than RAM — excessive use causes thrashing.

CPU Components and the Fetch-Decode-Execute Cycle (4.2.3)

Control Unit (CU)

Manages and coordinates all CPU activities. Decodes instructions and generates control signals.

ALU

Arithmetic/Logic Unit. Performs mathematical operations and logical operations (AND, OR, NOT, comparisons).

Registers

Tiny, extremely fast storage inside CPU: Program Counter (PC), Accumulator, MAR, MDR.

Clock

Generates regular electrical pulses to synchronise CPU operations. Measured in GHz.

Address Bus

Carries memory addresses from CPU to memory. Unidirectional. Width determines maximum addressable memory.

Data Bus

Carries data between CPU, memory and I/O devices. Bidirectional.

Address BusSends memory locations (one direction)
Data BusTransfers data (both directions)
Control BusSends control signals (both directions)

The Fetch-Decode-Execute Cycle (Von Neumann Model)

1. Fetch — Program Counter address copied to MAR. Instruction at that address fetched into MDR. PC incremented.

2. Decode — Control Unit decodes instruction to identify operation type and operands.

3. Execute — Decoded instruction is carried out: ALU performs operations, data moves, or branch changes PC.

The cycle repeats billions of times per second.

4.2.4

CPU performance factors:

  • Clock speed — faster clock = more cycles/sec
  • Number of cores — execute instructions in parallel
  • Cache size — more cache = fewer slow RAM accesses
4.2.5

Physical storage types:

  • Magnetic (HDD) — spinning platters, cheap, slow, fragile
  • Optical (CD/DVD/Blu-ray) — laser reads pits, portable, smaller capacity
  • Solid state (SSD/flash) — no moving parts, fast, silent, durable, more expensive
4.2.6

Cloud storage — data stored on remote servers accessed via internet. Advantages: accessible anywhere, scalable, no hardware to maintain. Disadvantages: needs internet, third-party control, subscription costs, privacy concerns.

4.2.7

Embedded systems — dedicated computer systems built into larger devices for specific fixed functions. Examples: washing machine controller, ABS brakes, microwave, pacemaker. Optimised for low power, low cost, real-time response.

4.3
Logic

Logic Gates and Truth Tables (4.3.1 – 4.3.2)

Logic gates are the fundamental building blocks of digital circuits. Truth tables show all possible input combinations and their outputs. You must be able to construct truth tables and write logic statements.

AND Gate

ABA AND B
000
010
100
111

OR Gate

ABA OR B
000
011
101
111

NOT Gate

ANOT A
01
10

Combined Logic Statements

Logic gates can be combined to create more complex circuits. Example — door alarm: ALARM = (door_open AND night) OR (motion AND armed)

  • Build truth tables listing all input combinations
  • 3 inputs need 2³ = 8 rows; 4 inputs need 2⁴ = 16 rows
  • Operator precedence: NOT first, then AND, then OR
4.4
Software
4.4.1

Operating System (OS) — system software managing computer resources. Functions: file management, process management, hardware management (drivers), user interface (CLI/GUI), memory management, security (user accounts/permissions).

4.4.2

Utility software — maintenance programs: file management, compression (zip), defragmentation (magnetic disks only), backup, anti-malware (antivirus, anti-spyware).

4.4.3

Simulation and modelling software — creates virtual models of real-world systems. Allows testing scenarios too dangerous, costly or time-consuming for reality. Examples: flight simulators, climate models, car crash tests.

4.4.4

System vs Application software — System software manages hardware (OS, utilities, drivers). Application software performs user tasks (word processors, browsers, games, spreadsheets).

4.5
Programming Languages

High-Level vs Low-Level Languages (4.5.1)

  • High-level languages — close to English (Python, Java, C#). Programmer-friendly, portable, easier to debug. Require translation (compiler/interpreter).
  • Low-level languages — Assembly language uses mnemonics (MOV, ADD, JMP). Each maps to one machine code instruction. Machine-specific, harder to write but precise hardware control.
  • Machine code — pure binary executed directly by CPU. Unreadable by humans.

Use high-level for business/web apps. Use low-level for device drivers, embedded systems, OS kernels.

Translators (4.5.2)

  • Assembler — translates assembly language into machine code (one-to-one).
  • Compiler — translates entire high-level source code into machine code in one pass. Fast execution, no translator needed at runtime. Slower edit-compile-test cycle.
  • Interpreter — translates and executes source code line by line. Easier debugging, slower execution, source code required at runtime.

Compiler vs Interpreter — Summary

Compiler: Translates all at once → produces executable → fast to run → errors found after full compilation → no source code at runtime.

Interpreter: Translates line by line → no executable → slower to run → stops at first error → source code required every time → easier for rapid development.

Scroll to Top