Skip to content

Computer Science · Ch 1 — Computer System

Central Processing Unit (CPU)

1.1.1

Central Processing Unit (CPU)

The Central Processing Unit (CPU) is the electronic circuitry of a computer that carries out the actual processing of data. Because every calculation and every decision the computer makes happens here, the CPU is usually referred to as the brain of the computer. It is also commonly called simply the processor.

Physical form

Physically, a CPU is placed on one or more microchips called integrated circuits (ICs). These ICs are built from semiconductor materials — materials whose electrical behaviour can be precisely controlled, which is what makes miniaturised electronic circuits possible.

How the CPU works with programs

The CPU does not act on its own; it is given instructions and data through programs. Its working cycle is:

  1. Fetch — the CPU fetches the program (instructions) and the data from memory.
  2. Execute — it performs the arithmetic and logic operations that the instructions specify.
  3. Store — it writes the result back to memory.

Registers — the CPU's local memory

While it is processing, the CPU needs somewhere immediately at hand to keep the data and instructions it is currently working on. This local memory inside the CPU is made of registers.

Key points about registers:

  • Registers are part of the CPU chip itself, not separate memory modules.
  • They are limited in both size and number — there are only a few of them and each holds only a small amount.
  • Different registers serve different purposes: some store data, some store instructions, and some store intermediate results produced partway through a computation.

The two main components: ALU and CU

Besides its registers, the CPU has two main functional components:

  • Arithmetic Logic Unit (ALU) — performs all the arithmetic and logic operations that a program's instructions require. Any addition, comparison, or logical decision happens in the ALU. …