Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 67 ยท Big Picture

Components of a Computer

Tour the main parts of a computer: CPU, RAM, storage, motherboard, chipset, buses and clocks, and see how they talk with a Python model of a bus transfer.

A computer is a team of specialists. The processor computes, memory remembers what is needed right now, storage remembers everything else, and wires connect them all. Understanding who does what, and how fast each member is, explains almost every performance question you will meet later.

This lesson walks through the physical parts of a typical desktop or laptop, then looks at how they communicate over buses under the control of a clock. We finish with a small Python model of a bus transfer so you can see the signals in order.

The processor (CPU)

The central processing unit executes instructions, as described in The Von Neumann Model and the Fetch-Decode-Execute Cycle. A modern CPU is a single silicon chip that contains:

  • Cores: each core is a complete instruction-executing unit. A quad-core chip can run four instruction streams at once.
  • Registers: a few dozen tiny, very fast storage cells per core.
  • Caches: small, fast memories (L1, L2, often a shared L3) that keep copies of recently used data. See Cache Memory Basics.
  • A memory controller and often an integrated graphics unit.

Two numbers describe a CPU at a glance: the clock speed (for example 3.5 GHz, meaning 3.5 billion cycles per second) and the core count. Neither tells the whole story, because how much work is done per cycle varies between designs. Measuring Performance explains why.

Main memory (RAM)

Random access memory holds the programs and data that are running right now. "Random access" means any cell can be reached in about the same time, regardless of position. RAM is volatile: switch the power off and its contents vanish. Typical desktops carry 8 to 64 GiB.

RAM is much larger but much slower than the caches inside the CPU, and the gap is the reason the memory hierarchy exists. The two main kinds are SRAM (fast, used for caches) and DRAM (dense and cheaper, used for main memory), compared in RAM, ROM, SRAM, DRAM and Flash.

Storage

Storage is non-volatile: it keeps data without power.

Type How it works Typical speed (order of magnitude)
Hard disk drive (HDD) Spinning magnetic platters, moving heads A few milliseconds per random access
Solid-state drive (SSD) Flash memory chips, no moving parts Tens of microseconds
Firmware chip (ROM/flash) Holds the code that starts the machine Read mostly

Storage is far slower than RAM, so programs are copied from storage into RAM before they run. The operating system hides the copying with virtual memory (Virtual Memory and Paging). Disks and SSDs have their own lesson: Disks, SSDs and RAID.

Motherboard and chipset

The motherboard is the main circuit board. It carries the CPU socket, the RAM slots, expansion slots for graphics and other cards, connectors for storage and ports for USB and networking. Its copper traces are the buses described below.

The chipset (on many modern systems partly absorbed into the CPU itself) manages traffic between the CPU and everything else: it routes data to storage, USB and expansion slots. Think of it as the traffic police of the board.

Also on the board is the firmware (BIOS or UEFI), a small program in non-volatile memory. When you press the power button, the CPU starts executing this program, which tests the hardware and then loads the operating system from storage. The process is called booting.

What sits on a motherboard

Looking at a board from the top you can name most parts:

  • CPU socket with its power regulator (a set of inductors, capacitors and switching transistors that turn the 12 V supply into the low, precise voltage the processor needs) and a heat sink or cooler on top.
  • RAM slots (DIMMs), which connect through the memory channels.
  • Expansion slots: PCI Express (PCIe) slots for graphics, network and storage cards. Older boards had PCI and the AGP slot, a dedicated graphics port that PCIe replaced.
  • Storage connectors: SATA ports and M.2 slots for SSDs.
  • Power connectors from the power supply unit, a CMOS battery that keeps the clock and firmware settings alive, a firmware chip, and a panel of ports (USB, Ethernet, audio, display).

In older designs the chipset was two chips. The northbridge sat close to the CPU and handled the fast parts: memory and the graphics slot. The southbridge handled slower I/O such as USB, audio, disks and legacy ports, and talked to the CPU through the northbridge. Modern CPUs integrate the memory controller and the PCIe lanes for graphics, so the northbridge has disappeared into the processor, and a single platform controller hub remains for the rest.

Form factors

A form factor fixes the board's size, mounting holes, power connectors and port layout, so any board of that type fits a matching case and power supply.

Form factor Typical size (mm) Notes
ATX (standard) 305 x 244 The common desktop board with up to seven slots.
Extended ATX (E-ATX) about 305 x 330 Extra slots and memory channels for workstations and servers.
Micro ATX 244 x 244 Fewer slots, cheaper, fits smaller cases.
Flex ATX 229 x 191 A still smaller variant of Micro ATX for compact systems.
Mini-ITX 170 x 170 One expansion slot; popular for small builds.
Mini-STX 147 x 140 Very small, usually without a separate graphics slot.
BTX, Pico BTX various A 2000s redesign for better airflow that the market abandoned; ATX stayed.
LPX about 330 x 230 Low-profile boards from older slim desktops, with a riser card for the slots.

When choosing a board, check five things: the CPU socket and chipset must match the processor, the RAM type and slot count must match your modules (DDR4 and DDR5 are not interchangeable), the form factor must fit the case, the expansion and storage connectors must cover what you plan to install, and the power delivery and cooling must suit the CPU you want.

Buses: how parts talk

