MATSEC IM Computing cheat sheet
MATSEC IM Computing · Keep the key ideas within reach.
Computer Systems
Von Neumann architecture: a single stored-program memory holds both instructions and data; the CPU fetches, decodes, executes and stores in the fetch-decode-execute cycle, with the program counter holding the next address and the accumulator or general registers holding operands.
Data units scale by powers of 1024 in binary terms: 1 byte = 8 bits, 1 KiB = 1024 bytes, 1 MiB = 1024 KiB, 1 GiB = 1024 MiB; storage vendors often use decimal powers of 1000, so a 500 GB drive shows about 465 GiB.
Two's complement: to negate a binary integer, invert all bits and add 1. An n-bit two's complement range is -2^(n-1) to 2^(n-1) - 1, so 8 bits hold -128 to +127 and the leftmost bit is the sign bit.
Logic gates and truth rules: AND outputs 1 only if all inputs are 1; OR outputs 1 if any input is 1; NOT inverts; XOR outputs 1 only for an odd number of 1 inputs; NAND and NOR are the negations of AND and OR.
Memory hierarchy by speed and cost per bit, fastest first: CPU registers, cache (L1/L2/L3), main memory (RAM), solid-state storage, magnetic disk, optical and tape. Cache exploits locality of reference; RAM is volatile, ROM and flash are non-volatile.
Addressing and buses: the address bus width sets the maximum addressable memory (n address lines give 2^n locations); the data bus width sets how many bits transfer per cycle; control lines carry read/write and clock signals.
OS responsibilities: process scheduling, memory allocation and virtual memory paging, file-system management, device drivers and I/O, user authentication and access control; an interrupt suspends the current process so the CPU can service a device or error.
Compression and encoding: lossless methods (ZIP, PNG, FLAC) reconstruct the original exactly; lossy methods (JPEG, MP3) discard perceptually minor data. Character encoding maps characters to codes: ASCII uses 7 bits, Unicode code points are encoded in UTF-8 as 1-4 bytes.
Programming and Algorithms
Algorithm complexity: Big-O gives an upper bound on growth. Linear search is O(n); binary search on sorted data is O(log n); bubble, insertion and selection sort are O(n^2); merge sort and heap sort are O(n log n); hash-table lookup averages O(1).
Binary search precondition: the array must be sorted. Compare the target with the middle element, then discard the half that cannot contain it; each iteration halves the search space, so 1,000,000 items need about 20 comparisons.
Recursion needs a base case that terminates and a recursive case that moves toward it; each call consumes stack space, so deep recursion risks stack overflow, and any recursion can be rewritten iteratively with an explicit stack.
Data structures: arrays give O(1) indexed access but fixed size; linked lists give O(1) insert/delete at a known node but O(n) search; stacks are LIFO (push/pop); queues are FIFO (enqueue/dequeue); trees give O(log n) search when balanced.
Pass by value copies the argument, so changes inside the function do not affect the caller; pass by reference passes the address, so the function can modify the original variable.
Control structures: sequence, selection (if/else, switch, case) and iteration (while tests before the body, do-while tests after, for combines initialisation, condition and update).
Trace tables: record each variable's value after every statement or iteration to verify logic and locate off-by-one errors; a loop running from 0 to n-1 inclusive executes exactly n times.
Translation and errors: a compiler translates the whole source into object code before execution; an interpreter executes statement by statement. Syntax errors break the grammar; logic errors compile but produce wrong output; runtime errors occur during execution (division by zero, out-of-range index).
Data and Information Management
Relational model: a table (relation) has rows (records/tuples) and columns (fields/attributes); the primary key uniquely identifies each row and cannot be null; a foreign key references a primary key in another table to enforce referential integrity.
Normalisation: 1NF removes repeating groups so every cell is atomic; 2NF removes partial dependencies on part of a composite key; 3NF removes transitive dependencies where a non-key field depends on another non-key field.
SQL core: SELECT columns FROM table WHERE condition GROUP BY columns HAVING group-condition ORDER BY column ASC|DESC; WHERE filters rows before grouping, HAVING filters groups after aggregation.
Aggregate functions: COUNT, SUM, AVG, MIN and MAX collapse many rows into one value; COUNT(*) counts all rows, COUNT(column) ignores NULLs, and NULL compared with = never matches, so use IS NULL / IS NOT NULL.
ACID transactions: Atomicity (all or nothing), Consistency (valid state to valid state), Isolation (concurrent transactions do not interfere), Durability (committed changes survive failure).
Validation vs verification: validation checks data is reasonable and within rules (range, type, presence, format); verification checks data was copied or entered accurately (double entry, parity, visual check).
File organisation and access: sequential files must be read in order and suit batch processing; direct/random access files allow immediate retrieval by calculated address or index; indexed-sequential files combine an index with ordered records.
Backup and recovery: full backup copies everything; incremental backup copies changes since the last backup of any type; differential backup copies changes since the last full backup. RAID 1 mirrors data; RAID 5 stripes with parity and survives one disk failure.
Computing in Context
The Data Protection Act (Malta, Cap. 586, GDPR-aligned) requires lawful, fair and transparent processing, purpose limitation, data minimisation, accuracy, storage limitation, integrity and confidentiality, plus accountability; data subjects hold rights of access, rectification, erasure and objection.
Computer Misuse provisions criminalise unauthorised access to a computer, unauthorised access with intent to commit a further offence, and unauthorised modification of computer material; penalties rise with intent and damage caused.
Copyright protects the expression of a work (code, text, images) from copying, not the idea itself; software licences set permitted use: proprietary, freeware (free but closed source), open source (source available for modification and redistribution), shareware (trial then pay).
System development life cycle stages: requirements analysis, design, implementation, testing, deployment, maintenance. Waterfall is sequential with fixed requirements; agile/iterative delivers increments with continuous user feedback.
Feasibility study dimensions: technical (can it be built), economic (cost-benefit, payback), legal (compliance), operational (will users adopt it), schedule (can it be delivered in time).
Testing levels: unit (single module), integration (modules together), system (whole system against requirements), acceptance (user sign-off), plus black-box (behaviour only) and white-box (internal paths) approaches.
Digital divide and accessibility: unequal access to devices, connectivity and skills affects participation; accessibility features (screen readers, keyboard-only navigation, captions, sufficient contrast) widen usability, and WCAG principles are perceivable, operable, understandable, robust.
Emerging contexts: cloud computing shifts capital cost to operating cost with scalability and shared responsibility for security; AI systems depend on training-data quality and raise bias, transparency and accountability concerns; IoT devices multiply attack surface and need patching.