deckle studioOpen in the editor

Mini CPU from transistors

4-bit computer from MOSFETs only, with mask ROM.

  • ST7735 TFT
Open in the simulatorNo account needed: press Simulate and it runs.

How it works

A 4-bit accumulator computer from MOSFETs only: program counter (3 bits), mask ROM 8 × 5 bits (the program is in the arrangement of the transistors), 4-bit adder, multiplexers, accumulator register + carry flip-flop. Every rising clock edge executes one instruction: LOAD n (ACC = n) or ADD n (ACC = ACC + n), and the program counter advances. Program: LOAD 1, ADD 2, ADD 2, ADD 2, ADD 2, LOAD 0, ADD 3, ADD 3 → ACC 1 3 5 7 9 0 3 6, then from the start. Clock: automatic 2 Hz (switch AUTO) or button TAKT with AUTO open. RESET sets program counter and ACC to 0 (automatic at power-on). Green LEDs = ACC, yellow = carry. Output J1 (JST PH 7-pin): 1–4 = ACC D0–D3, 5 = STB (clock delayed by ≈7 µs: latch data on the rising STB edge), 6 = 5 V, 7 = GND, 5 V CMOS levels. Cable W1 leads to the TFT board (J2, board "Display"). Hard-wired gate control with counters, hex decoder and SPI shift register; no microcontroller, no firmware. The TFT shows the last output value as a hex digit.

Wiring

Each line is one connection (net) and the pins it joins.

NetPins
GNDC_RST 2C_STB 2D_ACC0 KD_ACC1 KD_ACC2 KD_ACC3 KD_CARRY KJ1 7QSB1n1 SQSB2n1 SR_CLK 2SW_RESET 2V_TAKT −V1 −W1 7
VDDJ1 6QSB1p1 SQSB2p1 SR_RST 1SW_TAKT 1V1 +W1 6
ACC0J1 1R_ACC0 1W1 1
ACC1J1 2R_ACC1 1W1 2
ACC2J1 3R_ACC2 1W1 3
ACC3J1 4R_ACC3 1W1 4
ACLKSW_AUTO 1V_TAKT +
ACLK2R_AUTO 1SW_AUTO 2
CLKR_AUTO 2R_CLK 1R_STB 1SW_TAKT 2
D_3V3DC2 1DC3 1DC4 1DDS1 VCCDDS1 LEDDPOR 1DU1 OUT
D_D0_3V3DR1 2DR2 1
D_D1_3V3DR3 2DR4 1
D_D2_3V3DR5 2DR6 1
D_D3_3V3DR7 2DR8 1
D_RSTDPOR 2DRST 1
D_STB_3V3DR9 2DR10 1
nRSTC_RST 1R_RST 2SW_RESET 1
nSTBQSB1n1 DQSB1p1 DQSB2n1 GQSB2p1 G
STBJ1 5QSB2n1 DQSB2p1 DW1 5
STBDC_STB 1QSB1n1 GQSB1p1 GR_STB 2
X_5VDC1 1DU1 INDU1 ENJ2 6W1 6
X_D0DR1 1J2 1W1 1
X_D1DR3 1J2 2W1 2
X_D2DR5 1J2 3W1 3
X_D3DR7 1J2 4W1 4
X_GNDDC1 2DC2 2DC3 2DC4 2DDS1 GNDDR2 2DR4 2DR6 2DR8 2DR10 2DRST 2DU1 GNDJ2 7W1 7
X_STBDR9 1J2 5W1 5
D_ACC0
LED
D_ACC1
LED
D_ACC2
LED
D_ACC3
LED
D_CARRY
LED
QSB1n1
N-MOSFET
QSB1p1
P-MOSFET
QSB2n1
N-MOSFET
QSB2p1
P-MOSFET
R_ACC0
Resistor
R_ACC1
Resistor
R_ACC2
Resistor
R_ACC3
Resistor
R_AUTO
Resistor
SW_AUTO
Switch
SW_RESET
Push button

Parts

More examples: Logic and home-made CPUs