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 = raw, unprocessed facts (e.g. 37.2, 1010). Information = processed data with meaning and context (e.g. "Body temperature 37.2°C — normal").
| Unit | Size | Example use |
|---|---|---|
| Bit | 1 binary digit (0 or 1) | Smallest unit |
| Byte | 8 bits | 1 character (ASCII) |
| Kilobyte (KB) | 1,024 Bytes | Short text file |
| Megabyte (MB) | 1,024 KB | A photograph |
| Gigabyte (GB) | 1,024 MB | A movie |
| Terabyte (TB) | 1,024 GB | Large hard drive |
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.
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
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
To represent a negative number: 1) write positive in binary, 2) invert all bits, 3) add 1.
+5 = 00000101 → invert = 11111010 → add 1 = 11111011
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.
Shift left by n = multiply by 2ⁿ. Shift right by n = divide by 2ⁿ.
n-bit unsigned: 0 to 2ⁿ−1. n-bit two's complement: −2ⁿ⁻¹ to 2ⁿ⁻¹−1. Overflow occurs when a result exceeds this range.
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.
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
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.
| Property | Meaning | Effect |
|---|---|---|
| Visual resolution | Pixels per inch (PPI/DPI) | Higher = sharper image, larger file |
| Bit depth (colour) | Bits per pixel | More bits = more colours, larger file |
| Compression | RAW/TIFF uncompressed; JPG/PNG compressed | Compressed = smaller file, possible quality loss |
| Frames per second | Video smoothness | 24fps cinema; 60fps gaming |
| Sampling rate (audio) | Samples per second (Hz) | 44,100 Hz = CD quality; lower = smaller but poorer |
| Type | Components | Volatile? | Speed | Use |
|---|---|---|---|---|
| Primary (memory) | RAM, ROM, Cache | RAM: yes · ROM: no | Very fast | Active processes, firmware |
| Secondary (storage) | HDD, SSD, USB, Optical | No | Slower | Permanent data storage |
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
| Type | Speed | Cost per GB | Portability |
|---|---|---|---|
| HDD (magnetic) | Slowest | Cheapest | Low (fragile) |
| SSD | Fast | More expensive | Medium |
| Flash drive / SD card | Fast | Medium | High |
| Optical (Blu-Ray) | Slowest | Low per disc | High |
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
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.
| Licence | Description | Example |
|---|---|---|
| Freeware | Free to use, cannot modify or sell | Adobe Acrobat Reader |
| Shareware | Free trial, limited features or time | WinRAR |
| Open-source | Free to use, view and modify source code | Linux, Python, Firefox |
| Subscription | Pay monthly or yearly | Microsoft 365, Adobe CC |
| Perpetual | Pay once, own forever | Older MS Office versions |
| Site licence | Unlimited devices at one site | School buying software for all PCs |
Cloud-based software accessed via a web browser — no local installation needed. The vendor handles all updates and maintenance.
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.
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.
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
| Bus | Direction | Purpose |
|---|---|---|
| Address bus | Unidirectional (CPU → memory) | Carries the memory address CPU wants to read/write |
| Data bus | Bidirectional | Carries actual data/instructions between CPU and RAM |
| Control bus | Bidirectional | Carries read/write signals and clock pulses |
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.
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.
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.
| Function | What it does |
|---|---|
| User Interface | Allows the user to interact (CLI, GUI, NUI) |
| File Management | Organises, reads, writes, deletes files using a filing system (FAT32, NTFS, APFS, EXT4) |
| Process Management | Allocates CPU time to processes via scheduling algorithms |
| Memory Management | Allocates RAM to processes; manages virtual memory when RAM is full |
| I/O Management | Handles communication with peripherals via device drivers; uses buffering |
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.
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.
| Utility | Purpose |
|---|---|
| Anti-Virus / Anti-Malware | Detects and removes malicious software |
| Backup / Restore | Creates data copies; restores after failure |
| Disk Cleanup | Removes temp and unnecessary files |
| Disk Defragmenter | Reorganises HDD data for faster access (not needed for SSD) |
| File Compression | Reduces file size (ZIP) for storage or transfer |
| Formatting | Prepares storage media with a file system |
| Gate | Boolean | Output = 1 when... |
|---|---|---|
| AND | Q = A · B | Both inputs are 1 |
| OR | Q = A + B | At least one input is 1 |
| NOT | Q = Ā | Input is 0 (inverts) |
| NAND | Q = A · B | NOT (AND) — opposite of AND |
| NOR | Q = A + B | NOT (OR) — opposite of OR |
Boolean notation: AND = ·, OR = +, NOT = overline bar.
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.
If A=1, B=1, C=0 → D=1, E=1, Q=1.
Adds two single binary digits, producing a Sum and a Carry. Carry = A AND B. Sum = (A OR B) AND NOT(A AND B).
| A | B | Sum | Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
NAND and NOR are universal gates — any other gate can be built using only NAND (or only NOR) gates.
| Term | Definition |
|---|---|
| Database | Organised collection of structured data stored electronically |
| DBMS | Software 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) |
| Record | A row — one complete entry in a table |
| Primary Key | Unique identifier for each record. Cannot be null or duplicated. |
| Foreign Key | A field matching a primary key in another table — creates a relationship |
| Field type | Use | Validation example |
|---|---|---|
| Text | Names, codes, phone numbers | Phone: max 8 chars, digits only |
| Number | Quantities, prices | Quantity ≥ 0 |
| Date/Time | Dates and times | Rental date ≥ today's date |
| Boolean (Yes/No) | True/false flags | — |
| Auto-Number | Invoice IDs, primary keys | Auto-incremented, always unique |
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.
SELECT field1, field2
FROM TableName
WHERE condition1 AND condition2
ORDER BY field1 ASC;
SELECT CustomerName, OrderDate
FROM Customer
WHERE Country = 'Malta' AND OrderDate > '2025-01-01'
ORDER BY CustomerName ASC;
| Type | Scope | Example |
|---|---|---|
| PAN | Personal area (<10 m) | Bluetooth headphones to phone |
| LAN | Local area (building/campus) | School computer network |
| WAN | Wide area (country/global) | The internet, bank branches |
| Connection | Type | Pros | Cons |
|---|---|---|---|
| Ethernet | Wired | Fast, reliable, secure | Not portable, needs cables |
| Fibre optic | Wired | Very fast, long distance | Expensive to install |
| WiFi | Wireless | Portable, convenient | Interference, slower |
| Bluetooth | Wireless | Good for PAN devices | Very short range |
| 4G/5G | Wireless | Available with signal anywhere | Data limits, ongoing cost |
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.
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.
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.
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.
An algorithm is a precise, step-by-step set of instructions to solve a problem. Represented as pseudocode (text) or a flowchart (diagram).
| Flowchart symbol | Meaning |
|---|---|
| Oval / rounded rectangle | Start / End |
| Parallelogram | Input / Output |
| Rectangle | Process |
| Diamond | Decision (Yes/No) |
| Circle | Connector |
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.
| Error type | When detected | Effect | Example |
|---|---|---|---|
| Syntax | Compile time | Program won't compile / run | Missing colon, typo in keyword |
| Logical | Runtime (wrong result) | Runs but gives wrong answer | Using + instead of * |
| Runtime | During execution | Program crashes or stops | Dividing by zero, file not found |
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
map(val, 0, 1023, 0, 255)| Type | Description | Examples |
|---|---|---|
| Machine language | Binary 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 |
Source code → Byte 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.
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).
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)
| Operator | Meaning | Example |
|---|---|---|
| + − * / | Add, subtract, multiply, divide | 10 / 3 = 3.333... |
| // | Floor division (integer result) | 10 // 3 = 3 |
| % | Modulus (remainder) | 10 % 3 = 1 |
| ** | Power of | 2 ** 8 = 256 |
| += −= *= /= //= %= | Assignment shorthand | x += 3 → x = x + 3 |
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")
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)
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
# 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}")
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
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
# 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