National Year 12 Computer Science
Chapters: 9
1. 4.1 Fundamentals of programming
4.1.1 Programming · 4.1.2 Procedural programming
- Python Basics: Modes, Variables, Data Types and Operators – Python runs in interactive mode (one line at a time) or script mode (a saved .py file). Blocks are shown by indentation. Variables are names tied to values; every value has a data type, and some types are mutable. Operators build expressions that Python works out by precedence. input() reads text, int()/float()/str() convert types, and debugging fixes syntax, runtime and logical errors.
- Software Development: From Idea to Working App – Good software is built in stages: analyse the problem and write requirements, design the solution, code it in small parts, test it with normal, boundary and erroneous data, deploy it to users and maintain it. Waterfall does each stage once in order; agile repeats short cycles. Robust programs validate input, and teams use version control, clear roles and feedback from users.
2. 4.2 Fundamentals of data structures (part 1)
Arrays and files
- Data Structures: Arrays, Lists, Stacks, Queues and Trees – A data structure is a way of organising data in memory so a program can use it well. Arrays keep items in numbered boxes for instant access by index. Linked lists chain nodes with pointers, so inserting is easy. Stacks work last-in-first-out, queues first-in-first-out. Dictionaries find values by key, and trees store data in levels so searching is fast. Choosing the right structure makes programs faster and simpler.
3. 4.13 Systematic approach to problem solving
Software development stages
- Software Development: From Idea to Working App – Good software is built in stages: analyse the problem and write requirements, design the solution, code it in small parts, test it with normal, boundary and erroneous data, deploy it to users and maintain it. Waterfall does each stage once in order; agile repeats short cycles. Robust programs validate input, and teams use version control, clear roles and feedback from users.
4. 4.4 Theory of computation (part 1)
4.4.1 Abstraction and automation · 4.4.2 Finite state machines
- Finite State Machines and Formal Languages – A finite state machine (FSM) has a fixed set of states, an alphabet of input symbols, a start state, a transition function that says which state comes next for each symbol, and (for an acceptor) a set of accepting states. It reads an input string one symbol at a time; if it ends in an accepting state the string is accepted. A Mealy machine also gives an output on each transition. The strings an FSM accepts form a regular language, which can also be described by a regular expression. Languages with nesting (like brackets) need more power: they are context-free and are written with BNF rules or syntax diagrams.
5. 4.5 Fundamentals of data representation
Number systems and bases · Binary number system · Information coding · Images, sound and other data
- Number Systems and Encoding – A number system is a way to write numbers using a set of digits and a base. Decimal (base 10) uses 0–9, binary (base 2) uses 0 and 1, octal (base 8) uses 0–7, and hexadecimal (base 16) uses 0–9 and A–F. To go from decimal to any base, divide repeatedly by the base and read remainders bottom to top; for fractions, multiply by the base and read the integer parts top to bottom. To go to decimal, multiply each digit by its place value and add. Binary ↔ octal uses groups of 3 bits, binary ↔ hex groups of 4. Text is stored with encoding schemes: ASCII (7-bit, 128 characters), ISCII (8-bit, Indian scripts) and Unicode (every script), stored as UTF-8 (1–4 bytes) or UTF-32 (4 bytes).
- Data Representation: How Computers Store Numbers, Text, Images and Sound – Data is raw facts; information is data given meaning; knowledge is information we can use. A computer stores all data as bits (0 or 1). 8 bits make a byte, and 1 kB = 1000 bytes, 1 MB = 1000 kB, 1 GB = 1000 MB, 1 TB = 1000 GB. Numbers are stored in binary, where place values double: 1, 2, 4, 8 and so on. Text uses a character set: in ASCII 'A' is 65; Unicode covers every script. A bitmap image is a grid of pixels; size = width × height × colour depth. Sound is sampled: size = sample rate × bit depth × seconds. Vector images store shapes instead of pixels. Compression makes files smaller: lossless keeps every bit, lossy throws some detail away.
6. 4.6 Fundamentals of computer systems
Hardware and software · Languages and translators · Logic gates and Boolean algebra
- Software: System and Application, Generic and Specific – Software is a set of programs. System software (operating system, device drivers, utilities, language translators) runs and looks after the computer. Application software does a user's task. Application software can be generic (general-purpose, ready-made for many users) or specific-purpose (customised for one organisation's need).
- Programming Languages and Translators – A CPU can only run machine code: binary instructions. Low-level languages are machine code and assembly language (short mnemonics such as LOAD and ADD, one per machine instruction). High-level languages such as Python, Java and C are easier for people to read and write, and one line may become many machine instructions. Translators convert code: an assembler turns assembly into machine code; a compiler translates a whole high-level program into an executable before it runs; an interpreter translates and runs one line at a time. Some languages compile to bytecode, which a virtual machine then runs.
- Boolean Logic – Boolean logic works with only two values: 1 (true) and 0 (false). Logic gates act on them: NOT flips a value; AND gives 1 only if all inputs are 1; OR gives 1 if any input is 1; NAND and NOR are the opposites of AND and OR; XOR gives 1 when inputs differ. A truth table lists the output for every input combination (2ⁿ rows for n inputs). De Morgan's laws: (A·B)' = A' + B' and (A + B)' = A'·B'. Gates joined together form logic circuits that match Boolean expressions.
7. 4.7 Computer organisation and architecture
Internal hardware and stored program · Processor and its components · External hardware
- Computers and Computing: Evolution, Parts and I/O Devices – A computer is an electronic machine that takes input, processes it under the control of a program, stores data and gives output. Computing devices grew from the abacus to smartphones. Every computer has an input unit, a CPU, memory and an output unit, joined by buses and ports.
- Processor Internals: Registers, the Fetch–Execute Cycle, Addressing Modes and Interrupts – A processor has an ALU, a control unit, a clock and registers (PC, MAR, MDR, CIR, accumulator, status register), joined to main memory by the address, data and control buses. Each instruction is fetched (MAR ← [PC]; MDR ← [Memory[MAR]], PC ← [PC] + 1; CIR ← [MDR]), decoded into opcode and operand, and executed. Operands use immediate addressing (the value itself) or direct addressing (a memory address). Assembly language uses mnemonics such as LDR, STR, ADD, SUB, CMP, B and BEQ. Performance depends on cores, cache, clock speed, word length and bus widths. Interrupts make the processor save its volatile environment on a stack, run an interrupt service routine and then resume.
- Computer Memory: Units, Primary and Secondary, Data Recovery – Computers store everything as bits (0 or 1). 8 bits make a byte, and each bigger unit is 1024 times the one before. Primary memory (RAM, ROM, cache) works directly with the CPU; secondary storage (HDD, SSD, pen drive) keeps files for a long time. A deleted file can often be recovered until it is overwritten, so data must be protected.
8. 4.8 Consequences of uses of computing
Moral, ethical, legal and cultural issues
Coming soon
9. 4.9 Communication and networking (AS part)
Communication and networks
- Network Types, Topologies and Protocols: Size, Shape and Rules – Networks are grouped by size: PAN (a few metres around one person), LAN (a room, building or campus), MAN (a city) and WAN (a country or the world). A topology is the layout of how nodes are wired: bus (all on one backbone cable), star (all to a central hub or switch) and tree (stars joined in levels). A protocol is a set of rules: TCP/IP breaks and routes data on the Internet, HTTP and HTTPS carry web pages, FTP moves files, SMTP sends email, POP3 downloads email, PPP links two devices directly, TELNET logs into a remote computer, and VoIP carries voice calls over the Internet.