MATSEC · 2026 · Level 2–3

Computing
Revision Notes

Complete SEC 09 notes covering all 13 learning outcomes. Detailed explanations with worked examples for Level 2 and Level 3.

13Learning outcomes
L2–3Exam level
7Subject foci
2026Exam year
All topics
LO1Digital Devices LO2Number Systems LO3Input & Output LO4Memory & Storage LO5Software & Licences LO6CPU Specs LO7Operating Systems LO8Machine Logic LO9Databases LO10Networking LO11Algorithms LO12Languages LO13Python
LO1 Digital Devices L2L3
Main components & data flow

Data flows: Input → I/O Subsystem → RAM → CPU → RAM → Output / Storage. The CPU cannot access data directly from storage — it must be loaded into RAM first.

CPU

Processes data. Contains the Control Unit (CU) and Arithmetic Logic Unit (ALU).

RAM

Volatile working memory. CPU reads and writes here during active processing.

ROM

Non-volatile. Stores firmware / BIOS (boot instructions) on a PC. Read-only in practice.

Motherboard

Connects all components together via the system bus.

Data vs Information

Data = raw, unprocessed facts (e.g. 37.2, 1010). Information = processed data with meaning and context (e.g. "Body temperature 37.2°C — normal").

L3 example: A temperature sensor outputs the value 37.2 (data). Software compares this to a reference range and displays "Temperature: Normal" on a dashboard (information).
Binary units of measurement
UnitSizeExample use
Bit1 binary digit (0 or 1)Smallest unit
Byte8 bits1 character (ASCII)
Kilobyte (KB)1,024 BytesShort text file
Megabyte (MB)1,024 KBA photograph
Gigabyte (GB)1,024 MBA movie
Terabyte (TB)1,024 GBLarge hard drive
L3 problem: A 4 MB photo. How many fit on a 1 GB drive? → 1024 ÷ 4 = 256 photos.
Analogue vs Digital & ADC / DAC

Analogue = continuous wave signal (temperature, sound). Digital = discrete binary values (0s and 1s).

ADC (Analogue-to-Digital Converter) converts real-world signals into binary — used by microphones, sensors. DAC converts digital back to analogue — used by speakers.

L3 — Sampling implications: Higher sampling rate → better quality but larger file size (higher cost). Trade-off: quality vs cost vs portability.
Microcontroller vs System on Chip (SoC)

Microcontroller

  • CPU + ROM + RAM + storage on one chip
  • Designed for one dedicated task
  • Low power, low cost
  • Examples: Arduino, thermostat, washing machine

SoC (System on Chip)

  • CPU + RAM + GPU + modem + WiFi on one chip
  • Can run a full OS, handle multiple tasks
  • Examples: Raspberry Pi, smartphones, smart TVs
L3 justify: A burglar alarm uses a microcontroller (single task, low power, cheap). A smartphone needs an SoC (runs OS, apps, GPU, modem simultaneously).
LO2 Number Systems & Binary Arithmetic L2L3
Conversions between bases

Binary → Decimal

Positional notation (powers of 2 right to left). 1011 = 8+0+2+1 = 11

Decimal → Binary

Divide by 2 repeatedly, read remainders bottom-up. 11 → 1011

Hex → Binary

Each hex digit = 4 bits. A=1010, F=1111. 2F = 0010 1111

Hex → Decimal

Positional notation, base 16. 2F = (2×16)+(15×1) = 47

Two's complement (signed numbers)

To represent a negative number: 1) write positive in binary, 2) invert all bits, 3) add 1.

Represent −5 in 8-bit two's complement:
+5 = 00000101 → invert = 11111010 → add 1 = 11111011
L3 justify: Two's complement eliminates the double-zero problem of one's complement (+0 and −0 both existed). The same hardware circuit handles both addition and subtraction.
Binary addition & subtraction

Rules: 0+0=0 · 0+1=1 · 1+1=10 (carry 1) · 1+1+1=11 (carry 1). Subtraction = add the two's complement of the subtrahend.

