🧠 Hardware & Software

Computer Organisation & the CPU

कंप्यूटर संगठन और CPU

⏱ 2 hr3 topicsInteractive
🎯 By the end: You can describe the parts of a computer's processor, explain what the ALU, CU and registers do, and walk through the instruction cycle.

Every program you'll ever write — in Python or any language — ends up as instructions for one tiny, astonishingly fast chip: the CPU. People call it 'the brain of the computer', and while that's a friendly start, this chapter goes one level deeper so you actually understand what's happening when your code runs.

1The block diagram of a computer

At the highest level, a computer follows a simple flow: it takes input, the CPU processes it (using memory to hold data and instructions), and produces output. This is the classic model proposed by John von Neumann.

InputCPUMemoryOutputdata & instructions

Two ideas from this model matter for the exam:

  • The CPU and memory work together constantly — the CPU fetches instructions and data from memory and writes results back to it.
  • In the von Neumann model, program instructions and data live in the same memory (the 'stored-program' concept).
Key points
  • A computer follows: input → processing (CPU + memory) → output (the von Neumann model).
  • The CPU constantly fetches instructions/data from memory and writes results back.
  • Stored-program concept: instructions and data share the same memory.

2Inside the CPU: ALU, CU and registers

The CPU itself has three key parts. Knowing what each one does is a guaranteed exam question.

PartFull nameJob
ALUArithmetic Logic UnitDoes the actual work — arithmetic (add, subtract) and logic (AND, OR, comparisons).
CUControl UnitThe manager — directs the flow of data, tells the ALU and memory what to do and when. It doesn't process data itself.
RegistersTiny, ultra-fast storage cells inside the CPU that hold the data and instructions being worked on right now.
Registers are the fastest memory in the whole computer — faster than cache or RAM — because they sit right inside the CPU. They're also the smallest and fewest. You'll see why in the Memory & Storage chapter.

Some named registers worth knowing: the Program Counter (PC) holds the address of the next instruction; the Accumulator (AC) holds intermediate results; the Instruction Register (IR) holds the instruction currently being executed.

Key points
  • ALU (Arithmetic Logic Unit) performs arithmetic and logic operations.
  • CU (Control Unit) directs and coordinates — it manages, it doesn't compute.
  • Registers are tiny, ultra-fast storage inside the CPU holding what's being worked on now (PC, AC, IR).

3The instruction cycle: fetch, decode, execute

The CPU runs your program one instruction at a time, repeating the same three-step loop billions of times a second. This is the instruction cycle (or machine cycle):

1
Fetch — the Control Unit gets the next instruction from memory (using the Program Counter to know which one).
2
Decode — the Control Unit works out what the instruction means and what's needed to carry it out.
3
Execute — the ALU performs the operation, and any result is stored (in a register or memory).

Then the cycle repeats for the next instruction. The number of these cycles per second is roughly what 'clock speed' (measured in GHz) describes — a 3 GHz CPU steps about 3 billion times per second.

Remember the order: Fetch → Decode → Execute. A handy phrase: "Find it, figure it out, do it."

Step through one full instruction cycle below and watch which part of the CPU is active at each stage.

CPU Data-Flow Simulator
Input
CPU
Control Unit
ALU
Registers
Memory
Output
Key points
  • The instruction cycle is Fetch → Decode → Execute, repeated continuously.
  • Fetch (get instruction) and Decode are run by the Control Unit; Execute is done by the ALU.
  • Clock speed (GHz) is roughly how many cycles the CPU performs per second.

★ Practical: trace a calculation

On paper, describe what happens inside the CPU when a program runs the statement total = 5 + 3:

  1. Which part fetches and decodes the 'add' instruction?
  2. Which part actually performs 5 + 3?
  3. Where is the result (8) held immediately after the calculation?
  4. Name the three steps of the cycle that just took place, in order.

Ready for the chapter test?

Answer 5 questions. Score 60% or more to mark this chapter complete.

Start the test →

💡 Log in to save your progress and earn the certificate.