English / 日本語
← Back to the Fundamentals home Chapter 2: Part 1 · Taking the machine apart

Chapter 2 The blocks that make up a CPU — the kitchen lineup

The aim of this chapter. We survey the CPU’s parts, one round. In addition to Chapter 1’s workbench (cells): the stove, the warehouse, the bookmark, the reader, the head cook, the metronome. What each one is. And at key points, we add “what, by what method, and for what reason the designer decides.” As you learn the parts, at the same time “so this is how you choose and assemble a CPU” comes into view — that is the aim of this chapter. At the end, we look at the whole kitchen, all connected.

2.1 The kitchen lineup

What a CPU wants to do, in the end, is “execute a row of instructions in order, from the top.” For just that, a few parts with different roles are needed. Likened to a kitchen, the lineup is this. The stove that computes, the workbench that holds values, the distant warehouse, the bookmark pointing to which order number we’re on, the reader of the order slips, the head cook who directs the whole, and the metronome that keeps everyone’s beat. Let’s look at them in order.

2.2 The stove = the ALU (the device that computes)

What actually computes is the ALU (arithmetic logic unit). Like a stove, it takes materials (usually two values), does the cooking — addition and subtraction, logic like AND/OR, and comparisons like “is A less than B?” — and puts out one result. The work where a CPU “moves its hands” happens almost entirely here. It’s the lead of this kitchen.

The designer decides here. What: what dishes to let the stove make. Just add/subtract and logic, or also add hardware that can multiply and divide (the M extension in RISC-V terms). How to decide: from the chip’s use, choose the computations needed. Why: loading a compute unit you won’t use only wastes area and power. There is usually one stove.

2.3 The workbench = the register file (Chapter 1’s 32 cells)

The workbench we looked at closely in Chapter 1. 32 cells, one cell 32 squares (32-bit width). The stove (ALU) reads materials (values) from here, and writes computed results back here. The nearness of taking things out at hand, without going to the warehouse (memory), was the key to speed. What the designer decides here is, as in Chapter 1, the cell width (32/64).

2.4 The bookmark = the program counter (PC)

A program is a row of instructions lined up with addresses in the warehouse (memory). Unless the machine remembers “which address’s order slip it’s on now / which is next,” it gets lost. The small dedicated bookmark that points to it is the program counter (PC). It holds the address of the next order slip to execute. Usually it advances the address one at a time, forward — hence “counter (counting up)” — and only when a “jump over there” instruction comes does it get rewritten to a new address. Both loops and conditional branches are, in truth, this bookmark being rewritten.

2.5 The reader = the decoder / the head cook = the control unit

The order slip fetched from the warehouse is just a row of 0/1. The one who looks at it and reads out “this is ‘add,’ the materials are cells x1 and x2, the serving destination is x3” is the instruction decoder. It translates a cipher-like string of numbers into what, for a human, is “meaning.” The one who, based on the read-out directions, directs each place — “it’s addition now, so connect the x1 and x2 cells to the stove and return the result to x3” — is the control unit = the kitchen’s head cook. It doesn’t cook itself; it only sets the whole arrangement.

The designer decides here. What: the order slip’s “format” — that is, the kinds of instructions and how they’re written. How to decide: keep instructions simple and uniform, or make them multi-function and complex. Why: with many complex kinds, the reader (decoder) grows heavy and large. Keep them simple and uniform, and it’s light. This tug-of-war becomes the subject of Chapter 4, “CISC and RISC.”

2.6 The warehouse = memory

Outside the kitchen, there’s a huge shelf with astronomically many cells lined up — memory. Each with an address. It has two roles. One is the place for instructions (order slips are stored here, and what the bookmark = PC points to by address is here). The other is the place for data (the values read and written in computation, and large amounts of values that don’t fit on the workbench).

The designer decides here. What: whether to make the instruction shelf and the data shelf separate, or bundle them into one. How to decide: separate, and you can fetch instructions and move data in and out at the same time, so the flow improves (this is called the Harvard type). Bundle into one, and the build is simple and small (the Princeton type). Why: take speed, or take smallness and simplicity. In small chips, bundling into one is common.

2.7 The metronome = the clock

Last, the plainest and most indispensable backstage hand — the clock. If parts move at their own timings, a neighbor reads a value before it settles, and the computation goes to pieces. So there’s a metronome that hands out a steady beat — tick, tick, tick… — to the whole kitchen. Each beat (each cycle), every part advances exactly one step. A value settles during that beat, and at the head of the next beat, all together, they’re sent on to the next.

The designer decides here. What: how fast the beat can be (= the clock frequency). How to decide: the length of one beat is set, as we’ll see in Chapter 3, by “the step that takes the longest.” That length is estimated from the circuit and the manufacturing process by timing analysis (STA) — that familiar analysis from LibreLane/OpenROAD. To go faster, split a heavy step into finer stages. Why: the more you split, the shorter one beat can be, but each added stage boundary also adds circuit. Incidentally, matching the beat this way is synchronous. There’s also an asynchronous style, with no beat, where each part signals “done” and hands off, but the signaling mechanism is complex and practical examples are few.

2.8 The whole picture — the kitchen’s wiring

The lineup is complete. Finally, let’s connect it, roughly. The bookmark (PC) points to an address in the warehouse (memory), and an order slip is fetched. The reader (decoder) reads it out, the head cook (control unit) directs. Between the workbench (registers) and the stove (ALU), values and results are exchanged, and if needed, moved in and out of the warehouse. And everything advances on the beat of the metronome (clock) — with this, it’s certainly one CPU.

The whole picture of a CPU (the kitchen's wiring) On the left, the warehouse memory. Inside the CPU, the bookmark PC, the reader decoder, the head cook control unit, the workbench registers, the stove ALU, and the metronome clock are placed and connected by wiring to each other. Warehouse (memory) instr. & materials instr. · data CPU = kitchen Bookmark (PC) address of next order Reader (decoder) Head cook (control) directs decode Workbench (32 cells) = registers Stove (ALU) computes values result directs Metronome (clock) — hands the same beat (tick, tick…) to everyone
The kitchen’s wiring diagram. Instructions and materials pass to and from the warehouse (memory), and the bookmark (PC), reader (decoder), head cook (control unit), workbench (registers), and stove (ALU) coordinate. Everything advances on the beat of the metronome (clock).
Which decision is this knowledge for. What the designer decides here, in a word, is the “selection” of the kitchen lineup. What — which computations (multiply, floating point, etc.) to load, and which to omit. Whether to separate the instruction and data warehouses. How far to push the beat. How to decide — choose “needed / not needed” from the use, and judge by the tug-of-war of area, power, and speed. Why — every part you load eats area and power. Only what’s needed, no more, no less. This is the substance of “choosing and assembling your own chip.” Here, hands finally begin to reach the four central areas of the preface’s “decisions map.”