Chapter 4 CISC and RISC — a complex instruction, or a stack of simple ones
4.1 Two design philosophies — how much do you pack into one instruction
The fork is a single point. How much work do you pack into one instruction. The style of packing in a lot is CISC; the style of keeping it few and simple is RISC. Even to make it do the same computation, how you write the contract (the instruction set) diverges greatly here.
4.2 CISC — with one instruction, a lot of work
First, the packing side. CISC (Complex Instruction Set Computer) is the idea of “with one instruction, settle as much work as possible.” For example, “fetch A and B from memory, multiply them, and return the result to memory” — this whole sequence can be handled by just one instruction.
The merit is easy to see. You can write programs short, and the number of instructions needed is small too. In an age when memory was expensive, this was a great virtue.
There are costs too. Since one instruction moves through several actions inside, the decoder that reads it grows complex, and the instruction lengths become uneven too. Seen with Chapter 3’s assembly-line eye, the amount of work per step isn’t even, and the belt doesn’t flow smoothly. Just as you wrote the contract “rich,” the machine that carries it out grows heavy. The representative is x86, familiar from PCs.
4.3 RISC — simple instructions, many, fast
The other is the style of keeping instructions simple. RISC (Reduced Instruction Set Computer) is the idea of “let one instruction do only a very simple job.” For the earlier “multiply A and B and return to memory,” RISC splits this into four small instructions: “fetch A / fetch B / multiply / store.”
The number of instructions increases. But each one is simple, and the lengths are even. So the decoder is light, and the pipeline flows smoothly. The rhythm of “load, compute, store” seen in Chapter 1 — the discipline that only load and store touch memory, and computation happens only on the registers — was exactly this RISC manner.
The most familiar RISC today is ARM — widely used in smartphones, tablets, and embedded devices — and RISC-V, the one this series deals with. Many of the devices in your palm carry this RISC blood. If the earlier x86 is the representative of CISC, then ARM and RISC-V are the representative RISCs — placing that on the map makes the story ahead clearer. (Their origins, and the difference over who “owns” the contract, we trace in the next Chapter 5.)
4.4 One bit of backstory — today’s CISC also breaks things down RISC-style inside
“So is CISC obsolete?” — not so simple. Today’s x86 chips are said to, inside, first break down the complex instructions they receive from outside (the CISC contract) into simple, small operations like RISC’s, before executing. That is, the outward contract stays CISC and keeps compatibility, while the inner machine takes in RISC-style merits.
Here too, the preface’s point comes into play. The contract (the outward appearance) and the machine (the inner build) are separate things. The same contract can be carried out by quite different machines — that freedom appears in a place like this too.
4.5 Summary — how you write the contract determines the build of the machine
- CISC: pack much into one instruction. Code is short, but the decoder is complex and the pipeline flows poorly.
- RISC: keep instructions simple. Code is longer, but the machine is light and suits the assembly line.
- Today’s CISC too is said to run by breaking things down RISC-style inside. Again, contract and machine are separate.
It’s not a matter of which is right. It’s a difference of design philosophy — what to prioritize. And what matters is that how you write the contract (the design of the instruction set) determines, to a considerable degree, the build of the machine that carries it out. In the next Chapter 5, we visit MIPS, which first put this RISC way of thinking into textbook form and became the ancestor of today’s RISC-V.