7 − 3: Convert 3 to two's complement → 11111101. Add 00000111 + 11111101 = 100000100. Discard overflow bit → 00000100 = 4 ✓
Bit shifting

Shift left by n = multiply by 2ⁿ. Shift right by n = divide by 2ⁿ.

0011 (3) << 2 = 1100 = 12 (3×4)  |  1100 (12) >> 1 = 0110 = 6 (12÷2)
Overflow & register ranges

n-bit unsigned: 0 to 2ⁿ−1. n-bit two's complement: −2ⁿ⁻¹ to 2ⁿ⁻¹−1. Overflow occurs when a result exceeds this range.

8-bit unsigned holds 0–255. Adding 200+100=300 overflows (300 > 255).
ASCII & Unicode

ASCII = 8-bit, 256 characters (basic Latin). Unicode (UTF-16) = 16-bit, 65,536+ characters — covers all world languages, symbols and emoji. Unicode was needed because ASCII couldn't represent non-Latin scripts.

LO3 Input & Output Devices L2L3
Categories of I/O

Input only

  • Keyboard, mouse, microphone, scanner, webcam, barcode reader

Output only

  • Monitor, printer, speaker, projector, LED display

Both (I/O)

  • Touchscreen, network card, headset with mic, CD-RW
Serial vs Parallel data transfer

Serial

Bits sent one at a time on a single wire. Slower but no synchronisation issues. Used in USB, SATA.

Parallel

Multiple bits sent simultaneously on multiple wires. Faster in theory but data skew (synchronisation errors) at high speed / long cables.

L3: Modern peripherals use serial despite it being slower per wire — parallel is unreliable over longer distances because bits arrive at slightly different times.
Output quality characteristics
PropertyMeaningEffect
Visual resolutionPixels per inch (PPI/DPI)Higher = sharper image, larger file
Bit depth (colour)Bits per pixelMore bits = more colours, larger file
CompressionRAW/TIFF uncompressed; JPG/PNG compressedCompressed = smaller file, possible quality loss
Frames per secondVideo smoothness24fps cinema; 60fps gaming
Sampling rate (audio)Samples per second (Hz)44,100 Hz = CD quality; lower = smaller but poorer
LO4 Memory & Storage L2L3
Primary vs Secondary storage
TypeComponentsVolatile?SpeedUse
Primary (memory)RAM, ROM, CacheRAM: yes · ROM: noVery fastActive processes, firmware
Secondary (storage)HDD, SSD, USB, OpticalNoSlowerPermanent data storage
Memory components

RAM

  • Volatile (lost on power off)
  • Read & write
  • Holds running OS + programs

ROM

  • Non-volatile
  • Read only
  • PC: stores BIOS. Microcontroller: startup routines, factory settings

Cache

  • Very fast, small, expensive
  • Stores frequently used CPU instructions
  • L1 > L2 > L3 in speed
L3 justify: 16 GB RAM suits a gaming PC. A traffic light microcontroller only needs a few KB of ROM — a 4 MB cache would be pointless and costly.
Secondary storage compared
TypeSpeedCost per GBPortability
HDD (magnetic)SlowestCheapestLow (fragile)
SSDFastMore expensiveMedium
Flash drive / SD cardFastMediumHigh
Optical (Blu-Ray)SlowestLow per discHigh
Cloud storage

Uses a third-party server accessed remotely over the internet. No local hardware cost.

Advantages

  • Accessible anywhere, any device
  • Easy sharing and collaboration
  • Automatic backups
  • No upfront hardware cost

Disadvantages

  • Requires internet connection
  • Ongoing subscription cost
  • Security and privacy risks
  • Data held by third party
L3 scenario: A doctor accessing patient records from clinic or home — cloud storage ideal (anywhere access). But medical data is sensitive — strong encryption + strict access controls are essential.
LO5 Software & Licences L2L3
Types of software

System software

Operates the hardware. Includes OS, device drivers, utilities.

