1.1 - The characteristics of contemporary processors, input, output and storage devices
1.1.1 Structure and function of the processor
CPU components:
Buses:
Fetch-decode-execute cycle:
- Fetch: the address in the PC is copied to the MAR and sent along the address bus. The CU sends a read signal on the control bus, and the instruction arrives on the data bus into the MDR, then is copied into the CIR. The PC is incremented by 1.
- Decode: the instruction in the CIR is split into the opcode (the operation) and the operand (the data or address to use).
- Execute: the operation is carried out. Results of calculations are stored in the ACC.
Factors affecting CPU performance:
Pipelining: while one instruction is executed, the next is decoded and the one after is fetched. Increases throughput. Hazards (data dependencies, branches) can cause stalls.
Processor architectures:
1.1.2 Types of processor
Advantages: the compiler has less work to do.
Disadvantages: more complex hardware; instructions take several clock cycles; pipelining is harder.
Uses: desktop and laptop computers (e.g. Intel and AMD x86 processors).
Advantages: simpler, cheaper hardware; lower energy use; pipelining is easier.
Disadvantages: complex tasks need more instructions, so programs are larger.
Uses: mobile phones, tablets and embedded systems (e.g. ARM processors).
Benefit: faster for tasks that can be split up.
Limitations: sequential tasks gain nothing from extra cores, and software must be written to use them.
1.1.3 Input, output and storage
Know the trade-offs: speed, cost, capacity and volatility. Justify each choice against the scenario given.
1.2 - Software and software development
1.2.1 Systems software
Operating system: needed so users and applications can use the hardware without controlling it directly. Manages hardware, files, processes, memory, security and user accounts, and provides the user interface.
Memory management:
Interrupts: a signal that an event needs attention. Checked at the end of each fetch-decode-execute cycle. If one is raised, the CPU saves its current state to the stack, runs the ISR (Interrupt Service Routine), then restores the state and carries on. Types: hardware (keyboard, mouse, I/O), software (program requests) and timer.
Scheduling algorithms:
Types of operating system:
BIOS (Basic Input/Output System): firmware stored in ROM. First code run on boot. Performs POST (power-on self-test), identifies the hardware and loads the OS bootloader.
Device drivers: software that lets the OS communicate with a hardware device, translating generic OS commands into device-specific instructions.
Virtual machines: software that emulates a computer, so one OS can run inside another. Can also run intermediate code (e.g. Java bytecode) on a platform-specific virtual machine, so the same code runs on different hardware. Uses: legacy software, sandboxing, cloud computing (a hypervisor runs many VMs on one physical machine).
1.2.2 Applications generation
Translators:
Stages of compilation:
Give the stages in order and the output of each: tokens and symbol table, abstract syntax tree, object code, optimised code.
1.2.3 Software development methodologies
Drawbacks: hard to change once a stage is complete; testing happens late.
Drawbacks: less documentation; cost and timescale are harder to predict.
Drawbacks: needs constant customer involvement and disciplined developers.
Drawbacks: expensive and complex; depends on accurate risk assessment.
Drawbacks: less suited to large, complex systems; depends on users being available.
Algorithms: a precise, ordered set of steps that solves a problem. Written in pseudocode or as a flowchart, followed step by step, and traced to check it works.
1.2.4 Types of programming language
Why paradigms are needed: different problems suit different styles of program. A paradigm gives a structured way to design and write a solution.
Programming paradigms:
OOP concepts:
Assembly language: follow and write simple programs using the Little Man Computer (LMC) instruction set.
| Mnemonic | Operation |
|---|---|
| INP | Input a value into ACC |
| OUT | Output the value in ACC |
| LDA x | Load the value at address x into ACC |
| STA x | Store ACC at address x |
| ADD x | ACC = ACC + value at x |
| SUB x | ACC = ACC − value at x |
| BRA x | Branch always to address x |
| BRZ x | Branch to x if ACC = 0 |
| BRP x | Branch to x if ACC ≥ 0 |
| HLT | Halt the program |
| DAT | Store a data value at a labelled memory location |
Addressing modes:
1.3 - Exchanging data
1.3.1 Compression, encryption and hashing
Hashing: a one-way function that turns data into a fixed-length hash. The hash cannot be reversed. Uses: storing passwords (the hash is stored, not the password), checking data integrity, hash tables, digital signatures.
Symmetric is faster but needs a secure way to share the key. Asymmetric solves that but is slower, so TLS uses asymmetric encryption to exchange a symmetric key, which then encrypts the data.
1.3.2 Databases
Normalisation reduces redundancy by structuring tables:
- 1NF: no repeating groups; each cell holds one atomic value; each row is unique.
- 2NF: 1NF, and no partial dependencies (every non-key attribute depends on the whole of a composite primary key).
- 3NF: 2NF, and no transitive dependencies (non-key attributes depend only on the primary key).
SQL: interpret and modify queries such as:
Also know INSERT INTO, UPDATE ... SET and DELETE FROM.
Transaction processing: ACID
Record locking stops two users changing the same record at the same time. It can cause deadlock, where two users each wait for a record the other has locked. Redundancy means keeping copies of data, such as backups, so it can be recovered after a failure.
Indexing: creates a separate structure for fast lookups on a field. Speeds up queries but slows INSERT, UPDATE and DELETE.
1.3.3 Networks
Common application protocols:
TCP/IP stack (4 layers): each layer handles one job and passes data to the layer above or below.
DNS (Domain Name System) translates domain names into IP addresses. A resolver asks root, then TLD, then authoritative name servers. Results are cached to speed up future lookups.
Network security threats:
Phishing needs the user to be tricked into acting. Pharming redirects the user automatically, so no mistake by the user is needed.
Network security protection:
Network hardware:
1.3.4 Web technologies
Search engine indexing: web crawlers follow links and index page content. The index maps keywords to URLs, so searches are fast.
PageRank: ranks pages by the number and quality of links to them. Links from highly ranked pages count for more. Calculated iteratively across the link graph.
1.4 - Data types, data structures and algorithms
1.4.1 Data types and number representation
Primitive data types: integer, real (floating point), character, string, Boolean.
Two's complement (negative integers):
- To negate: flip all the bits, then add 1.
- The MSB has a negative place value. 8-bit range: -128 to +127.
- Addition works normally. Overflow occurs if the carry into and out of the MSB differ.
Sign and magnitude: the MSB is the sign bit (0 positive, 1 negative). Two representations of zero. Less used in practice.
Hexadecimal: base 16, digits 0 to 9 and A to F. Each hex digit is 4 bits (a nibble). Shorthand for binary, e.g. IPv6 addresses and colour codes.
- Binary to hex: group the bits into fours from the right and convert each group.
- Hex to decimal: multiply each digit by its place value (powers of 16) and add.
Floating point: sign bit, mantissa and exponent. Value = mantissa × 2^exponent.
- Normalisation: shift the mantissa until its first two bits differ (e.g. 01 or 10 in two's complement). This keeps the maximum precision for the number of bits.
- Addition and subtraction: make the exponents equal by shifting the mantissa of the smaller number, add or subtract the mantissas, then normalise the result.
- More mantissa bits give greater precision. More exponent bits give greater range.
- Errors: some decimals cannot be represented exactly in binary, so rounding errors occur.
Bitwise operations:
Character sets: ASCII uses 7 bits (128 characters, basic Latin). Extended ASCII uses 8 bits (256). Unicode covers all world languages and symbols. UTF-8 is the most common encoding, using 1 to 4 bytes per character.
Binary addition: add column by column from the right. 1+1 = 10 (write 0, carry 1). 1+1+1 = 11 (write 1, carry 1). Overflow occurs when the result needs more bits than are available.
Binary subtraction: negate the number being subtracted (two's complement), then add. Alternatively, subtract column by column, borrowing from the next column when needed.
1.4.2 Data structures
Know how to create, traverse, add and remove data in each structure, and which structure suits which problem.
1.4.3 Boolean algebra
Logic gates: AND, OR, NOT, NAND, NOR, XOR. Know their symbols and truth tables. Draw a logic gate diagram from a Boolean expression, and write a truth table from a diagram.
Defining a problem: write a Boolean expression from a description. e.g. a light that comes on when there is motion and it is dark: Light = Motion AND (NOT Daylight).
Laws for simplifying expressions:
¬(A ∨ B) ≡ ¬A ∧ ¬B
Convert between NAND/NOR and AND/OR/NOT.
A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C)
A ∨ (B ∨ C) ≡ (A ∨ B) ∨ C
A ∨ B ≡ B ∨ A
Karnaugh maps (K-maps): a visual method for simplifying Boolean expressions. Group 1s in rectangles of 1, 2, 4 or 8 cells. Larger groups give simpler expressions. Groups can wrap around the edges.
D-type flip-flop: stores 1 bit. Output Q takes the value of input D on the rising clock edge. Used in registers and memory.
Half adder: adds two 1-bit inputs. Sum = A XOR B. Carry = A AND B.
Full adder: adds two 1-bit inputs and a carry in. Built from two half adders and an OR gate for the carry out. Used for multi-bit addition.
1.5 - Legal, moral, cultural and ethical issues