KS41CP2 3.1 30 min read 10 question quiz 12 exam marks

Hardware and the Processor

The components of a computer system, the von Neumann architecture, the fetch decode execute cycle, and what actually makes one processor faster than another.

Components of a computer system

Every computer system has the same shape: input, process, output, with storage alongside.

  • Input devices bring data in: keyboard, mouse, microphone, sensor, camera.
  • The CPU processes it.
  • Output devices present the results: screen, printer, speaker, motor.
  • Memory holds what is being worked on now.
  • Secondary storage holds it permanently.

The von Neumann architecture

Almost every computer follows the von Neumann architecture, whose central idea is the stored program concept: instructions and data are held in the same memory, and instructions are fetched one at a time to be executed.

Before this, a machine had to be rewired to do a different job. The stored program concept is why one laptop can be a browser, a compiler and a game without any physical change.

The cost is the von Neumann bottleneck: instructions and data share one route to memory, so they compete for it and the processor spends part of its time waiting.

A motherboard with its main parts labelledA desktop motherboard seen from above, showing the square processor socket, four long memory slots beside it, expansion slots along the bottom edge and the chipset heatsinks.processor socketthe chip plugs in herememory slotsone stick per slotchipset heatsinklinks the parts togetherexpansion slotsgraphics and network cardspower connectorfeeds every partportsUSB, network, audiobatterykeeps the clock running
Every component plugs into this one board, and the tracks between them are the buses.Drawn illustration

Inside the CPU

ComponentJob
Control unitDecodes instructions and sends the control signals that coordinate everything else
Arithmetic logic unitPerforms all calculations and all comparisons
RegistersVery small, very fast stores inside the CPU, each holding one value
CacheSmall, very fast memory holding recently and frequently used data and instructions
BusesThe connections carrying addresses, data and control signals

The registers that matter

  • Program counter (PC): the address of the next instruction to be fetched.
  • Memory address register (MAR): the address currently being accessed.
  • Memory data register (MDR): the data or instruction being moved to or from memory.
  • Accumulator (ACC): the result of the most recent calculation.
MAR holds an address, MDR holds data

The names tell you. Swapping them is the most commonly penalised error on this topic.

The fetch decode execute cycle

Fetch

  1. The address in the PC is copied into the MAR.
  2. The PC is incremented.
  3. The address goes out on the address bus and the instruction returns on the data bus into the MDR.

Decode

  1. The control unit works out what the instruction means and what it applies to.

Execute

  1. The instruction is carried out. A calculation is done by the ALU and the result goes into the accumulator. A jump writes a new address into the PC.

Then it repeats, billions of times a second.

Components of the CPU and the three busesThe central processing unit contains a control unit which decodes instructions and coordinates the other components, an arithmetic logic unit which performs calculations and comparisons, a set of registers holding the program counter, memory address register, memory data register, current instruction register and accumulator, and cache holding recently used data and instructions. The CPU connects to main memory and to input and output devices through three buses. The address bus carries addresses one way out of the processor, the data bus carries data and instructions in both directions, and the control bus carries control signals in both directions.CENTRAL PROCESSING UNITControl Unitdecodes and coordinatesArithmetic Logic Unitcalculates and comparesREGISTERSPCMARMDRCIRACCCacheMain memoryRAMInput and outputdevicesAddress busone way, out of the CPUData bustwo wayControl bustwo way
The address bus is one way because addresses only ever travel out of the processor. The data bus is two way because data travels in both.
The fetch decode execute cycleA seven stage walk through the fetch decode execute cycle. In fetch, the address in the program counter is copied into the memory address register, the program counter is incremented, the address travels out on the address bus to main memory, and the instruction returns on the data bus into the memory data register and then the current instruction register. In decode, the control unit splits that instruction into an opcode saying which operation to perform and an operand giving the data or its address. In execute, the instruction is carried out and any result from the arithmetic logic unit is placed in the accumulator with the status flags updated. Control then returns to fetch and the whole cycle repeats, around three billion times a second on a 3 gigahertz processor.CENTRAL PROCESSING UNITPCMARMDRCIRControl Unit + ALUMAIN MEMORY0x04A ADD 120x04B STA 20address busdata busPC → MARPC = PC + 1address out on the address businstruction back on the data bus → MDR → CIRopcode + operandcarry it out, update the flagsrepeat
Step through the cycle. Naming the registers and buses in this order is what turns a one mark answer into a full mark one.
The fetch decode execute cycle inside the processorThe processor on the left, with main memory on the right, joined by three buses. Inside the processor are the program counter, the memory address register, the memory data register, the current instruction register, the control unit and the arithmetic logic unit. The cycle runs like this. The program counter holds the address of the next instruction, here 0x04A. That address is copied into the memory address register and sent to memory along the address bus, which is one way. Memory sends the contents of that address, here the instruction LDA 7, back along the data bus into the memory data register, and it is copied to the current instruction register. The control unit decodes the instruction and works out what has to happen, sending signals along the control bus when memory is involved. The arithmetic logic unit carries it out, and the program counter moves on by one.CENTRAL PROCESSING UNITPCprogram counter0x04AMARmemory address0x04ACIRcurrent instructionLDA 7MDRmemory dataLDA 7CUcontrol unitdecodesALUarithmetic logic unitadds, compares, ANDsaddress busdata buscontrol busMain memory (RAM)0x049ADD 30x04ALDA 70x04BSTA 90x04CJMP 2a real memory module12345
  1. The program counter holds the address of the next instruction.
  2. That address goes to memory along the address bus.
  3. The instruction comes back along the data bus and lands in the MDR.
  4. The control unit decodes it and works out what has to happen.
  5. The ALU executes it, and the program counter moves on by one.