Application software

Performs user tasks. Word processors, games, browsers.

Off-the-shelf

Pre-built for many users. Cheaper, immediately available but may not perfectly fit needs.

Bespoke (tailor-made)

Custom-built for one client. Perfectly fits requirements but expensive and slower to develop.

Software licences
LicenceDescriptionExample
FreewareFree to use, cannot modify or sellAdobe Acrobat Reader
SharewareFree trial, limited features or timeWinRAR
Open-sourceFree to use, view and modify source codeLinux, Python, Firefox
SubscriptionPay monthly or yearlyMicrosoft 365, Adobe CC
PerpetualPay once, own foreverOlder MS Office versions
Site licenceUnlimited devices at one siteSchool buying software for all PCs
Software as a Service (SaaS)

Cloud-based software accessed via a web browser — no local installation needed. The vendor handles all updates and maintenance.

Examples: Google Docs, Microsoft 365 Online, Netflix, Spotify, Dropbox.
L3 justify: A company with remote workers benefits from SaaS — staff access the same app from any device and the IT team doesn't need to install or update software on every machine.
LO6 CPU Specifications L2L3
CPU components

Control Unit (CU)

Fetches, decodes, and coordinates execution of instructions. The "manager" of the CPU.

ALU

Performs arithmetic (+−×÷) and logical (AND, OR, NOT, comparisons) operations.

Accumulator

Special register that temporarily holds the result of the last ALU operation.

System clock

Synchronises all CPU operations. Measured in Hz (GHz). More cycles per second = faster CPU.

Fetch & Execute cycle

The CPU continuously repeats this four-step cycle:

  • Fetch — CU fetches next instruction from RAM via the address and data bus
  • Decode — CU decodes the opcode and retrieves required operands
  • Execute — CU executes (ALU involved for arithmetic/logic)
  • Store — Result saved to accumulator register or memory
Example — LOAD R1, num1: CU fetches instruction → decodes (locates memory address num1) → executes (copies value) → stores in register R1.
System bus
BusDirectionPurpose
Address busUnidirectional (CPU → memory)Carries the memory address CPU wants to read/write
Data busBidirectionalCarries actual data/instructions between CPU and RAM
Control busBidirectionalCarries read/write signals and clock pulses
Address space, word length & performance (L3)

Address bus width determines address space. A 16-bit bus gives 2¹⁶ = 65,536 byte-addressable locations (64 KB). A 32-bit bus gives 4 GB of addressable RAM.

Word length = bits the CPU processes per cycle. A 64-bit CPU processes twice the data of a 32-bit CPU per cycle.

Compatibility: An OS needing 128 MB min RAM cannot run on a 16-bit address bus system (max 64 KB). A 64-bit application won't run on a 32-bit OS.
Machine instructions — opcode & operand
LOAD R1, num1 ; copy value at memory location 'num1' into register R1 ADD R3, R1, R2 ; R3 = R1 + R2 STORE R3, 0x6B ; write value of R3 into memory address 6B (hex = 01101011)

Opcode = the action (LOAD, ADD, STORE). Operand = the value, register, or memory address it acts on.

LO7 Operating Systems L2L3
OS types

General-Purpose OS

Versatile, runs many applications. E.g. Windows, macOS, Android, Linux.

Embedded OS

Built for one specific device/task. Tiny footprint, often no UI. E.g. washing machine firmware, router OS, IP camera.

Single-tasking

Runs one process at a time. Simple embedded systems.

Multitasking

Multiple processes run apparently simultaneously by rapidly switching between them.

OS functions
FunctionWhat it does
User InterfaceAllows the user to interact (CLI, GUI, NUI)
File ManagementOrganises, reads, writes, deletes files using a filing system (FAT32, NTFS, APFS, EXT4)
Process ManagementAllocates CPU time to processes via scheduling algorithms
Memory ManagementAllocates RAM to processes; manages virtual memory when RAM is full
I/O ManagementHandles communication with peripherals via device drivers; uses buffering
User interfaces

