中文

Building a Computer from Scratch, Bottom-Up · Unnamed Speaker

2026-06-21 · A faithful, transcript-grounded reading by PodLens

Original episode:https://youtu.be/rl0jkP9kOMw?si=wdmL8iD4nOYAFGFf · Timestamps are clickable — they seek the player in place

binarylogic gatesALUregistersmemory-mapped I/Ocomputer architecture

What This Episode Is About

From a purely bottom-up perspective, the speaker demonstrates in extraordinary detail how to build a complete 8-bit CPU starting from the most basic principles of binary and electricity, and then write a program to run on it [05:06]. After dissecting micro-level hardware components like logic gates, half- and full-adders, the ALU, flip-flops and latches, registers, and RAM, he shows the rules of bus communication and the "brain" of the computer — control microcode built from a ROM lookup table [02:24:31], [07:53:48]. He then transfers this homemade-CPU design philosophy onto a real ARM Cortex-M0+ processor, and through the memory-mapped I/O (MMIO) mechanism, successfully lights and keeps on an onboard LED on a Raspberry Pi Pico board using nothing but raw machine code [10:47:55], [11:47:42].

Timeline Theme Map

Core Viewpoints

  1. The use of binary is purely a matter of practical engineering reliability. Distinguishing "on or off" in an electrical signal is far simpler and more stable to implement physically than distinguishing ten different voltage levels.
  2. Two's complement encoding achieves perfect hardware-level reuse for addition and subtraction. By negating the weight of the most significant bit, a computer can perform signed-number arithmetic using the existing full adder, with no extra subtractor hardware required.
  3. Cascading flip-flops eliminates unstable transitional states in timing circuits. Chaining a positive latch and a negative latch in series lets a flip-flop ensure data is latched stably only at a specific edge of the clock pulse.
  4. The core red line of bus communication is preventing a data-writing conflict at the electrical level. Only one hardware component is permitted to write a voltage level to the bus at any given moment — otherwise it causes a direct physical short circuit and damages the chip.
  5. The essence of the control core is a fixed microcode lookup table. The computer's "brain" doesn't do any subjective thinking — it simply continuously dispatches pre-mapped high/low voltage levels to control lines based on the opcode and the current clock step.
  6. A processor's interaction with the outside world relies entirely on memory-mapped addressing. The CPU contains no dedicated instructions for controlling specific peripherals — every peripheral operation is, in essence, unified through address mapping into a read or write to a specific memory address.

Plain English Retelling

At the physical level, a computer processes electrical signals according to an extremely simplified convention: anything above a certain voltage threshold is a 1, anything below it is a 0 [05:06]. This convention seemingly sacrifices fine-grained voltage precision, but it's extremely reliable from an engineering standpoint, because it resists interference from stray noise. On top of this convention, we can map a sequence of binary digits uniquely onto the space of decimal values, converting complex logical judgments entirely into numerical computation. Logic gates are the basic building blocks of this computational process, defining the most basic Boolean operations through truth tables [01:49:03].

Combining the sum bit calculated by an XOR gate with the carry bit calculated by an AND gate gives a circuit the ability to perform one-bit binary addition — this is called a half adder [02:03:34]. A full adder further incorporates the carry input from a lower bit, and by chaining eight full adders end to end, a circuit can perfectly perform eight-bit binary addition [02:24:31]. Integrating subtraction doesn't require resorting to a complex subtractor either — it uses "two's complement" representation, simply inverting the subtrahend bit by bit and inputting a 1 at the least significant bit, successfully reusing the existing full-adder hardware [02:46:05]. To latch these computation results, the speaker shows how to feed the output line back into a selector's input, and chain a positive and negative latch together into a flip-flop, achieving data latching only on a rising or falling edge of the clock signal — ultimately forming a register that shares a common clock line [03:58:09], [04:18:46].

The connections between these components rely on a shared bus, and only one component is ever allowed to write data onto that bus at a time — otherwise it physically causes a short circuit [05:27:04]. The program counter plays the role of commander, its automatically incrementing value pointing to the physical address of the next instruction to be executed in memory [06:56:46]. The "control brain" that interprets these instructions and drives the whole machine is a ROM lookup table burned with microcode, outputting different control signals across cycles based on the current opcode, step, and flags [07:53:48]. Even though a real ARM Cortex-M0+ processor reaches a 32-bit width, its core design — registers, ALU, program counter — has no essential difference, conceptually, from this 8-bit computer [10:47:55].

The clearest expression of this conceptual consistency is memory-mapped I/O. The processor has no instruction like "light the LED" or "draw to the screen" — instead, external devices are mapped into specific memory addresses [11:05:04]. When a program writes the value 1 to one of these special addresses, the hardware circuit automatically switches the voltage state of the physical pin [11:06:03]. From sand to a glass screen, this seemingly trivial flicker of an onboard light is, underneath, an enormous engineering edifice built from dozens of carefully agreed-upon physical and logical layers stacked on top of each other, maintaining perfect alignment and stability under extremely strict time and space constraints [11:47:42], [11:54:27].

Recommended Segments for Close Listening

Resonances with past episodes

A faithful reconstruction and plain-language retelling of the episode, generated by PodLens.

This is one source-grounded reading, not a replacement for the original. Every point is anchored to its source, so you can check it yourself — and corrections are welcome.