Skip to the content
2 layers97.8 × 97.2 mmTR4org, the printed circuit board in 3D

TD4 4-bit CPU (from the book CPUの創りかた) as a KiCad 10 hierarchical schematic

Size
97.8 × 97.2 mm
Copper layers
2
Thickness
1.6 mm
Parts
136
Nets
140
Pads
520
Tracks, vias
1,666, 240
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
27 Jul 2026
Updated
30 Jul 2026

Overview

TR4org is an open-source printed circuit board by nanamitm, from the nanamitm/td4-kicad repository on GitHub. It is a 2-layer board of 97.8 × 97.2 mm with 136 parts on 140 nets, routed with 1,666 tracks and 240 vias.

It is built around the SN74HC161DR (LX), SN74HC00DR(LX) and SN74HC74DR(LX), with the SN74HC86DR(LX), SN74HC14DR(LX) and XL-1608SURC-06 among its other parts. Its parts include 48 resistors, 33 diodes, 23 capacitors, 17 ICs and 7 switches.

Main components

10

README

README.md

TD4 — 4-bit CPU (original circuit) as a KiCad 10 project

A KiCad 10 hierarchical schematic of the TD4, the 4-bit CPU from the book CPUの創りかた (“How to Build a CPU”), transcribed from the published drawing by M. Yamamoto: xyama.sakura.ne.jp / 4bitCPU_TD4.

  • 15 ICs, an external-ROM interface, and a 4-bit data path
  • The 74HC10 and 74HC540 of the original are replaced by more readily available parts, following cuboktahedron's note: a 74HC00 (plus one spare NAND as the inverter) and two 74HC04s
  • Traced pixel by pixel from 4bitCPU_TD4x.gif — wires, junction dots, IC outlines and pin numbers
  • ERC: 0 errors and one intentional D5 / SEL_B net-label warning

Sheets

PageFileContents
1TR4org.kicad_schRoot sheet (sub-sheet index, instruction-set notes)
2td4_1_clock.kicad_schPower supply, clock generator (1 Hz / 10 Hz / single step), reset
3td4_2_registers.kicad_schRegisters A / B, output port, program counter (4 × 74HC161)
4td4_3_alu.kicad_sch4:1 selector (2 × 74HC153), adder (74HC283), carry flag (74HC74), input port
5td4_4_decoder.kicad_schInstruction decoder (74HC00 × 2 / 74HC32), selector code, buzzer

Layout

text
.
├── TR4org.kicad_pro          project file
├── TR4org.kicad_sch          root sheet
├── td4_1_clock.kicad_sch     … td4_4_decoder.kicad_sch  sub-sheets
├── TR4org.kicad_pcb          PCB layout
├── sym-lib-table             points at lib/TD4.kicad_sym
├── lib/
│   └── TD4.kicad_sym         74HC00/04/32/74/138/153/161/283
│                             (renamed copies of the stock KiCad symbols)
├── docs/
│   └── TD4_schematic.pdf     all five sheets as PDF
├── manufacturing/
│   └── jlcpcb/
│       ├── gerber/            Gerber and drill files for fabrication
│       └── production_files/  JLCPCB BOM, CPL, and Gerber archive
└── tools/
    ├── check_net.py          netlist + ERC check - run this after editing
    ├── gen_td4.py            the original generator, kept for reference only
    └── kisch.py              minimal KiCad schematic writer used by it

How the circuit works

  • Instruction = D7..D4 (opcode) + D3..D0 (immediate)
  • D7 / D6 select which register is loaded:
    • /LOAD A = D6 + D7, /LOAD B = /D6 + D7
    • /LOAD OUT = /(D7 · /D6), /LOAD PC = /(D7 · D6 · (/C + D4))
  • ALU input selector code: bit1 = D5, bit0 = D7 + D4
    • 0 = register A, 1 = register B, 2 = input port, 3 = zero
  • The adder's B input is the ROM immediate D0..D3
  • The ROM is a diode matrix. Selecting a row pulls every data line that has a jumper fitted LOW; the 74HC540 re-inverts, so a fitted jumper means “1”
  • Instructions: ADD A,Im / MOV A,B / IN A / MOV A,Im / MOV B,A / ADD B,Im / IN B / MOV B,Im / OUT B / OUT Im / JNC Im / JMP Im

