

TR4org
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
10SN74HC161DR (LX)
SOP-16Counters, DividerslingxingicSN74HC00DR(LX)
SOP-14Logic GateslingxingicSN74HC74DR(LX)
SOP-14Flip FlopslingxingicSN74HC86DR(LX)
SOP-14Logic GateslingxingicSN74HC14DR(LX)
SOP-14InverterslingxingicXL-1608SURC-06
0603-40℃~+85℃ 120° 2.3V 20mA 225mcd 50mW 620nm~630nm 625nm Discrete Diode Red Top-mount Water Clear 0603 LED Indication - Discrete ROHSXINGLIGHTLED Indication - DiscreteCC0603KRX7R9BB104
0603100nF 50V X7R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHSYAGEOMultilayer Ceramic Capacitors MLCC - SMD/SMTXL-1608UYC-06
0603-40℃~+85℃ 120° 2.4V 20mA 435mcd 50mW 585nm~595nm 590nm Discrete Diode Top-mount Water Clear Yellow 0603 LED Indication - Discrete ROHSXINGLIGHTLED Indication - DiscreteRVT100UF16V67RV0016
SMD,D6.3xL5.4mm-55℃~+105℃ 100uF 16V 2000hrs@105℃ 5.4mm 6.3mm 93mA@120Hz ±20% SMD,D6.3xL5.4mm Aluminum Electrolytic Capacitors - SMD ROHSKNSCHAAluminum Electrolytic Capacitors - SMDB32529C0105J289
插件,P=5mm-55℃~+125℃ 1uF 63V Metallized Polyester ±5% Plugin,P=5mm Film Capacitors ROHSTDKFilm Capacitors
README
README.mdTD4 — 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_Bnet-label warning
Sheets
| Page | File | Contents |
|---|---|---|
| 1 | TR4org.kicad_sch | Root sheet (sub-sheet index, instruction-set notes) |
| 2 | td4_1_clock.kicad_sch | Power supply, clock generator (1 Hz / 10 Hz / single step), reset |
| 3 | td4_2_registers.kicad_sch | Registers A / B, output port, program counter (4 × 74HC161) |
| 4 | td4_3_alu.kicad_sch | 4:1 selector (2 × 74HC153), adder (74HC283), carry flag (74HC74), input port |
| 5 | td4_4_decoder.kicad_sch | Instruction decoder (74HC00 × 2 / 74HC32), selector code, buzzer |
Layout
.
├── 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 itHow the circuit works
- Instruction =
D7..D4(opcode) +D3..D0(immediate) D7/D6select 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 + D40= 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:
kicad-cli sch erc -o erc.rpt TR4org.kicad_schThe 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:
kicad-cli sch export pdf -o docs/TD4_schematic.pdf TR4org.kicad_schFabrication 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'sD5line drives the selector's B input directly, so the same net legitimately carries both names. - Unconnected pins:
TCon the four 74HC161s, the three unused outputs of the 74HC74,A4on 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| Qty | Value | Footprint | References |
|---|---|---|---|
| 35 | 1k | Resistor_SMD:R_0603_1608Metric | R1, R2, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25 +19 |
| 29 | Red | LED_SMD:LED_0603_1608Metric | D1, D2, D10, D11, D12, D13, D14, D15, D16, D17, D18, D19, D20, D21, D22, D23 +13 |
| 18 | 100n | Capacitor_SMD:C_0603_1608Metric | C5, C6, C7, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C23 +2 |
| 4 | 100k | Resistor_SMD:R_0603_1608Metric | R4, R8, R9, R47 |
| 4 | MountingHole | MountingHole:MountingHole_2.2mm_M2 | H1, H2, H3, H4 |
| 4 | SN74HC161DR | Package_SO:SOIC-16_3.9x9.9mm_P1.27mm | U2, U3, U4, U5 |
| 4 | Yellow | LED_SMD:LED_0603_1608Metric | D4, D5, D6, D7 |
| 3 | 100 | Resistor_SMD:R_0603_1608Metric | R10, R11, R48 |
| 2 | 10k | Resistor_SMD:R_0603_1608Metric | R5, R45 |
| 2 | 10u | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C1, C2 |
| 2 | 1M | Resistor_SMD:R_0603_1608Metric | R3, R46 |
| 2 | SN74HC00DR | Package_SO:SOIC-14_3.9x8.7mm_P1.27mm | U15, U17 |
| 2 | SN74HC08DR | Package_SO:SOIC-14_3.9x8.7mm_P1.27mm | U12, U13 |
| 2 | SN74HC153DR | Package_SO:SOIC-16_3.9x9.9mm_P1.27mm | U6, U7 |
| 2 | SN74HC32DR | Package_SO:SOIC-14_3.9x8.7mm_P1.27mm | U14, U16 |
| 2 | SN74HC74DR | Package_SO:SOIC-14_3.9x8.7mm_P1.27mm | U8, U9 |
| 2 | SN74HC86DR | Package_SO:SOIC-14_3.9x8.7mm_P1.27mm | U10, U11 |
| 1 | 100u/16V | Capacitor_THT:CP_Radial_D10.0mm_P5.00mm | C4 |
| 1 | 10Hz / 1Hz | Button_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2Q | SW3 |
| 1 | 1n | Capacitor_SMD:C_0603_1608Metric | C22 |
| 1 | 1u film | Capacitor_THT:C_Rect_L7.2mm_W4.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2 | C3 |
| 1 | 330k *1 | Resistor_SMD:R_0603_1608Metric | R6 |
| 1 | 33k *2 | Resistor_SMD:R_0603_1608Metric | R7 |
| 1 | BZR_SW | Button_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2Q | SW7 |
| 1 | Barrel_Jack_Switch | Connector_BarrelJack:BarrelJack_Horizontal | J1 |
| 1 | EX CONN (ROM) | Connector_PinSocket_2.54mm:PinSocket_1x15_P2.54mm_Vertical | J2 |
| 1 | I PRT (DIP-SW x4) | Button_Switch_THT:SW_DIP_SPSTx04_Slide_9.78x12.34mm_W7.62mm_P2.54mm | SW6 |
| 1 | MANUAL / AUTO | Button_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2Q | SW5 |
| 1 | MANUAL CLOCK | Button_Switch_THT:SW_PUSH_6mm | SW2 |
| 1 | On / Off | Button_Switch_THT:SW_Slide_SPDT_Straight_CK_OS102011MS2Q | SW4 |
| 1 | PKM13EPY | Buzzer_Beeper:Buzzer_12x9.5RM7.6 | LS1 |
| 1 | RESET | Button_Switch_THT:SW_PUSH_6mm | SW1 |
| 1 | RLD60P050X 0.5A | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | F1 |
| 1 | SN74HC14DR | Package_SO:SOIC-14_3.9x8.7mm_P1.27mm | U1 |
Similar boards
- 6 layers300 × 248.8 mm

- 6 layers310 × 284 mm

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 - 4 layers50 × 100 mm

- 2 layers290 × 280 mm

- 4 layers88.9 × 96.5 mm

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 layers39 × 91 mm

- 2 layers101.4 × 69.4 mm

- 2 layers56 × 49.5 mm

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.