UNIHIVE

Study Hub UNIPORT MEG 202

MEG 202 · Basic Software Engineering

Introduction to computer architecture

The von Neumann model, the CPU and fetch-decode-execute cycle, buses, the memory hierarchy and performance.

Our notes

2 min read

The von Neumann architecture

Almost all general-purpose computers follow the stored-program design described by John von Neumann (1945):

  1. A CPU (control unit + ALU + registers).
  2. A single memory holding both instructions and data.
  3. Input and output devices.
  4. Buses connecting them.

Instructions are fetched from memory one after another unless a jump changes the order. The single path between CPU and memory limits speed: the von Neumann bottleneck. The Harvard architecture uses separate memories for instructions and data (common in microcontrollers and DSPs).

The CPU

  • ALU: performs arithmetic (add, subtract) and logic (AND, OR, NOT, compare).
  • Control unit: decodes instructions and sends control signals.
  • Registers: tiny, very fast storage: the program counter (PC) (address of the next instruction), the instruction register (IR), the memory address register (MAR), the memory data register (MDR), the accumulator and general-purpose registers, and a status (flags) register (zero, carry, overflow, negative).
  • Clock: sets the pace; speed in GHz (billions of cycles per second).

The fetch-decode-execute cycle

  1. Fetch: PC → MAR; the instruction at that address comes to the MDR and then the IR; PC increases to point to the next instruction.
  2. Decode: the control unit works out the operation and operands.
  3. Execute: the ALU computes, data moves, or the PC changes (for a jump).
  4. Repeat.

Modern CPUs pipeline this (fetch the next instruction while executing the current one) and execute several instructions at once.

Buses

  • Address bus: carries memory addresses (one-way, CPU to memory). Its width sets how much memory can be addressed: 32 bits → 2³² = about 4.3 billion locations.
  • Data bus: carries data (two-way); its width is the word size (32 or 64 bits).
  • Control bus: carries signals (read, write, clock, interrupt).

The memory hierarchy

LevelSpeedSizeCost per byte
Registersfastestbyteshighest
Cache (L1, L2, L3)very fastKB to MBhigh
Main memory (RAM)fastGBmoderate
Secondary storage (SSD, HDD)slowhundreds of GB to TBlow
Archive (tape, cloud)slowestvery largelowest

Cache works because programs reuse nearby data and instructions (locality of reference).

Instruction sets

  • CISC (complex instruction set, such as x86 in most PCs): many complex instructions.
  • RISC (reduced instruction set, such as ARM in phones and many embedded chips): few simple instructions, each fast.

Performance

Depends on clock speed, instructions per cycle, number of cores, cache size, memory speed and software. A higher GHz figure alone does not mean a faster computer.

Exams usually ask

  • Draw and explain the von Neumann architecture.
  • Describe the fetch-decode-execute cycle with the registers involved.
  • Explain the memory hierarchy and why cache improves speed.

Common mistake

Thinking RAM keeps data when the power is off. RAM is volatile; files must be saved to secondary storage.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All MEG 202 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.