Building the TD4 4-Bit CPU

· devtools open-source · Source ↗

TLDR

  • A builder hand-translated a Japanese CPU book to construct the TD4, a 74-series TTL 4-bit CPU with 12 instructions and a 16-byte diode-matrix ROM programmed via DIP switches.

Key Takeaways

  • TD4 uses discrete 74HC-series ICs: 74HC161 for registers and PC, 74HC153 as ALU input mux, 74HC283 as ALU, 74HC10/32 for instruction decode.
  • Program storage is a physical diode matrix (1N4148 diodes substituting hard-to-source 1S1588/D8-1A) plus DIP switches; no firmware or calibration needed.
  • 74HC and 74LS series are interchangeable here; author confirmed both work without modification.
  • Author built a JavaScript TD4 assembler (github.com/dilshan/td4-assembler) that converts assembly source directly to DIP switch positions.
  • Hard-wired logic with no microcode exposes the full instruction execution path, making it a concrete architecture learning tool.

Hacker News Comment Review

  • Discussion is minimal; the main thread is a redirect to note that the full instruction set is already linked in the post itself (BG5DIW’s GitHub / wuxx/TD4-4BIT-CPU).
  • One commenter pushed back on the reflex to cite Ben Eater’s 8-bit computer and nand2tetris on every custom CPU build, arguing other designs deserve standalone attention.

Notable Comments

  • @cpldcpu: “But why is this always the first comment on custom CPU builds? Can’t there also be other designs out there?”

Original | Discuss on HN