Systems Architecture
The von Neumann architecture, every register named in the specification, the fetch execute cycle in full, the three factors affecting CPU performance and what an embedded system actually is.
The von Neumann architecture
Almost every computer follows the von Neumann architecture, whose defining feature is the stored program concept: instructions and data are held in the same memory, and instructions are fetched from that memory one at a time and executed.
Before this, changing what a machine did meant physically rewiring it. The stored program concept is why one laptop can be a word processor, a games console and a compiler without any physical change at all.
The consequence is the von Neumann bottleneck: because instructions and data share one bus to memory, they compete for it, and the processor can spend a substantial part of its time waiting.
- The program counter holds the address of the next instruction.
- That address goes to memory along the address bus.
- The instruction comes back along the data bus and lands in the MDR.
- The control unit decodes it and works out what has to happen.
- The ALU executes it, and the program counter moves on by one.
Registers and the fetch execute cycle
A register is a very small, extremely fast storage location inside the CPU holding one value. AQA names four.
| Register | Full name | Holds |
|---|---|---|
| PC | Program Counter | The address of the next instruction to be fetched |
| MAR | Memory Address Register | The address currently being read from or written to |
| MDR | Memory Data Register | The data or instruction just fetched, or about to be written |
| ACC | Accumulator | The result of the most recent calculation |
The names say so. Swapping them is one of the most commonly penalised errors on this topic, and it is entirely avoidable.
The fetch execute cycle
Fetch
- The address in the PC is copied into the MAR.
- The PC is incremented, so it already points at the next instruction.
- The address in the MAR travels out along the address bus, and the instruction at that address comes back along the data bus into the MDR.
Decode
- The instruction in the MDR is decoded by the control unit, which works out what operation is required and what data it applies to.
Execute
- The instruction is carried out. If it is a calculation the ALU performs it and the result goes into the accumulator. If it is a jump, a new address is written into the PC.
Then the cycle repeats, billions of times a second.
Not at the end of the cycle. If it waited, a jump instruction executed later would have its new address immediately overwritten.
Step 1 of 7 Fetch: the address in the program counter is copied into the MAR.
CPU performance and embedded systems
Three factors affect how much work a processor gets done, and questions almost always ask you to compare two of them.
Clock speed
The clock generates pulses, and one instruction stage happens per pulse. A 3 GHz processor produces three billion pulses a second. Doubling the clock speed roughly doubles the instructions completed per second, but power consumption and heat rise faster than the speed does, which is why clock speeds stopped climbing.
Number of cores
A core is a complete processing unit. A quad core processor can genuinely execute four instructions at the same instant.
It rarely gives four times the performance, for two reasons worth stating: not all software is written to split work across cores, and some tasks are inherently sequential because each step needs the result of the last.
Cache size
Cache is small, very fast memory inside or extremely close to the CPU holding recently and frequently used instructions and data. Fetching from cache takes a fraction of the time of fetching from RAM.
More cache means more of what the processor needs is already close by, so it spends less time waiting. Cache is expensive per byte, which is why there is not simply more of it.
Cache does not make the processor faster. It reduces the time the processor spends waiting, so more instructions are completed per second.
Embedded systems
An embedded system is a computer built into a larger device to perform one specific, dedicated task: the controller in a washing machine, a microwave, a traffic light, a pacemaker, a digital camera.
Because the task is fixed, an embedded system can use a much less powerful processor, very little memory and no general purpose operating system. That makes it cheaper, more reliable and far more power efficient than a general purpose computer would be. The trade off is that it cannot be repurposed: a washing machine controller will never run anything else.
- Clock speed: how many cycles the processor runs each second.
- Cores: how many instructions it can genuinely work on at once.
- Cache: fast memory on the chip, so it waits for RAM less often.
- A bigger number is not automatically a faster computer.
Key terms you must be able to define
- Von Neumann architecture
- A design in which instructions and data share the same memory and instructions are fetched one at a time.
- Stored program concept
- The idea that a program is held in memory alongside its data rather than being wired into the machine.
- Register
- A very small, very fast storage location inside the CPU holding a single value.
- Program Counter
- The register holding the address of the next instruction to be fetched.
- Memory Address Register
- The register holding the address currently being read from or written to.
- Memory Data Register
- The register holding data or an instruction that has just been fetched or is about to be written.
- Accumulator
- The register holding the result of the most recent calculation.
- Clock speed
- The number of clock pulses per second, measured in hertz.
- Core
- A complete processing unit within a CPU, able to execute instructions independently.
- Cache
- Small, very fast memory close to the CPU holding recently and frequently used data and instructions.
- Embedded system
- A computer built into a larger device to carry out one dedicated task.
Flashcards
Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.
Reach the top grade on this topic
This is the topic where naming things precisely is worth the most.
Use the register names as part of the sentence. "The address held in the Program Counter is copied into the MAR, and the instruction at that address returns along the data bus into the MDR" is a full mark answer. "The CPU gets the instruction from memory" is one mark at best.
Explain performance as work completed, not as speed. Cache reduces waiting. More cores allow genuine parallel execution but only where the software can use it. Clock speed raises the rate of stages but costs heat.
Qualify the multi core claim. A grade 9 answer says four cores do not give four times the performance because some tasks are sequential and not all software is written to use them.
Mistakes that cost marks here
- Swapping MAR and MDR. The Address Register holds an address, the Data Register holds data.
- Saying the Program Counter is incremented at the end of the cycle. It is incremented during fetch.
- Writing that cache makes the CPU faster. It reduces the time the CPU spends waiting.
- Claiming a quad core processor is always four times faster. It depends entirely on the software and the task.
- Describing an embedded system as simply a small computer. It is dedicated to one task, which is the point.
The clock speed of desktop processors stopped climbing around 2005, not because engineers ran out of ideas but because the heat produced rises faster than the speed does. Adding cores was the way round the wall.
Knowledge check
Exam-style questions
Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.
- LIt holds the address of the next instruction to be fetched
The Program Counter holds the memory address of the next instruction to be fetched from memory.
- LThe address in the Program Counter is copied into the MAR
- LThe Program Counter is incremented
- LThe address travels out on the address bus to main memory
- LThe instruction returns on the data bus into the MDR
The address held in the Program Counter is copied into the Memory Address Register. The Program Counter is then incremented, so that it already holds the address of the following instruction. The address in the MAR travels out along the address bus to main memory, and the instruction stored at that address is returned along the data bus into the Memory Data Register, from where it is passed to the control unit to be decoded.
- LClock speed determines how many instruction stages happen per second
- LA higher clock speed means more instructions completed in the same time
- LCache size affects how often the CPU has to wait for main memory
- LMore cache means less waiting, so more instructions are completed per second
The first factor is clock speed, which is the number of pulses the clock generates each second. One stage of the fetch execute cycle happens per pulse, so a processor running at 3 GHz gets through three billion stages a second and a faster clock means more instructions completed in the same time. The second is cache size. Cache is small, very fast memory close to the processor holding recently and frequently used data and instructions, and fetching from it takes a fraction of the time of fetching from RAM. A larger cache means more of what the processor needs is already close by, so it spends less time waiting for main memory and completes more instructions per second. Note that cache does not change the clock speed: it reduces idle time.
- LNot all software is written to divide work across multiple cores
- LSome tasks are sequential, so each step needs the result of the previous one
- LSo the additional cores may be idle for part of the time
Adding cores only helps when there is work that can genuinely run at the same time. A great deal of software is written to run as a single sequence of instructions and simply will not use more than one core, so the extra cores sit idle while it runs. Even in software that is written for multiple cores, some tasks are inherently sequential, because each step needs the result of the one before it and cannot start until that result exists. Doubling the number of cores therefore doubles the theoretical maximum but rarely doubles the performance actually seen.
- LIt is designed to carry out one specific dedicated task
- LIt does not need to run a range of different software or a full operating system
- LSo it needs less processing power and memory, which makes it cheaper and more power efficient
An embedded system exists to perform one fixed task within a larger device, such as running the wash cycle in a washing machine. Because that task never changes, the system does not have to run arbitrary software, does not need a full general purpose operating system and does not need to handle whatever a user might install next. The single program it runs can be written to fit the hardware exactly, so a modest processor and a very small amount of memory are sufficient. That makes the device cheaper to manufacture, more reliable because there is far less that can go wrong, and much more power efficient, which matters when the controller must run continuously.