CLI

Text commands. Powerful, low resources. Used by network admins, developers.

GUI

Windows, icons, menus. Easy to use, high resources. General public, office workers.

NUI

Touch, gesture, voice. Most intuitive. Physically impaired users, smartphones, smart speakers.

CPU scheduling

Round Robin

Each process gets an equal time slice in turn. Fair, prevents starvation. Good for time-sharing.

Priority (non-preemptive)

Higher priority processes run first. System processes beat user apps. Risk: low-priority tasks may starve.

System utilities
UtilityPurpose
Anti-Virus / Anti-MalwareDetects and removes malicious software
Backup / RestoreCreates data copies; restores after failure
Disk CleanupRemoves temp and unnecessary files
Disk DefragmenterReorganises HDD data for faster access (not needed for SSD)
File CompressionReduces file size (ZIP) for storage or transfer
FormattingPrepares storage media with a file system
LO8 Machine Logic L2L3
Logic gates
GateBooleanOutput = 1 when...
ANDQ = A · BBoth inputs are 1
ORQ = A + BAt least one input is 1
NOTQ = ĀInput is 0 (inverts)
NANDQ = A · BNOT (AND) — opposite of AND
NORQ = A + BNOT (OR) — opposite of OR

Boolean notation: AND = ·, OR = +, NOT = overline bar.

Building truth tables (L2-3)

For n inputs, there are 2ⁿ rows. For 3 inputs (A,B,C) = 8 rows. Calculate each intermediate gate step-by-step before finding the final output.

Example: Q = (A · B) + NOT(C). Set D = A AND B, E = NOT C, then Q = D OR E.
If A=1, B=1, C=0 → D=1, E=1, Q=1.
Half adder

Adds two single binary digits, producing a Sum and a Carry. Carry = A AND B. Sum = (A OR B) AND NOT(A AND B).

ABSumCarry
0000
0110
1010
1101
Universal gates (L3)

NAND and NOR are universal gates — any other gate can be built using only NAND (or only NOR) gates.

Economic implication: Manufacturers produce just one chip type (NAND) and use it to build any logic circuit — reducing manufacturing complexity, parts inventory, and production cost.
LO9 Databases L2L3
Key database terms
TermDefinition
DatabaseOrganised collection of structured data stored electronically
DBMSSoftware that creates and manages databases (e.g. MySQL, MS Access). Separate from the data.
Table (entity)Stores data about one type of thing (e.g. Customer, Product)
Field (attribute)A column — one property of the entity (e.g. CustomerName)
RecordA row — one complete entry in a table
Primary KeyUnique identifier for each record. Cannot be null or duplicated.
Foreign KeyA field matching a primary key in another table — creates a relationship
Field types & validation (L3)
Field typeUseValidation example
TextNames, codes, phone numbersPhone: max 8 chars, digits only
NumberQuantities, pricesQuantity ≥ 0
Date/TimeDates and timesRental date ≥ today's date
Boolean (Yes/No)True/false flags
Auto-NumberInvoice IDs, primary keysAuto-incremented, always unique
ERD & crow's foot notation (L2-3)

One-to-one

E.g. Student — Seat. One student has exactly one seat.

One-to-many

E.g. Lecturer — Course. One lecturer teaches many courses. Most common relationship type.

Many-to-many

E.g. Student — Course. Requires a junction/link table to resolve in a relational DB.

Crow's foot: Cardinality (one | many) shown at the end of the line. Optionality (mandatory ‖ or optional ○) shown adjacent to cardinality. Primary key marked with *.
SQL queries
SELECT field1, field2 FROM TableName WHERE condition1 AND condition2 ORDER BY field1 ASC;
Example — customers from Malta who ordered after 01/01/2025:

