A History of UNIX That ClicksEpisode 10 / The Floor — What Isn't Software

What turns the hand-entered 6032 into "action"?

The Floor — Hardware, the True Seed In Episode 9, a human entered the number 6032 into memory by hand. But a number, on its own, makes nothing happen. What turns it into the action "read memory"? It's an instruction decoder wired from logic gates. And the person who designed that was, again, a human.

Tools you'll need: Episode 9 (numbers entered by hand) The reveal: meaning lives in a "wired-up truth table"

We've descended a long staircase — Linux by gcc, gcc by an existing cc, C by B, the assembler by cross-compiling, and the first few words by a human hand. In Episode 9 we thought we'd reached "the floor of software." But there's one step left. The hand-entered 6032 is just a string of bits. Something must exist that turns it into the real action "read memory." That something is this episode's star — hardware. From here down, it is no longer a program. Just wired-up physics, and the human hand that designed it. This is the very bottom of chicken-and-egg.

016032, on its own, means nothing

As we saw in Episode 7, machine code is just numbers. The string 6032 means "read memory" only inside a machine that was built to interpret it that way. Put the same bit string into a machine of a different design and it does something entirely different (or nothing at all). The number itself has no meaning. The meaning lies on the side of the machine that receives it.

02What gives it meaning — the instruction decoder

Inside the CPU, the part that receives an instruction's number (the opcode) and turns it into control signals that say "do this action" is called the instruction decoder (control unit). Depending on the arrangement of the opcode's bits, it determines which line to light up — the line that drives the adder, the line that reads memory, the line that writes to a register, and so on. In the figure below, change the opcode and watch how the line that lights up = the action executed switches over.

Figure 1: The instruction decoder. Pick an opcode (a few bits) and the wired-up circuitry lights up one corresponding control line — this is the "number → action" translation. The meaning lives in this wiring.
Choose an opcode:

03Below that — logic gates and truth tables

The insides of the instruction decoder are a collection of logic gates (AND, OR, NOT). Combine AND, OR, and NOT and you can build any truth table (a table that assigns an output to each pattern of inputs). A decoder is nothing other than a truth table — "when the opcode is this, light up that control line" — physically realized in gates. And gates, in turn, are collections of switches called transistors.

The crux this time — the meaning of software bottoms out in a "wired-up table"

Follow the meaning of a program downward as far as you can, and at the end you arrive at a table, "opcode → control line," wired up in logic gates. This is no longer a program. Not rewritable software, but fixed physics. Software's chicken-and-egg is caught here by something that isn't software, and stops.

◇ ◇ ◇

04A detour — sometimes there's a tiny program inside the decoder

There is, however, one detour. In some CPUs, the interpretation of instructions is done by microcode, a tiny program inside the CPU (proposed by Maurice Wilkes in 1951). In this case, the machine code is first handed to microcode, a "tiny interpreter," which breaks it down into a sequence of finer micro-instructions. — It's like a miniature chicken-and-egg. But rest assured: the foundation that runs that microcode is, in the end, hardwired logic gates. In the figure below, switch between the two schemes and confirm that both bottom out in logic gates.

Figure 2: Hardwired vs. microprogrammed. The microcode scheme interposes a "tiny program," but the foundation that runs it is, in the end, hardwired logic gates. From here down, it isn't software.

05Who made that wiring — a human

So who decided that truth table, reduced it to gates, and burned it into a chip? — A human. Someone designed which action each bit string is assigned to (the instruction set), turned it into a logic circuit, and wired it up. Episode 9's "the first few words were carved by hand" and this episode's "the wiring that gives meaning was designed by hand" are the series' two seeds. Both — not a program, but human plus physics. The journey back up chicken-and-egg does, properly, bottom out outside of software (in human design and wired-up physics).

Further down isn't a software question

Gates are transistors, transistors are silicon, silicon is electrons obeying the laws of physics — the world keeps going down. But that's a story of physics and manufacturing, not the software chicken-and-egg of "what compiled it." Hardware, of course, has its own bootstrap too (the tools used to design chips are, again, other chips…). But that's a different chain. The software chain we've been tracing ended, for certain, right here — at logic gates that a human designed and wired.

The honest line — the figures are idealized, the floor is physics

