Show HN: We built an 8-bit CPU as 2nd year EE students

Hacker News Top Tools

Summary

A fully functional 8-bit Harvard architecture CPU built from individual logic gates, designed in Logisim-Evolution, with open-source files and documentation. Created by second-year EE students.

Hi! me and my friends together built an 8 bit CPU implemented in Logisim purely from scratch. The control unit of this system does not implement the generic microcode ROM or any kind of RAM. This was made purely from discrete logic gates and coded the system to run different programs.<p>key features: Custom 16-instruction Harvard ISA, 8-bit fixed format, 4 general purpose registers<p>Hardwired control unit built entirely from AND&#x2F;OR gate logic matrix<p>Dual-phase clocking to eliminate race conditions<p>Bootstrap Control Unit that cold-boots via ROM-to-RAM transfer Early-exit conditional branching that saves upto 25% cycles when conditions aren&#x27;t met<p>Full design specification document with version control<p>Since this was our first time doing such teamwork and a new thing we used RISC based system that fetches an 8-bit instruction from Instruction memory 4 bits of which translate to an instruction the last two bits are for source and destination registers. There are a total of 4 registers in the system with two memory units namely Data SRAM and I SRAM, the system follows a Harvard architecture.<p>There are design discrepancies too since it was our first time designing such a system and on top of that completely hardwired too.<p>To solve the problem of cold booting a bootloader is present too that copies the contents of a temporary ROM into instruction RAM and then hands over the reins to the CPU.<p>We also implemented conditional branching as well as early exit branching too that only checks for zero or carry flag and branches without wasting cycles, if the conditions are not met the Program counter increments.<p>Moreover we also created a complete documentation with version control describing each necessary part assuming prior knowledge.<p>Please take a look at it at <a href="https:&#x2F;&#x2F;github.com&#x2F;c0rRupT9&#x2F;STEPLA-1" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;c0rRupT9&#x2F;STEPLA-1</a><p>For future development I want to implement a RISC CPU using FPGA&#x27;s and connect it to an actual DRAM. We are also selling the full spec document and Logisim files for $5 to fund our passion <a href="https:&#x2F;&#x2F;tcfdiq.gumroad.com&#x2F;l&#x2F;zyyux" rel="nofollow">https:&#x2F;&#x2F;tcfdiq.gumroad.com&#x2F;l&#x2F;zyyux</a> Thankyou!
Original Article
View Cached Full Text

Cached at: 06/18/26, 02:45 AM

c0rRupT9/STEPLA-1

Source: https://github.com/c0rRupT9/STEPLA-1

STEPLA-1 8-bit Hardwired CPU

A complete 8-bit Harvard architecture CPU designed and simulated in Logisim-Evolution, built entirely from individual logic gates down to the gate level.

Version: 2.4.2
Status: Under Development


What Is STEPLA-1?

STEPLA-1 is a fully functional 8-bit CPU where every component; registers, decoders, ALU, control unit is built from individual 74-series logic gates. No black box components. Every signal path is visible, traceable, and documented.

Unlike EEPROM-based designs, STEPLA-1 uses a fully hardwired control unit a gate-level AND/OR matrix where every control signal is a physical gate whose inputs you can probe with a multimeter. This makes the machine transparent in a way that microcode-based designs cannot be.


Key Features

Architecture

  • 8-bit Harvard architecture
  • 4-bit opcode space, 16 instructions
  • 4 general purpose registers (RA-RD)
  • Separate instruction and data RAM (256 bytes each)
  • Bootstrap Control Unit (BCU) for cold-boot ROM → RAM transfer

Control Unit

  • Fully hardwired PLA-inspired gate matrix
  • Hierarchical decode: opcode decoder + step decoder + AND matrix
  • No EEPROM, no microcode pure combinational logic
  • Every control signal traceable to individual gates

Performance

  • Variable cycle instructions: 3 to 5 clock cycles
  • Early-exit conditional branching (25% latency reduction)
  • Synchronous load-to-one reset (33% efficiency gain over v2.3)
  • Calculated IPC: 0.200-0.333, weighted average 0.263
  • Target clock: 4 MHz on physical breadboard
  • Effective throughput: ~1 MIPS at target frequency

Instruction Set

OpcodeInstructionCyclesDescription
0x0NOP3No operation
0x1HLT3Halt execution
0x2ADD5Add registers
0x3SUB5Subtract registers
0x4MOV3Register to register
0x5MOVI4Load immediate
0x6STRD4Store to data RAM
0x7OUT3Output register
0x8JMP4Unconditional jump
0x9JZ3/5Jump if zero
0xAJC3/5Jump if carry
0xBLDIM5Load immediate address
0xCLDD4Load from data RAM
0xDGETPC3Get program counter
0xEJP3Jump to register
0xFSTIM5Store immediate address