A bus is a set of wires shared by several components. The classic system bus has three groups of lines:

  • Address bus: carries the address of the memory cell or device being used. It is one-way, from the CPU outwards. If it has n lines, the CPU can name 2^n different locations. A 32-bit address bus reaches 4 GiB; a 20-bit one only 1 MiB.
  • Data bus: carries the value being read or written, in both directions. Its width (8, 16, 32, 64 bits) sets how much moves in one transfer.
  • Control bus: carries commands and status such as read, write, ready and interrupt.
flowchart TB
  CPU["CPU"]
  MEM["RAM"]
  DEV["I/O controller"]
  CPU --- AB["Address bus"]
  CPU --- DB["Data bus"]
  CPU --- CB["Control bus"]
  AB --- MEM
  DB --- MEM
  CB --- MEM
  AB --- DEV
  DB --- DEV
  CB --- DEV

All devices on the shared bus see the address and control lines; only the addressed one responds.

Real machines use several specialised buses and point-to-point links instead of one big shared bus. Buses and Interconnects covers PCIe, USB and memory buses in depth.

The clock

Digital circuits do not act at random moments. A clock is a signal that alternates between low and high at a steady rate, and circuits change state on its edges. One full period is a clock cycle. A 4 GHz clock has a period of 0.25 nanoseconds.

The clock keeps the parts in step. During each cycle a signal must travel through its logic and arrive before the next edge, so the clock period has to be longer than the slowest path. That is one reason you cannot make a clock arbitrarily fast. Frequency, heat and power are tied together, as Power, Energy and Thermal Limits explains.

Clock speed and overclocking. A higher clock does more cycles per second, so a program with the same cycle count finishes sooner and the system feels faster (more work in the same time, better multitasking under load). But performance does not scale perfectly: memory and storage are slower than the CPU, so the processor waits more. Overclocking runs the chip faster than its rated clock, often by raising the supply voltage (overvolting) to keep the transistors switching in time. Dynamic power grows with frequency and with the square of voltage, so power draw and heat rise quickly, stability suffers and the chip's life can shorten. Modern processors already boost their own clocks within thermal limits.

Embedded systems

An embedded system is a computer built into a larger device to do one dedicated job: a washing machine controller, a car's engine unit, a router, a thermostat, a pacemaker. Typical traits:

  • It uses a microcontroller (a CPU, a little RAM, flash and I/O peripherals on one chip) or a small microprocessor.
  • It runs fixed firmware, often with real-time deadlines, and needs little or no human intervention.
  • It is optimized for low cost, low power and small size, and must be reliable for years.
  • The drawbacks are limited resources, hard debugging and upgrades, and little flexibility compared with a general-purpose computer.

A general-purpose PC is the opposite trade-off: it runs any program but costs more and uses more power. Many microcontrollers use the Harvard organization (separate instruction and data memories) described in The Von Neumann Model.

A bus transfer in Python

A memory read on a simple bus follows a fixed handshake: put the address on the address bus, raise the read line, wait for memory to answer, take the value from the data bus, lower the line. The model below logs each cycle, so you can see exactly what is on the wires.

Python Model of a bus read and write

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A write takes three cycles in this toy and a read also takes three, even though the data only moves in one of them. Real buses overlap or pipeline these phases, but the sequence is the same: address first, then data, with control lines saying what kind of transfer it is.

Bus width and bandwidth

The bandwidth of a bus is how much data it moves per second:

bandwidth = width in bytes x transfers per second

A 64-bit (8-byte) data bus at 100 million transfers per second yields 800 MB/s. Doubling the width or the transfer rate doubles the bandwidth. Memory systems that transfer on both clock edges (as DDR memory does) get twice the transfers for the same clock.

Python Address space and bandwidth calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the last row: a 64-bit bus at 3,200 MT/s gives 25,600 MB/s, the figure printed as "PC4-25600" on one common type of memory module.

Memory modules are often sold with names like DDR4-3200. The 3200 is the transfer rate in MT/s, not the clock in MHz. The real clock is half of that, because data moves on both edges.

Putting it together

When you open a program, the operating system reads its code from the SSD into RAM. The CPU fetches instructions from RAM (through its caches) over the memory bus, works on data in registers, and writes results back. When you save a file, data travels from RAM over the I/O bus to the storage controller. Every step crosses at least one bus, so the slowest link often decides how fast the whole job feels.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which component keeps its contents when the power is switched off?

    Storage devices such as SSDs and HDDs are non-volatile. RAM, registers and caches lose their contents without power.
  2. 2. A CPU has a 24-bit address bus. How many bytes can it address?

    2^24 = 16,777,216 bytes, which is 16 MiB.
  3. 3. What does the control bus carry?

    The control bus carries commands and status signals that coordinate the transfer.
  4. 4. A 32-bit data bus performs 200 million transfers per second. What is its bandwidth?

    32 bits is 4 bytes, and 4 bytes x 200 million transfers per second = 800 MB/s.

Summary

  • The CPU executes instructions; RAM holds running programs; storage keeps data permanently.
  • The motherboard and chipset connect everything; firmware boots the machine.
  • Buses are groups of wires: address (which location), data (the value) and control (what to do).
  • An n-bit address bus names 2^n locations; bus bandwidth is width in bytes times transfers per second.
  • A clock steps all circuits in time; its period must exceed the slowest signal path.
  • The slowest link in the chain often limits overall performance.

Continue with Measuring Performance.