(1) Figure 1's "2-bit opcode → 4 actions" is a minimal model for explanation; real instruction sets are far larger and more complex. (2) Modern CPUs are incomparably more intricate — pipelining, speculative execution, micro-operation caches, and so on — and "decoder = a simple truth table" is only a story of the skeleton. (3) Microcode (Wilkes, 1951) is a real technology that interprets machine code with a small program inside the CPU, but its foundation ultimately comes down to hardwired logic.

(4) The phrasing "meaning lives in the wiring / its designer is a human" is meant to point at the terminus of software's chicken-and-egg. Manufacturing hardware has its own bootstrap (a chain of tools making tools), which is a separate matter beyond this series' scope. As for the lowest-layer "physics" itself, it's more accurate to say a human designed with and made use of it, rather than "made" it.

Practice problems (solvable with this episode alone)
  1. Where is the "meaning" of the machine code 6032?
    See the answer
    Not in the number itself, but on the side of the machine (the instruction decoder) that receives it. The same bit string performs a different action in a machine of a different design. Meaning lives in the wiring.
  2. Explain the insides of an instruction decoder using the term "truth table."
    See the answer
    A truth table — "when the opcode is this, light up that control line" — physically realized in AND, OR, and NOT logic gates.
  3. Why doesn't chicken-and-egg "regress infinitely" even in the microcode scheme?
    See the answer
    Microcode is a tiny program, but the foundation that runs it is, in the end, hardwired logic gates, and it bottoms out there.
  4. What are this series' "two seeds"? What do they have in common?
    See the answer
    ① Episode 9: the first few words a human entered by hand. ② Episode 10: the meaning-giving logic gates a human designed and wired. What they share: neither is a program — both are "human plus physics."

SummaryThe software chain bottoms out in wired-up physics

The 6032 entered by hand in Episode 9 is just a bit string. What turns it into the action "read memory" is the instruction decoder (control unit), whose insides are logic gates (AND, OR, NOT)a truth table, "opcode → control line," wired up physically. The number has no meaning; the meaning lies on the side of the machine's wiring. However far down you trace the meaning of software, at the end it is caught by this fixed physics that is not a program.

There are also designs that interpose microcode (Wilkes, 1951), "a tiny program inside the CPU," but its foundation is, in the end, hardwired logic gates. And the one who designed and wired which action each bit string is assigned to (the instruction set) was — a human. Episode 9's "the first few words were carved by hand" and this Episode 10's "the meaning-giving wiring was designed by hand" are the series' two seeds. Both are not a program, but human plus physics. The journey back up chicken-and-egg has, for certain, bottomed out outside of software. — Next time, the finale. Looking up from the floor we descended to, we'll assemble the whole picture of the answer.

This document is Episode 10 of the series "A History of UNIX That Clicks." History and technology: the CPU's control unit (instruction decoder) decodes an instruction's opcode and generates the control signals that drive the datapath (ALU, registers, memory, and so on). In hardwired control, the control signals are generated by a fixed circuit made of logic gates, flip-flops, and decoders, and each instruction's action is physically built in as wiring. In microprogrammed control, a sequence of control signals (microcode) is placed in a control store and interprets instructions like a small interpreter (proposed by Maurice Wilkes in his 1951 paper "The Best Way to Design an Automatic Calculating Machine"). Either scheme ultimately reduces to hardwired logic gates. Logic gates (AND, OR, NOT; functional completeness) can realize any truth table, and a decoder can be described as the correspondence table "opcode → control line" turned into a circuit. The figures are minimal models for explanation; real instruction sets and modern CPUs (pipelining, micro-operations, and so on) are far more complex. Manufacturing and designing hardware itself also has its own bootstrap (the chain of tools such as EDA), but that is a separate problem from the "software chicken-and-egg" this series traces. — To print, use your browser's "Print" and "Save as PDF" (in the print version, the figures' controls and the answers are frozen / hidden).

Print / save as PDF: ⌘+P (Ctrl+P on Windows). On screen, in Figure 1 the buttons change the opcode and you can see the control line that lights up (= the action) switch over, and in Figure 2 you can confirm that the floor of both control schemes is the same logic gates. "See the answer" opens each solution.