Why STEPLA-1 Is Different

Most educational CPU projects use one of two approaches:

  • EEPROM microcode (Ben Eater’s SAP-1): Simple to implement, opaque in operation
  • HDL simulation (VHDL/Verilog): Powerful but abstracted from physical reality

STEPLA-1 takes a third path: discrete gate simulation that maps directly to physical components. Every Logisim gate corresponds to a real 74-series IC you can buy at an electronics market. The simulation IS the schematic.

Comparison with SAP-1:

FeatureSAP-1STEPLA-1
Instructions516
Registers2 (fixed purpose)4 (general purpose)
RAM16 bytes256 bytes
Control unitEEPROM microcodeHardwired gates
Conditional jumpsNoneJZ, JC with early exit
Bootstrap loaderNoneHardware BCU
Target clock~1 MHz4 MHz
Effective throughput~0.17 MIPS~1 MIPS

Repository Structure

STEPLA-1/
├── simulation/
│   ├── STEPLA-1.circ          # Main Logisim-Evolution file
│   ├── control_unit.circ      # Control unit subcircuit
│   ├── register_file.circ     # Register selector subcircuit
│   └── BCU.circ               # Bootstrap control unit
├── programs/
│   ├── fibonacci.asm          # Fibonacci sequence demo
│   └── counter.asm            # Basic counter program
├── docs/
│   └── STEPLA-1_Spec_v2.4.2.pdf  # Full specification
└── README.md

Getting Started

Requirements

Running the Simulation

  1. Clone this repository
  2. Open simulations/8bitcomp.circ in Logisim-Evolution
  3. Load programs/fibonacci.asm into the ROM
  4. Toggle switch to 1 and press reset button.
  5. Run the clock at desired frequency.

Loading a Program

Programs are loaded via the Bootstrap Control Unit automatically. On simulation start the BCU copies the instruction ROM contents to instruction RAM before releasing control to the CPU. See Section 8 of the specification for BCU operation details.


Documentation

The full 43-page specification covers:

  • Control unit theory and PLA architecture
  • Complete ISA with encoding rules
  • Every instruction’s T-state microoperation sequence
  • Clock phase synchronization and dual-edge design
  • BCU boot protocol and T0 null state
  • Signal conditioning for physical breadboard build
  • Timing analysis with real component datasheets
  • Known limitations and v3.0 roadmap

📄 [Read the Full Specification](/STEPLA-1 Control Unit Design Specifictation Manual v2.4.2.pdf)


Physical Build

STEPLA-1 is designed for physical construction using 74HCT series logic:

Key components:

  • Logic: 74HCT08, 74HCT32, 74HCT14, 74HCT86
  • Registers: 74HCT377, 74HCT175, 74HCT74
  • Decode: 74HCT154, 74HCT138, 74HCT139
  • Counter: 74HCT163
  • ALU: 74HCT283 (×2 cascaded)
  • Memory: AS6C62256 SRAM, AT28C64B EEPROM
  • Bus: 74HCT244, 74HCT245

Target clock speed: 4 MHz (verified via timing analysis, critical path: 101ns, half-cycle budget: 125ns at 4 MHz)


Roadmap

v2.5.0 (planned)

  • Overflow flag (VF) and Negative flag (NF)
  • Signed arithmetic support
  • JV and JN conditional jump instructions
  • Proteus ISIS simulation with real component models

v3.0.0 (planned)

  • 16-bit instruction word
  • 16-register general purpose file
  • Hardware stack (PUSH/POP/CALL/RET)
  • Dual asynchronous control units
  • Pre-fetch buffer approaching 1.0 CPI

Acknowledgments

This project builds on the work of:

  • Ben Eater — whose 8-bit breadboard computer series demonstrated that CPU design can be made completely transparent
  • Leon Nicolas — whose cascaded RAM implementation in Logisim provided the structural insight that led to STEPLA-1’s hardwired control matrix
  • Albert Paul Malvino — Digital Computer Electronics
  • Patterson and Hennessy — Computer Organization and Design
  • Charles Petzold — Code: The Hidden Language of Computer Hardware and Software

Contributing

Contributions welcome. Areas of particular interest:

  • Physical breadboard build documentation
  • Additional assembly programs
  • Assembler implementation
  • Proteus simulation port
  • v3.0 architecture discussion

Please open an issue before submitting large changes.


License

This project is open source. MIT License


Similar Articles

Building the TD4 4-Bit CPU

Hacker News Top

An article detailing the hands-on assembly and testing of a TD4 4-bit CPU based on the book 'How to Build a CPU' and open-source PCB designs.

20000 Gates and 20 MIPS [pdf]

Hacker News Top

Historical 1990 paper from Amdahl detailing the design of a 20 MIPS mainframe processor built with 20,000 logic gates.