Address out, data back, control alongside. The address bus is one way: memory never sends an address to the CPU.
A processor, from above and from belowA processor chip lying face up out of its socket, with the heat spreader on top and hundreds of gold contact pads covering the underside.topunderneaththe metal lid is a heat spreaderthe silicon is a few millimetres wide, beneath ithundreds of gold contact padsthey press onto the socket's pinspin 1 marker
The metal lid is a heat spreader, not the processor. The silicon doing the work is a square a few millimetres across underneath it.Drawn illustration

What makes a processor faster

Clock speed

The clock produces pulses and one stage of the cycle happens per pulse. A 3 GHz processor produces three billion pulses a second, so a higher clock speed means more instructions completed per second. Heat and power consumption rise faster than speed does, which is why clock speeds stopped climbing around 2005.

Number of cores

A core is a complete processing unit. A quad core processor can genuinely execute four instructions simultaneously.

It rarely gives four times the performance. Some tasks are sequential, because each step needs the result of the last, and much software is not written to divide work across cores at all.

Cache size

Cache holds recently and frequently used instructions and data close to the processor, where they can be reached far faster than main memory. More cache means the processor waits for RAM less often.

The framing that earns the mark

Cache does not make the processor faster. It reduces the time the processor spends waiting, so more instructions are completed each second.

Embedded systems

An embedded system is a computer built into a larger device to do one dedicated task: a washing machine controller, a traffic light, a pacemaker. Because the task never changes it can use a modest processor and very little memory, which makes it cheap, reliable and power efficient, at the cost of being unable to do anything else.

What decides how fast a processor is: clock speed, cores and cacheThe three things that decide how fast a processor is. Clock speed is how many cycles it runs each second, measured in gigahertz, and 3.6 GHz means three thousand six hundred million cycles a second; each cycle can carry out part of an instruction, so more cycles means more work done, as long as nothing else is holding it up. The number of cores is how many instructions it can genuinely process at the same time, since each core is a complete processor; four cores can work on four jobs at once, but only if the work can be split up. Cache is a small amount of very fast memory on the processor chip, about a nanosecond away, where the processor keeps what it is likely to need next, so it waits for main memory, about a hundred nanoseconds away, less often. A bigger number on one of these is not automatically a faster computer, because the other two, and the software, can hold it back.Clock speedCoresCache3.6 GHz3,600,000,000 cyclesevery secondmore cycles = more done12344 cores4 jobs at the same momentif the work can be splitL1cache: ~1 nsRAM: ~100 nsCachememory on the chip itselfwaits for RAM less often!A bigger number is not automatically a faster computer.Cores that cannot be kept busy, or a slow memory, hold the whole machine back.1234
  1. Clock speed: how many cycles the processor runs each second.
  2. Cores: how many instructions it can genuinely work on at once.
  3. Cache: fast memory on the chip, so it waits for RAM less often.
  4. A bigger number is not automatically a faster computer.
Exam answers that just say ‘higher clock speed is faster’ get one mark. Saying what it does, and what limits it, gets the rest.

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 wired into the machine.
Control unit
The component that decodes instructions and coordinates the rest of the processor.
Arithmetic logic unit
The component that performs calculations and comparisons.
Register
A very small, very fast store inside the CPU holding one value.
Program counter
The register holding the address of the next instruction to be fetched.
Cache
Small, very fast memory close to the CPU holding recently and frequently used data.
Clock speed
The number of clock pulses per second, measured in hertz.
Core
A complete processing unit within a CPU.
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.

