IntermediateTopic 56 of 104Electronics & Embedded

CPU architecture

Registers, ALU, control unit and buses execute instructions.

In depth

A CPU has registers, ALU, control unit and buses. The fetch-decode-execute cycle reads instructions from memory, decodes and executes them. Components: program counter, instruction register, stack pointer, flags. Performance depends on clock, IPC and memory.

Key points

  • Datapath
  • Microcode vs hardwired control
  • Endianness
Example

One instruction cycle: PC→address bus→fetch→decode→ALU→write back.

Why it matters

Understanding the CPU's internal parts explains how code runs and why performance behaves as it does.

Where this is used

  • Explaining why a loop slows down when data does not fit in registers.
  • Reading an assembly listing from a compiler.
  • Understanding the stack and call instructions during debugging.

Frequently asked questions

What is CPU architecture?

Registers, ALU, control unit and buses execute instructions.

Why is it important to understand CPU architecture?

Understanding the CPU's internal parts explains how code runs and why performance behaves as it does.

What does the control unit do?

It fetches instructions, decodes them and sends control signals to the ALU, registers and memory to execute each step.

What is a bus?

A set of wires shared between components for addresses, data and control, and the bus width sets how much data can move at once.

How is CPU architecture used in practice?

Typical applications include explaining why a loop slows down when data does not fit in registers, reading an assembly listing from a compiler and understanding the stack and call instructions during debugging.

What should I learn before CPU architecture?

Study "Microprocessor vs microcontroller" first (topic 55 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.

What are the key points of CPU architecture?

Datapath. Microcode vs hardwired control. Endianness.

Can you give an example of CPU architecture?

One instruction cycle: PC→address bus→fetch→decode→ALU→write back.

What comes after CPU architecture?

The next topic is "Instruction set architectures", which builds directly on this one.

How difficult is CPU architecture?

It is classed as Intermediate in Electronics & Embedded (topic 56 of 104). It is an intermediate topic. Work through the beginner topics in Electronics & Embedded first.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.

Related topics