SELECT CustomerName, OrderDate
FROM Customer
WHERE Country = 'Malta' AND OrderDate > '2025-01-01'
ORDER BY CustomerName ASC;
LO10 Networking L2L3
Network types
TypeScopeExample
PANPersonal area (<10 m)Bluetooth headphones to phone
LANLocal area (building/campus)School computer network
WANWide area (country/global)The internet, bank branches
Wired vs Wireless
ConnectionTypeProsCons
EthernetWiredFast, reliable, secureNot portable, needs cables
Fibre opticWiredVery fast, long distanceExpensive to install
WiFiWirelessPortable, convenientInterference, slower
BluetoothWirelessGood for PAN devicesVery short range
4G/5GWirelessAvailable with signal anywhereData limits, ongoing cost
IP, MAC addresses & DNS

MAC address — hardware address burned into the NIC. Unique globally. Used within a local network. IP address — logical address assigned by network. Can change.

IPv4 = 32-bit (~4.3 billion addresses). IPv6 = 128-bit → vastly more addresses needed for the IoT era.

DNS: Translates www.google.com → 142.250.x.x. The hostname stays the same even if the server's IP changes — users and applications aren't affected.
Network hardware

NIC

Network Interface Card — connects a device to a network (wired or wireless).

Router

Routes data packets between networks (e.g. home LAN ↔ internet).

Switch

Connects devices within the same LAN. Sends data only to the intended device.

Access Point

Provides wireless (WiFi) access to a wired LAN.

Network security

HTTP = unencrypted web traffic. HTTPS = HTTP + SSL/TLS encryption + digital certificate. Always use HTTPS for logins, banking, any sensitive data. Firewall — monitors traffic and blocks suspicious packets based on rules.

L3: A blog showing public articles doesn't need HTTPS. A banking login absolutely does — user credentials and financial data must be encrypted in transit.
Internet of Things (IoT)

Everyday physical objects connected to the internet and each other. Examples: smart thermostats, connected fridges, IP cameras, wearables. IPv6 is essential because billions of IoT devices each need a unique IP address.

LO11 Algorithms & Physical Computing L2L3
Algorithms, pseudocode & flowcharts

An algorithm is a precise, step-by-step set of instructions to solve a problem. Represented as pseudocode (text) or a flowchart (diagram).

Flowchart symbolMeaning
Oval / rounded rectangleStart / End
ParallelogramInput / Output
RectangleProcess
DiamondDecision (Yes/No)
CircleConnector
Programming constructs

Sequence

Instructions executed one after another in order.

Selection

IF / ELSE — execute different blocks based on a condition.

Iteration

FOR / WHILE loops — repeat a block of instructions.

Nested (L3)

A selection or loop inside another selection or loop.

Types of errors
Error typeWhen detectedEffectExample
SyntaxCompile timeProgram won't compile / runMissing colon, typo in keyword
LogicalRuntime (wrong result)Runs but gives wrong answerUsing + instead of *
RuntimeDuring executionProgram crashes or stopsDividing by zero, file not found
Arduino / Physical computing
digitalWrite(7, HIGH); // LED on pin 7 ON analogWrite(11, 128); // PWM: ~50% brightness (0–255) int state = digitalRead(5); // read button on pin 5 int val = analogRead(A1); // read potentiometer (0–1023) tone(3, 1000, 2000); // buzzer on pin 3, 1kHz, 2 sec noTone(8); // stop buzzer on pin 8
PWM: Simulates analogue output on digital pins by rapidly switching on/off. analogWrite values 0–255. Used for LED dimming, motor speed control.
L3 — map function: Arduino analogue pins are 10-bit (0–1023). Digital PWM = 8-bit (0–255). Convert: map(val, 0, 1023, 0, 255)
LO12 Programming Languages L2L3
Low-level vs High-level languages
TypeDescriptionExamples
Machine languageBinary opcodes. No translation needed. Processor-specific.01010001...
Assembly language (LLL)Mnemonics (MOV, ADD). Translated by assembler. Processor-specific.MOV R1, 5
3GL (HLL)English-like. Processor-independent. Compiled or interpreted.Python, C, Java
4GL (HLL)Even more abstract. Less flexible but faster to develop.SQL, Prolog, GUI builders
L3 justify: An air conditioner microcontroller uses assembly (precise hardware control, tiny memory). Its smartphone app uses Python/Java (faster development, portable to iOS and Android).
Code translation pipeline

