3 CPU Architecture

Learn how registers, the ALU, datapath connections, and control logic work together to fetch and execute CPU instructions.

The CPU’s core organization

A CPU executes instructions by moving binary values through hardware that stores, computes, and routes them. Its basic organization brings together registers for working storage, an arithmetic logic unit for computation, a for moving values, and control logic to coordinate the work. Understanding how these parts connect makes the instruction-execution process easier to follow.

Registers and working storage

A is a small, fast storage element inside the processor. It holds information the CPU needs immediately, including operands, addresses, instructions, and intermediate results. A collection of general-purpose registers is often organized as a file, which makes selected values available to the and can store results returned from it.

Processors also contain special-purpose registers. The holds the address of the next instruction to fetch. An instruction holds an instruction being decoded or executed. A status or flag records conditions such as whether a result is zero or negative; the specific flags depend on the processor design.

Registers have a fixed width within a given design. Their width affects the values they can hold and the size of many operations. Registers therefore act as the CPU’s immediate working storage, distinct from the paths and circuits that move or transform their contents.

The computes

The (arithmetic logic unit) is a combinational circuit that operates on binary inputs. Depending on the instruction and control signals, it may add or subtract values, compare them, or apply bitwise operations such as AND and OR. Some designs include shifting in the ; others use a separate unit. An may also produce status information, such as whether its result is zero.

For example, suppose R1 contains 77 and R2 contains 55. For an instruction that adds these values and stores the result in R3, the processor selects the two inputs, directs the to add them, and routes 1212 back to R3. The computes the result, but other CPU components are needed to select the inputs and deliver the output.

Connections and coordination

A is a set of signal lines that carries values between processor components or between the CPU and other parts of the computer. Buses and selection circuits can connect registers, the , and memory interfaces. A ’s width determines how many bits it can carry at a time. Multiplexers and other routing logic select which value reaches a destination.

At the system level, signals are often grouped by function:

  • Data signals carry values being transferred.

  • Address signals identify a memory location or device.

  • Control signals indicate actions such as reading, writing, or selecting an operation.

These categories describe the signals’ functions. A physical design does not have to use one shared for every kind of signal.

The is the hardware and connections that move and operate on data, including registers, the , and routing logic. The decodes instructions and issues signals that guide the —for example, specifying which registers to read, which operation to perform, and where to write a result.

From instruction fetch to result

Instruction execution can be understood as a coordinated sequence:

  1. The supplies the address of an instruction, which is fetched from memory.

  2. Control logic decodes the instruction and selects any required values.

  3. The routes operands to the , which performs the selected operation.

  4. The result is written to a or, for a store instruction, sent toward memory.

  5. The PC is updated for the next instruction, or for a different instruction if a branch is taken.

In the addition example, control selects R1 and R2, sets the to add, and enables the output to be written to R3. The carries the values, the computes, and control coordinates the steps. A simple single-cycle design may complete an instruction in one clock cycle; other processors use multiple cycles or pipeline parts of different instructions.

Takeaway: Registers store immediate values, the transforms them, the carries them, and control logic coordinates the instruction’s steps.