DefineVon Neumann architecture
AnswerA design in which instructions and data share the same memory and instructions are fetched one at a time.
DefineStored program concept
AnswerThe idea that a program is held in memory alongside its data rather than wired into the machine.
DefineControl unit
AnswerThe component that decodes instructions and coordinates the rest of the processor.
DefineArithmetic logic unit
AnswerThe component that performs calculations and comparisons.
DefineRegister
AnswerA very small, very fast store inside the CPU holding one value.
DefineProgram counter
AnswerThe register holding the address of the next instruction to be fetched.
DefineCache
AnswerSmall, very fast memory close to the CPU holding recently and frequently used data.
DefineClock speed
AnswerThe number of clock pulses per second, measured in hertz.

Reach the top grade on this topic

This topic is about naming things precisely and explaining performance as throughput.

Use the register names inside the sentence. "The address 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.

Say what performance actually means. More instructions completed per second, not vaguely "faster". Cache reduces waiting. Cores allow genuine parallelism where the software supports it. Clock speed raises the rate of stages.

Qualify multi core claims. Four cores are not four times faster, because sequential tasks and single threaded software cannot use them.

Mistakes that cost marks here

Avoid these
  • Swapping MAR and MDR.
  • Saying the program counter is incremented at the end of the cycle rather than during fetch.
  • Writing that cache increases clock speed. It reduces waiting.
  • Saying more cores always means proportionally more performance.
  • Describing an embedded system as simply a small computer rather than one dedicated to a single task.
Fun fact

A processor running at 3 GHz completes a clock cycle in a third of a nanosecond. In that time light travels about ten centimetres, which is why the physical size of a chip is now a genuine limit on how fast it can run.

Knowledge check

0 of 10 answered
1Which register holds the address of the next instruction to be fetched?
2What is held in the MDR?
3What is the defining feature of the von Neumann architecture?
4Which component performs comparisons such as testing whether one value is greater than another?
5How does a larger cache improve performance?
6Why might a quad core processor not be twice as fast as a dual core one?
7At what point is the program counter incremented?
8What is an embedded system?
9What travels along the address bus?
10Why is the von Neumann bottleneck a limitation?
Score 0 / 10

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.

12 marks
1State the purpose of the accumulator.1 mark
State

Mark scheme0 / 1
  • LIt holds the result of the most recent calculation
Model answer

The accumulator is the register that holds the result of the most recent calculation carried out by the arithmetic logic unit.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
2Describe the fetch stage of the fetch decode execute cycle.4 marks
Describe

Mark scheme0 / 4
  • LThe address in the program counter is copied into the MAR
  • LThe program counter is incremented
  • LThe address is sent out on the address bus
  • LThe instruction is returned on the data bus into the MDR
Model answer

The address held in the program counter is copied into the memory address register. The program counter is then incremented so that it already points to 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, ready to be decoded by the control unit.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
3Explain how increasing the size of the cache can improve the performance of a computer.3 marks
Explain

Mark scheme0 / 3
  • LCache holds recently and frequently used data and instructions close to the CPU
  • LData in cache is accessed far faster than data in main memory
  • LA larger cache means fewer fetches from RAM, so the CPU spends less time waiting
Model answer

Cache is small, very fast memory located inside or extremely close to the processor, holding copies of the instructions and data that have been used recently or are likely to be needed next. Reading from cache takes a small fraction of the time that reading from main memory takes. Making the cache larger means a greater proportion of what the processor asks for is already there, so it has to fetch from RAM less often. Since a fetch from RAM leaves the processor idle while it waits, reducing how often that happens means more instructions are completed each second, which is what performance actually measures.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
4A manufacturer is designing a controller for a microwave oven. Explain why an embedded system is more suitable than a general purpose computer.4 marks
Explain

Mark scheme0 / 4
  • LThe controller carries out one fixed, dedicated task
  • LIt does not need to run other software or a general purpose operating system
  • LSo a modest processor and very little memory are sufficient, which reduces cost
  • LIt is also more reliable and uses less power, which matters for an appliance
Model answer

The controller in a microwave has exactly one job, which is to run the cooking programme, drive the turntable and magnetron and read the keypad. Because that job is fixed and will never change, the system does not need to run arbitrary software and does not need a general purpose operating system to manage whatever a user might install. The single program can be written to fit the hardware precisely, so a very modest processor and a few kilobytes of memory are enough, which makes the component far cheaper to manufacture at the volumes involved. It is also more reliable, since there is very little that can go wrong and no software to become corrupted, and it consumes far less power, which matters in an appliance that is connected to the mains continuously.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
Machine mark 0 / 12