Editing and checking the schematic

The schematic is maintained in Eeschema. Open TR4org.kicad_pro, edit the sheets, save. There is no generation step in the normal workflow.

After an edit, run ERC:

bash
kicad-cli sch erc -o erc.rpt TR4org.kicad_sch

The D5 / SEL_B label warning is intentional and described below. tools/check_net.py records the pre-external-ROM netlist and is retained for historical reference; it is not valid for the current design.

Refresh the PDF when the drawing changes:

bash
kicad-cli sch export pdf -o docs/TD4_schematic.pdf TR4org.kicad_sch

Fabrication data

The JLCPCB fabrication package is kept under manufacturing/jlcpcb/. Before placing an order, regenerate it from the current PCB after running ERC and DRC, then review the BOM, CPL, and Gerber archive. The tool-local manufacturing/jlcpcb/project.db is intentionally excluded from Git.

External ROM board

J2 is the 1 × 15, 2.54 mm external-ROM interface. It mates with the corresponding EX CONN (ROM) socket on the standalone TR4org-ROM board.

About tools/gen_td4.py

That script drew the first version of these sheets from the traced netlist. It is kept as a record of how the drawing was derived, not as part of the workflow — running it would discard the layout work done in Eeschema, so it refuses to overwrite sheets that KiCad has saved unless you pass --force.

Known notes

  • ERC reports one “multiple net names” warning for D5 / SEL_B. This is intentional: in the original drawing the ROM's D5 line drives the selector's B input directly, so the same net legitimately carries both names.
  • Unconnected pins: TC on the four 74HC161s, the three unused outputs of the 74HC74, A4 on the expansion connector, and the outputs of the gates left spare by the part substitution (one 74HC00 NAND and four 74HC04 inverters). All spare inputs are tied to GND.
  • The whole board is surface mount apart from the connectors, switches, the DC jack, the fuse and C5: the logic is TI 74HC in SOIC-14 / SOIC-16 with MPN and LCSC fields filled in.
  • Passives are SMD: 0603 resistors and ceramics, 0805 for the 10 µF parts, SOD-323 for the 128 ROM diodes, 0603 chip LEDs. C5, the clock timing capacitor, deliberately stays a PET film box — an MLCC there loses 20-40 % of its value to DC bias and temperature and would pull the clock frequency.
  • MPN and LCSC fields are filled in for every IC, LED, ROM diode and capacitor. Only the resistors are still generic.
  • Watch the stock on the two scarce parts before ordering: SN74HC153DR (LCSC C484751) and CD74HC283M96 (C543032) are down to double digits.
  • The current PCB layout and JLCPCB fabrication package are included in this repository.

Credits and origin

  • Circuit: M. Yamamoto, “CPUの創りかた TD4” (2011.08)
  • Original design: the TD4 from the book CPUの創りかた by Iku Watanami (渡波郁), Mynavi Publishing

This repository contains only a KiCad transcription of that schematic. Neither the original drawing nor any content from the book is included. Copyright in the circuit itself remains with its authors — please check the original author's terms before redistributing.

Parts

