Mission 1 · Spec 4.6.1 – 4.6.4
Software, languages and translators
Hardware and software, system and application software, the role of the operating system, levels of programming language and the three translators.
- Starter 5 min
- Learn 15 min
- Lab 15 min
- Quiz 10 min
- Exam 15 min
Hiding the hardware
A programmer writes open("data.txt") without knowing whether the file is on an SSD, a hard disk or a USB stick. What makes that possible?
Reveal
The operating system hides the complexities of the hardware from the user and programs, providing a simple interface and managing resources.
Key ideas
Software classification
System software: operating systems, utility programs, libraries, translators. Application software: lets users perform tasks.
Role of the OS
Hides the complexities of the hardware and manages resources: processor scheduling, memory management, I/O device management.
Language levels
Low level: machine code (binary) and assembly language (mnemonics), hardware-specific. High level: imperative languages that are portable and easier to write, debug and maintain.
Translators
Assembler: assembly → machine code. Compiler: translates the whole program into object code. Interpreter: translates and executes line by line. Bytecode: intermediate code run by a virtual machine, making programs portable.
Compiler vs interpreter race
Classify the software
Exam-style questions
1. Explain why an interpreter might be used during development but a compiler for the final product.
[4 marks]Mark scheme
- An interpreter runs code immediately / stops at errors, so testing and debugging are quicker (1)
- No separate compilation step is needed after each change (1)
- A compiler produces an executable that runs faster (1)
- The executable can be distributed without the source code / without the translator (1)
2. Explain what bytecode is and why it is used.
[2 marks]Mark scheme
- An intermediate code produced by a compiler, executed by a virtual machine / interpreter (1)
- so the same code can run on different platforms (portability) (1)
TUTOR NOTES
- Misconception: "imperative" is a type of low-level language. AQA uses it for high-level languages made of commands.
Mission 2 · Spec 4.6.5 – 4.6.6
Logic gates and Boolean algebra
NOT, AND, OR, XOR, NAND and NOR gates; logic circuits and truth tables; Boolean identities and De Morgan's laws; adders and D-type flip-flops.
- Starter 5 min
- Learn 20 min
- Lab 25 min
- Quiz 10 min
- Exam 15 min
One gate to rule them all
A chip factory can only make one type of gate. Is it possible to build any circuit using only NAND gates?
Reveal
Yes. NAND (and NOR) are universal gates: NOT, AND and OR can all be built from them, and so can any circuit.
Key ideas
Gates and notation
AQA notation: A.B (AND), A + B (OR), A (NOT), A ⊕ B (XOR). NAND = NOT (A.B); NOR = NOT (A + B).
Boolean identities
A.0 = 0 · A.1 = A · A.A = A · A.A = 0
A + 0 = A · A + 1 = 1 · A + A = A · A + A = 1
Absorption: A + A.B = A
De Morgan's laws
A.B = A + B
A + B = A.B
Adders and flip-flops
Half adder: sum = A ⊕ B, carry = A.B. Full adder adds a carry in; chains of full adders add n-bit numbers. An edge-triggered D-type flip-flop stores one bit, used in registers and memory.
Gate playground
Circuit builder
Simplification checker
Type expressions using . + and ! (or ∧ ∨ ¬).Half and full adders
D-type flip-flop
Exam-style questions
1. Simplify A.B + A.B.
[2 marks]Mark scheme
- A.(B + B) (1)
- = A.1 = A (1)
2. Show how a NOT gate can be made from a NAND gate.
[1 mark]Mark scheme
- Connect both inputs of the NAND gate to the same signal A: output is NOT (A.A) = A (1)
TUTOR NOTES
- Checker: type
A.B + A.!BandAin the simplification checker to confirm Q1.