Skip to main content

Coming soon

Build a CPU from logic gates to code

Meet S-CPU, a minimal 16-bit architecture designed to be understood, built, and programmed from end to end.

Close-up of the S-CPU TTL computer, with its colourful wiring and illuminated LEDs
A working S-CPU, built from discrete TTL logic.

Why build a CPU?

Software becomes much clearer when you can see the machine beneath it. BuildACPU follows that machine layer by layer, from logic gates and registers to assembly and high-level code.

What you will learn

Understand the foundations

Learn how electricity, transistors, logic gates, registers, memory, and buses form the core of a computer.

Design the processor

See how a datapath, control logic, and an instruction set work together as a complete 16-bit CPU.

Program the machine

Write assembly, compile S-Code, and connect software concepts to real hardware constraints.

Meet S-CPU

S-CPU is a deliberately minimal 16-bit architecture, simple enough to understand in full and complete enough to run real programs.

Architecture
16-bit accumulator
Core registers
A · IR · PC
Native instructions
NOR · ADD · STA · JCC
Assembler
40+ pseudo-instruction forms
Cycle
Fetch · Execute
Program space
16-bit with long jumps
TTL clock
2 MHz · tested to 4.5 MHz
Front view of the complete S-CPU TTL computer running on breadboards
The complete TTL implementation, running a program.

One architecture, multiple implementations

.NET simulators

Run and debug S-CPU programs on Windows, Linux, or macOS using desktop or CLI simulators.

Logic simulations

Model the datapath in Logisim, then simulate the physical 74xx circuit design in Digital.

Verilog and FPGA

Simulate the HDL with Icarus, then synthesize and run it on a Gowin FPGA.

TTL computer

Build the physical processor from discrete logic chips and breadboard wiring.

Beyond the hardware

Meet S-Code

S-Code is a compact high-level language built specifically for S-CPU. It brings familiar features like functions, arrays, strings, pointers and dynamic memory to a minimal 16-bit processor.

string message = "Hello S-CPU!";
int values[] = { 10, 20, 30 };

Print(message);

for (int i = 0; i < sizeof(values); i++) {
PrintNumber(values[i]);
}

BuildACPU is coming soon

The learning guides are on their way. The full S-CPU project is already available on GitHub.

Explore on GitHub