Source codeByte code (platform-independent intermediate, e.g. Java .class, Python .pyc) → Executable (machine code for the specific CPU).

Byte code is run by a Virtual Machine (JVM for Java, PVM for Python) or JIT-compiled to native machine code for speed.

Language translators

Assembler

Converts assembly language to machine language.

Interpreter

Translates and runs source code line by line at runtime. Easy to debug but slower.

Compiler

Translates entire source to executable in one pass. Produces error log. Faster runtime.

L3 choose

Interpreter: during development (quick testing). Compiler: final release (performance).

LO13 Python Programming L2L3
Variables, input & output
name = input("Enter name: ") # always returns a String age = int(input("Enter age: ")) # convert to int with int() height = float(input("Height (m): ")) # convert to float print("Hello", name) print(f"You are {age} years old") # f-string (L3) print("no newline", end="") # suppress newline (L3)
Arithmetic & assignment operators
OperatorMeaningExample
+ − * /Add, subtract, multiply, divide10 / 3 = 3.333...
//Floor division (integer result)10 // 3 = 3
%Modulus (remainder)10 % 3 = 1
**Power of2 ** 8 = 256
+= −= *= /= //= %=Assignment shorthandx += 3 → x = x + 3
Selection — if / elif / else
if score >= 80: print("Distinction") elif score >= 50: print("Pass") else: print("Fail") # Nested selection (L3) if age >= 18: if country == "Malta": print("Eligible to vote in Malta") # Logical operators if name == "Maria" and age == 20: print("Match found") # Membership operator if "test" in message: print("Keyword found")
Iteration — for / while
for i in range(1, 6): # 1,2,3,4,5 print(i) count = 0 while count < 5: print(count) count += 1 # break and continue (L3) for x in range(10): if x % 2 == 0: continue # skip even numbers if x == 7: break # stop at 7 print(x) # Nested loops (L3) for i in range(3): for j in range(3): print(i, j)
Functions (L3)
def greet(name): # parameter return f"Hello, {name}!" # return value result = greet("Maria") print(result) # Hello, Maria! def add(a, b): return a + b print(add(3, 5)) # 8
Lists, tuples & dictionaries
# List (mutable, ordered) fruits = ["apple", "banana", "cherry"] fruits.append("mango") # add to end fruits.remove("banana") # remove by value fruits.pop(0) # remove by index fruits.sort() # sort in place print(fruits[0]) # first item # Tuple (immutable) coords = (10.5, 35.9) # Dictionary (L3 — key:value pairs) phonebook = {"Alice": 99001122, "Bob": 88223344} print(phonebook.get("Alice")) # 99001122 phonebook["Carol"] = 77334455 # add entry phonebook.pop("Bob") # remove entry for name, num in phonebook.items(): print(f"{name}: {num}")
String functions
s = "Hello World" print(s[0]) # H print(s[0:5]) # Hello print(len(s)) # 11 print(s.upper()) # HELLO WORLD print(s.lower()) # hello world print(s.replace("World","Malta")) # Hello Malta print(s.count("l")) # 3 print(s.find("W")) # 6 print(s.strip()) # removes whitespace
Random module (L2-3)
import random random.randint(1, 10) # L2: random int 1-10 random.choice(["red","blue"]) # L3: random item from list random.shuffle(my_list) # L3: shuffle list in place random.sample(range(1,101), 5) # L3: 5 unique randoms 1-100
Good programming practices
# 1. Inline comments — explain WHY total = price * qty # calculate total before applying discount # 2. Meaningful variable names customerAge = 25 # good — clear meaning x = 25 # bad — meaningless # 3. Consistent indentation (4 spaces per level in Python) if age >= 18: print("Adult") # 4 spaces in