What Building a Processor Actually Means
Earlier chapters in this series treated the processor as a component that simply executes instructions correctly. This chapter opens that component up and explains how it is actually built from basic digital logic circuits, tracing the path from an instruction's binary encoding all the way to the physical actions of registers, memory, and arithmetic units working together.
Processor implementations in this chapter are studied through two related but distinct designs: a Single-Cycle Implementation, where every instruction completes in exactly one clock cycle, and a Pipelined Implementation, where multiple instructions are processed simultaneously in overlapping stages. Understanding the simpler single-cycle version first makes the added complexity of pipelining much easier to follow later.
Two Categories of Digital Logic
Digital circuits used to build a processor fall into two fundamental categories, and knowing which category a piece of circuitry belongs to determines how it behaves over time.
Combinational Logicproduces outputs that depend only on the current inputs, with no memory of past inputs. An adder circuit is a typical example: given the same two input values, it always produces the same sum, regardless of what happened before.Sequential Logicproduces outputs that depend on both current inputs and some stored internal state from previous operations. A register is a typical example: its output depends on what value was previously written into it, not just on what is happening right now.
Why a Shared Set of Design Conventions Is Necessary
Combining combinational and sequential circuits correctly requires agreeing on a common set of rules, collectively called Logic Design Conventions, that every part of the processor follows.
- A
Clock Signalprovides a regular, repeating timing reference that coordinates when sequential elements are allowed to update their stored values. Edge-Triggered Clockingmeans state-holding elements only capture new values at a specific, precise moment of the clock signal, such as when the clock transitions from low to high, rather than continuously.- Signals must be given enough time to stabilize before the clock edge arrives, since combinational logic takes a small but non-zero amount of time to compute its output after its inputs change.
Without following these conventions strictly, sequential elements could capture unstable, partially-changed values, producing effects that behave unpredictably as circuit and clock speed change.
Why This Foundation Matters Before Building a Datapath
Every circuit built in the remainder of this chapter — from datapaths that move data between registers to the control logic that decides which operation to perform — relies on this basic distinction between combinational and sequential behavior, and on strict adherence to clocking conventions. Skipping this foundation makes it far harder to understand why later designs are structured the way they are.