Central Processing Unit (CPU)
1. Von Neumann Architecture
Definition: The Von Neumann architecture consists of a single, shared memory for program and data.
Main parts: ① CPU (control unit + ALU + registers) · ② Memory · ③ Input / Output devices. Think of it like the human body — the CU is the brain, directing everything.
Data = values (e.g. A = 10) | Program = instructions (e.g. ADD) that work on that data. Von Neumann keeps both in the same memory.
2. Control Unit (CU)
- Directs and co-ordinates other parts of the computer system (sends signals to hardware, buses, I/O)
- Controls operations of the computer system
- Fetches computer instructions
- Decodes each instruction (so the computer can understand it)
- Executes these instructions
Fetch → Decode → Execute are the 3 steps (more detail in the fetch-execute cycle).
3. Arithmetic Logic Unit (ALU)
The name gives you both jobs — Arithmetic + Logic. Always write every point.
- A unit which performs arithmetic operations ( + − × ÷ )
- and bit-shifting operations (left shift, right shift)
- Logic operations (AND, OR, XOR)
- Designed to perform integer calculations
4. Operand & Opcode
Operand: part of the computer instruction which specifies what data is to be processed (either the data itself or the address of the data).
Opcode: is the instruction that is executed by the CPU (what to do to the data).
5. Registers
- Small piece of memory
- Part of the processor
- Temporary storage of data which is about to be / has been processed
Why registers? The CPU is much faster than main memory, so they can't keep the same pace. Registers are tiny but very fast memory (a few bits — built from flip-flops, A2). Data is moved into registers and the CPU takes it from there.
General purpose vs special purpose registers
| General purpose registers | Special purpose registers |
|---|---|
| Hold the temporary data while performing different operations | Hold the status of a program (not data being processed) |
| e.g. ACC (accumulator) | e.g. PC, MAR, MDR, CIR, status register |
6. Special Purpose Registers
You must be able to explain the purpose of each. Relate them to this example — memory contents and the registers during a fetch:
| Register | Stores… |
|---|---|
| PC — Program Counter | the address of the next instruction to be fetched |
| MAR — Memory Address Register | the memory address where data is to be read from |
| MDR — Memory Data Register | the data that has just been read from memory |
| CIR — Current Instruction Register | the instruction that is currently being executed |
| IX — Index Register | used for indirect addressing (see assembly language) |
| ACC — Accumulator | the register where the data is worked on (a general purpose register) |
| Status register | is interpreted as independent flags; each flag is set depending on an event |
Order of running follows the assembly program's sequence, not memory-address order (jumps/branches can go anywhere).
Accumulator (ACC): every add, subtract, increment, decrement result sits temporarily in ACC while being processed; to keep it permanently you STOre it to an address (assembly instruction).
Status register: works like a set of flags (each 0 or 1) that record the state of the CPU / a program, e.g. the interrupt flag. It stores status, not data.
7. System Clock
- Every computer contains an internal clock that regulates the rate at which the instructions are executed
- The CPU requires a fixed number of clock cycles to execute each instruction
- Used to synchronise all the operations
Some instructions take 1 cycle, others 5, 6, 7 … — the clock keeps everything in step. Clock speed = how many cycles/pulses per second, measured in hertz (Hz) — e.g. 2.2 GHz = about 2.2 billion cycles every second. It differs from CPU to CPU.
8. Buses — How data moves between components
Question: How is data transferred between the various components of the computer system? → using three buses (sets of wires): data, address, control.
| Bus | Direction | What it carries |
|---|---|---|
| Data bus | Bi-directional (two-way) | Carries data between processor and memory; used to exchange data (give + take) |
| Address bus | Uni-directional (one-way) | Carries signals related to memory addresses between processor and memory |
| Control bus | Bi-directional | Transmits signals between the control unit and other components |
9. Components & Buses inside a Typical Computer
Key points to consider while solving a picture question
- ALU & CU will have a direct bi-directional connection ⟷
- Main memory will have a direct connection with the general purpose registers ⟷ (two-headed arrow)
- System clock will have a uni-directional connection → CU (arrowhead points at the control unit)
- Data bus (bi-directional): it will only have a connection with memory and general purpose registers
- Control bus: drawn as a uni-directional arrow ⟶ on the board; it is the one linked with the control unit (signals between CU and other components)
- Address bus will be connected from main memory till the GPR and it will also have a connection with the control unit
10. Factors Affecting Computer Performance
9608 had only bus width and clock speed. 9618 added cache memory and number of cores (cores has already been asked; cache not yet). Learn all 4, three points each.
① Data bus width
- The width of a bus determines the number of bits that can be simultaneously transferred
- Increasing the width of a data bus increases the number of bits that can be transferred
- Hence improves processing speed as fewer transfers are needed
"Fewer transfers": if 5 bits move per transfer, 15 bits need 3 transfers; a wider bus moves more per transfer → fewer transfers needed → processing speed increases.
② Clock speed
- One F-E cycle is run on each clock pulse
- So the clock speed dictates the number of instructions that can be run per second
- The faster the clock speed, the more instructions can be run per second
- So the processing speed would increase
Clock speed measured in Hz (GHz = billions of pulses/second). Don't try software over-clocking tools without knowledge — you can burn the CPU.
③ Cache memory
- Can also improve processor performance; it is similar to RAM — cache uses SRAM
- So it has a faster access time as there is no need to keep refreshing
- Cache memory stores frequently used instructions and data that need to be accessed faster
- This improves processor performance
Repeated instructions are kept in this small, fast temporary memory so the CPU doesn't wait for slower main memory each time.
④ Number of cores
- Each core processes one instruction per clock pulse
- More cores mean the sequence of instructions can be split between them, so more than one instruction is executed per clock pulse
- More cores decreases the time taken to complete a task
11. Ports
- Acts as an interface between computers and other peripheral devices (input/output devices)
- The female part of the connection — the cable end plugs into it
USB — benefits of connecting peripheral devices using a USB port
| Benefit (state) | Explain |
|---|---|
| Fast data transfer | useful when transferring large files such as video files (very high speed) |
| Automatic connection / Plug and Play | so usually there is no need to install separate drivers (drivers tell the PC what the device's buttons/functions do; USB drivers are already built in) |
| USB is now an industrial standard | All new computers will be equipped with a USB port (every manufacturer includes one) |
| Device may be powered or charged through USB | External devices could be charged while working at the computer — USB carries data and power (fibre optic carries only data) |
High Definition Multimedia Interface (HDMI)
- Helps to connect more monitors
- HDMI ports allow to output both audio and visual
- They support high definition signals
- Faster data transfer
- HDMI increases the bandwidth, making it possible to supply the necessary data for high quality sound and visual effects
Advantages of HDMI
- Current standard for modern televisions and monitors
- Allows for a very fast data transfer rate
- Improved security, helps prevent piracy by the help of HDCP
- Supports modern digital systems
Disadvantages of HDMI
- Not a very robust connection (easy to break the connection when simply moving devices — the head bends/breaks)
- Limited cable length
Video Graphics Array (VGA)
Blue 15-pin connector with two screws to fix it in place. Learn both lists — write as much as you can (mark scheme unknown).
Advantages of VGA
- Simpler technology (old, so lots of information/resources)
- Only one standard available (unlike USB 2.0 / 3.0)
- Easy to split the signals (splitter) and connect a number of devices from one source — e.g. 3–4 monitors
- The connection is very secure (screws hold it in)
- VGA supports a higher refresh rate (about 60 Hz, though lower than HDMI)
Disadvantages of VGA
- It does not support audio (video only)
- Outdated — modern laptops and computers rarely have a VGA port
- Easy to bend the pins when making connections
12. Fetch-Execute Cycle
Uses the registers — learn the order like a story, in your own words. Data starts on HDD → RAM → registers.
- PC holds the address of the next instruction to be fetched
- The address in the program counter is copied to the MAR
- The program counter is incremented (by 1 — ready for the next instruction)
- The instruction is copied from the address stored in MAR to the MDR
- Then the instruction from the MDR is copied to the CIR
Register-transfer notation (RTN)
PC ← [PC] + 1
MDR ← [[MAR]]
CIR ← [MDR]
The third instruction MDR ← [[MAR]] has double brackets. State the purpose of the double brackets.
Idea: MAR holds an address, not the data — we need what is at that address.
Answer: The content of MAR is an address; it is the contents of that address which is transferred to MDR.
13. Concept of Interrupt
What is meant by interrupt?
- A signal from a source / device
- Telling the processor that its attention is needed
"Interrupt" = a break/stoppage. Something more urgent interrupts the work being done, e.g. battery about to die while a lecture is running → interrupt signal → processor attends to it first.
- Printer out of paper
- No CD in drive
- (also: USB not detected, mouse not connecting)
- Run-time error
- A running program needs input
- (also: logic / programming errors)
Explain how the processor handles an interrupt (5–6 marks)
- At the start of each fetch-execute cycle the processor checks for interrupt
- Checks if an interrupt flag is set (flag 0 = no interrupt, 1 = interrupt)
- Processor identifies the source of the interrupt
- Processor checks the priority of the interrupt
- If interrupt priority is high enough, the lower priority interrupts are disabled
- Processor saves the current content of registers
- Processor calls the ISR (Interrupt Service Routine)
- The address of the ISR is loaded in the PC (Program Counter)
- When servicing of the interrupt is complete, the processor restores the registers
- Lower priority interrupts are re-enabled
- Processor continues the F-E cycle
ISR = Interrupt Service Routine — the "solution" for that particular interrupt. Every interrupt has its own ISR (battery problem → battery ISR; paper jam → printer ISR). They are listed in an interrupt dispatch table, and each interrupt has a priority level (1, 2, 3 …) — details in A2.
Give three different events that can generate an interrupt.
Just name the events. Others that fit: USB not detected / driver missing, peripheral (I/O) device request, programming or run-time errors.
Answer: hardware faults · I/O requests · software errors
Quick Recap — Full Chapter Cheat-Sheet
- Von Neumann: single shared memory for program and data
- CU: directs & co-ordinates · controls operations · fetches, decodes, executes instructions
- ALU: arithmetic (+ − × ÷) · bit shifting · logic (AND, OR, XOR) · integer calculations
- Operand = what data is processed · Opcode = instruction executed by CPU
- Register: small piece of memory, part of processor, temporary storage. GPR = temporary data during operations (ACC) · SPR = status of a program (PC, MAR, MDR, CIR, status reg.)
- PC address of next instruction · MAR address data is read from · MDR data just read · CIR instruction being executed · IX indirect addressing · ACC where data is worked on · Status reg. independent flags set by events
- System clock: regulates rate of instruction execution · fixed number of cycles per instruction · synchronises all operations
- Data bus bi-directional, processor ⟷ memory (only memory + GPR in diagrams) · Address bus uni-directional, memory addresses · Control bus signals between CU and other components
- Diagram clues: ALU ⟷ CU · memory ⟷ GPR · clock → CU (one-way) · address bus also touches CU
- Bus width ↑ → more bits per transfer → fewer transfers · Clock speed ↑ → more F-E cycles/sec (limit = heat) · Cache (SRAM, no refresh) holds frequently used data/instrs · More cores → more instrs per clock pulse, less time
- Port = interface between computer and peripherals, female connector
- USB: fast transfer · plug & play (no drivers) · industrial standard · power/charge devices
- HDMI + current standard · fast · HDCP security · modern digital · audio + video, HD, more monitors − not robust · limited cable length
- VGA + simple · one standard · easy to split · secure (screws) · higher refresh rate − no audio · outdated · pins bend
- MAR ← [PC] · PC ← [PC] + 1 · MDR ← [[MAR]] · CIR ← [MDR] (double brackets = contents of the address held in MAR)
- Interrupt = signal from a source/device telling the processor its attention is needed. Hardware: printer out of paper, no CD · Software: run-time error, program needs input
- Handling: check flag at start of each F-E cycle → identify source → check priority (disable lower) → save registers → call ISR → ISR address in PC → restore registers → re-enable lower → continue F-E
- 3 events: hardware faults · I/O requests · software errors