Foundations: What a Computer Is

the datapath

If the control unit is the boss giving orders, the datapath is the workbench, the tools, and the trays where the actual work happens. It is the part of the processor through which data flows and gets transformed: numbers come in, get added or compared or moved, and results come out. When you hear that a processor added two numbers, it is the datapath that physically did it, on the boss's command.

The datapath is made of the components that hold and move data: the register file (a small fast set of named storage slots), the arithmetic-logic unit, or ALU, that performs adds, subtracts, comparisons, and logic, the wires and multiplexers that route values between them, and connections to memory. A typical instruction flows through it: operands are read from the register file, sent to the ALU, the chosen operation is performed, and the result is written back to a register — all in a path of wires the control unit steers.

Datapath and control unit together form the processor, and a huge part of designing a CPU is designing this datapath well, because its width and cleverness set how much each cycle can accomplish. The same architectural add can ride a simple narrow datapath or a wide, deeply pipelined one. Many of the speed differences between cheap and fast chips come down to how their datapaths are arranged, even when the architecture they implement is identical.

To compute x = a + b: the datapath reads a and b from the register file, the ALU adds them, and the sum is written into the register holding x. The control unit chose add and picked the registers; the datapath carried the numbers and did the work.

The datapath is where the numbers actually move and combine.

Datapath and control are a pair: the datapath can do the work but needs the control unit to tell it which work and when. Neither alone is a processor.

Also called
data path資料通路