136
QtyValueFootprintReferences
351kResistor_SMD:R_0603_1608MetricR1, R2, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25 +19
29RedLED_SMD:LED_0603_1608MetricD1, D2, D10, D11, D12, D13, D14, D15, D16, D17, D18, D19, D20, D21, D22, D23 +13
18100nCapacitor_SMD:C_0603_1608MetricC5, C6, C7, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C23 +2
4100kResistor_SMD:R_0603_1608MetricR4, R8, R9, R47
4MountingHoleMountingHole:MountingHole_2.2mm_M2H1, H2, H3, H4
4SN74HC161DRPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU2, U3, U4, U5
4YellowLED_SMD:LED_0603_1608MetricD4, D5, D6, D7
3100Resistor_SMD:R_0603_1608MetricR10, R11, R48
210kResistor_SMD:R_0603_1608MetricR5, R45
210uCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC1, C2
21MResistor_SMD:R_0603_1608MetricR3, R46
2SN74HC00DRPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU15, U17
2SN74HC08DRPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU12, U13
2SN74HC153DRPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU6, U7
2SN74HC32DRPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU14, U16
2SN74HC74DRPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU8, U9
2SN74HC86DRPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU10, U11
1100u/16VCapacitor_THT:CP_Radial_D10.0mm_P5.00mmC4
110Hz / 1HzButton_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2QSW3
11nCapacitor_SMD:C_0603_1608MetricC22
11u filmCapacitor_THT:C_Rect_L7.2mm_W4.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2C3
1330k *1Resistor_SMD:R_0603_1608MetricR6
133k *2Resistor_SMD:R_0603_1608MetricR7
1BZR_SWButton_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2QSW7
1Barrel_Jack_SwitchConnector_BarrelJack:BarrelJack_HorizontalJ1
1EX CONN (ROM)Connector_PinSocket_2.54mm:PinSocket_1x15_P2.54mm_VerticalJ2
1I PRT (DIP-SW x4)Button_Switch_THT:SW_DIP_SPSTx04_Slide_9.78x12.34mm_W7.62mm_P2.54mmSW6
1MANUAL / AUTOButton_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2QSW5
1MANUAL CLOCKButton_Switch_THT:SW_PUSH_6mmSW2
1On / OffButton_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2QSW4
1PKM13EPYBuzzer_Beeper:Buzzer_12x9.5RM7.6LS1
1RESETButton_Switch_THT:SW_PUSH_6mmSW1
1RLD60P050X 0.5AResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalF1
1SN74HC14DRPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU1

Similar boards

  • 6 layers310 × 284 mmOsc core, the printed circuit board in 3D

    Osc core

    Takazudo/zudo-osc-hole-field

    This directory retains the rejected #38 nine-board-era schematic, PCB and route receipts at base commit 1fc6e5347308fe5e8166d5828ba3ba6fa8e101c7. It is excluded from the current ten-board manifest.

    3,986 parts
  • 2 layers290 × 280 mmCm5-guard A, the printed circuit board in 3D

    Cm5-guard A

    Brico-Hams/antenaSatCommrotor

    DUPLEXER 145 / 435 MHz — BNC — 25 W TARGET — REV A

    158 parts
  • 4 layers88.9 × 96.5 mmErs s32-board, the printed circuit board in 3D

    Ers s32-board

    schrodlm/nxp_hal

    In this assignment the target platform changes from the STM32F407 to the NXP S32K118, an Arm Cortex‑M0+ microcontroller from the S32K1xx automotive family.

    138 parts
  • 2 layers101.4 × 69.4 mmPanel, the printed circuit board in 3D

    Panel

    4project-co-il/PlugAndPlay-SAMD21

    Plug-n-Play SAMD21 Development Board

    85 partsMIT
  • 2 layers56 × 49.5 mmGb devcart, the printed circuit board in 3D

    Gb devcart

    fabPlane/gb-devcart

    A simple, original Game Boy (DMG) / ModRetro Chromatic homebrew development cartridge. 512 KB of rewritable NOR flash, 8 KB of battery-free F-RAM, and an MBC5-subset mapper built from discrete 74HC logic.

    26 parts

Questions

How big is the TR4org PCB?

It measures 97.8 × 97.2 mm and has 2 copper layers, 1.6 mm thick.

What parts does the TR4org use?

136 parts, built around the SN74HC161DR (LX), SN74HC00DR(LX), SN74HC74DR(LX) and SN74HC86DR(LX). The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the TR4org KiCad files?

From the nanamitm/td4-kicad repository on GitHub, at the commit this page was made from: the board is TR4org.kicad_pcb and its schematic TR4org.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the TR4org design in my own project?

Its repository states no licence, so its author keeps all rights: ask nanamitm before reusing the design.