This is a complete computer-architecture toolchain built from scratch in Rust. It is centered around Electron, a custom 8-bit, Turing-complete, RISC-V-inspired CPU.
This repository contains all components of the toolchain:
- The Assembler: A compiler that translates custom Electron Assembly (
.elt) into 8-bit machine code. - The Emulator: A Rust-based emulator with a
raylib-rsGUI that runs the machine code, allowing for rapid development and debugging. - The VS Code Extension: Provides full syntax highlighting for the Electron Assembly language.
- The Minecraft Implementation: The final CPU design was prototyped and built using Redstone components in Minecraft, proving the architecture in a sandboxed, logic-gate environment.
As a proof-of-concept, the final Electron V1 CPU was designed and built from first principles using Redstone components within Minecraft. The entire computer and its varients exist on a PS4 minecraft world, hand made on controller with every block hand placed, and with no help from external programs or mods.
See the Gallery section below for more images of the Minecraft implementation.
- ROM: 96 bytes (32 lines)
- Instruction size: 3 bytes
- RAM: 32 bytes
- ALUP: 8 ticks
- Registers: 7 bytes (+1 zero register)
- Cores: 1
- Pipeline: 4 stage waterfall
- Bus width: 8 bit
- Display: 8x8 screen
- I/O: 8 Bytes out, 1 byte in
- Speed (Real time): 1hz
You can compile and run an assembly program in the Rust-based emulator with a single command. This will build the toolchain, assemble the .elt file, and launch the emulator GUI.
# Assemble and run the fibonacci program in the emulator
cargo run -- -f fibonacci.elt
# Assemble and run the heart-drawing program
cargo run -- -f heart.elt
# Or you can run without compiling (Easiest):
./electron -f heart.eltThe emulator provides a visual interface to inspect the CPU's state, including registers, RAM, and the 8x8 display output.
The custom 8-bit Instruction Set Architecture (ISA) is Turing-complete and inspired by RISC-V principles.
For a comprehensive technical deep-dive into the CPU architecture, instruction set, pipeline model, and programming guidelines, see the ARCHITECTURE.md documentation.
It currently supports the following instructions and their variants:
IMMMOVADDADDCSHRNOOPOUTJMPBIENOT
When writing binary literals in assembly, use the uppercase B prefix:
IMM R1 B11110000
To make programming easier, a custom VS Code extension provides full syntax highlighting for .elt files.
The emulator GUI is built with raylib-rs. To run it, you may need to install C/C++ dependencies from raylib-rs.
Quick Installation:
- Open VS Code
- Press
Ctrl+Shift+X(orCmd+Shift+Xon macOS) to open Extensions - Click the
...menu → Select "Install from VSIX..." - Navigate to
electron-lang/electron-language-0.0.1.vsixand open it - Reload VS Code when prompted
For detailed installation instructions (including alternative methods and troubleshooting), see electron-lang/README.md.
For more detailed information, refer to the spreadsheet. Note that this document may not be fully up-to-date with the current progress of the repo.
Below is a complete gallery of the Minecraft Redstone CPU implementations:







