Von Neumann architecture, registers and buses

A-Level Computer Science · Hardware and Processor Fundamentals

The stored-program idea

In a von Neumann machine, instructions and data are held in the same memory and travel on the same buses. That is what makes a computer general-purpose — change the program, change the machine. It is also the source of the von Neumann bottleneck: the processor cannot fetch an instruction and its data at the same instant.

Inside the CPU

The control unit decodes instructions and generates the timing signals. The ALU performs arithmetic and logic. Registers, each with one job:

• PC (program counter) holds the address of the next instruction.
• MAR (memory address register) holds the address being accessed.
• MDR (memory data register) holds the data or instruction just fetched, or about to be written.
• CIR (current instruction register) holds the instruction being executed.
• ACC (accumulator) holds the result of ALU operations.
• Status register holds flags such as carry, negative and overflow.

Three buses

The address bus is unidirectional and its width sets the maximum addressable memory ($n$ lines address $2^n$ locations). The data bus is bidirectional and its width sets how many bits move per transfer. The control bus carries signals such as read, write, clock and interrupt request.

What actually makes a processor faster

Clock speed, number of cores, cache size and word length all contribute, and each has a limit. More cores only help software written to use them; a larger cache helps until the working set fits; a faster clock produces more heat. Exam answers must name the limit, not just the benefit.

Kien truc von Neumann — ba bus noi tat caCPUCU · ALUPC · MAR · MDRCIR · ACCBO NHO CHINHlenh VA du lieunam chung mot chobus dia chi (1 chieu)bus du lieu (2 chieu)bus dieu khienNut co chai von Neumann: lenh va du lieu dung CHUNG mot bus-> do rong bus dia chi quyet dinh dung luong nho toi da-> do rong bus du lieu quyet dinh moi lan chuyen duoc bao nhieu bit
The three buses are three different exam questions: the address bus asks about maximum memory, the data bus asks about throughput, the control bus asks about interrupts and read/write signals.

Worked example: calculating memory capacity from bus width

A computer has a $20$-line address bus and a $16$-line data bus.

(a) Calculate the maximum number of addressable memory locations. (b) If each location holds one byte, what is the maximum memory capacity? (c) If the address bus is widened to $24$ lines, by what factor does the maximum capacity increase?

Solution

(a) $n$ address lines give $2^n$ combinations, each combination being one address.

$2^{20}=1\,048\,576$ locations, that is $1$ Mi locations.

(b) One byte per location ⇒ maximum capacity $=1\,048\,576$ bytes $=\mathbf{1}$ MiB.

Note: the $16$-line DATA bus has no effect on this question. It tells you that $16$ bits are transferred at a time, so two locations can be fetched in one go; that is a matter of throughput, not capacity.

(c) $2^{24}=16\,777\,216$ locations, that is $16$ MiB.

An increase of $\dfrac{2^{24}}{2^{20}}=2^4=\mathbf{16}$ times.

Lesson about powers. Adding $4$ address lines, which sounds like a small change, multiplies the maximum capacity by $16$. Each added line doubles it. This is also why IPv4 with $32$ bits runs out of addresses while IPv6 with $128$ bits does not: the difference is not four times but $2^{96}$ times.

Common mistake

Using the DATA bus to calculate maximum memory. Capacity is determined by the ADDRESS bus ($2^n$ locations); the data bus only determines how many bits are transferred at a time. Swapping the two loses the whole calculation question.

Key takeaway

Know the role of each register in one short sentence each, remember that the address bus is one-way and determines capacity, and that the data bus is two-way and determines throughput. When talking about performance, always include the limit of the measure.

← Flip-flops and logic circuits in the computer · All A-Level Computer Science lessons · Practice A-Level Computer Science questions (free, instant scoring) · The fetch-decode-execute cycle and interrupts →