Complete Redstone Computer

A general-purpose Redstone computer is an advanced digital logic machine capable of executing custom programs and games like Tetris or Snake rather than performing a single hardwired task. By combining an Arithmetic Logic Unit (ALU), registers, memory banks, and a program counter, you can write software in custom assembly language and import it as a schematic to run inside Minecraft.

Redstone ComputingExpertJava Edition
Complete Redstone Computer video tutorial

Video: How to Make a Redstone Computer from Scratch by mattbatwings

How to build it

  1. Set Up Your Building Environment

    Start in a flat creative world (built in Java 1.18.2 in the video). Install helper tools like WorldEdit for stacking components, Carpet Mod for tick warping, and Redstone Tools to speed up the massive wiring process.

  2. Build the 8-Bit Carry-Cancel Adder

    Begin the Arithmetic Logic Unit (ALU) by building an 8-bit carry-cancel adder (CCA) to handle addition. Configure the B-input lines with Redstone torches so they can be inverted along with a carry-in of 1 to perform two's complement subtraction (A - B).

  3. Add Bitwise Logic Operations to the ALU

    Expand the ALU so each of the 8 bit-lanes can compute the six two-input bitwise logic gates: OR, AND, XOR, NOR, NAND, and XNOR. Connect a control setting input so the ALU can output any of its 8 total functions (addition, subtraction, and the 6 logic operations).

  4. Construct the Register File

    Build a small collection of 8-bit registers where each register holds a single number for quick access. Wire the output of the register file into the two 8-bit inputs of your ALU, and route the ALU's 8-bit output back into the register file for writing results.

  5. Define the Instruction Set and Machine Code

    Plan out your custom assembly instruction set—such as Load Immediate (LDI), ADD, and Halt (HLT)—and map each instruction and register address to binary machine code (1s and 0s).

  6. Build the Instruction Memory Bank

    Create the instruction memory hardware to physically store your program's binary instructions in sequential addresses (Address 0, Address 1, Address 2, and so on) so the computer can read them from top to bottom.

  7. Wire the Program Counter (PC)

    Build a sequential register for the Program Counter with a main input, main output, and a clock pulse line. Wire it so that it starts at address 0 and increments by 1 on each clock cycle to advance to the next instruction in memory.

  8. Add Flags, Jumping, and Branching Logic

    Connect status flags from the ALU output and wire branching logic back into the Program Counter's input. This allows the computer to overwrite the Program Counter with a new address when a conditional jump or branch instruction triggers.

  9. Install the Call Stack

    Build a hardware call stack connected to the Program Counter system. This stores return addresses in memory so your assembly programs can jump to reusable functions and return to where they left off.

  10. Construct the Data Memory Bank

    Build a large addressable read/write memory bank separate from your instruction memory. Wire it to your data buses so programs can store and retrieve variables at any memory address during execution.

  11. Connect Input and Output (I/O) Devices

    Attach user input controls and Redstone lamp displays or peripheral ports to the data bus so you can interact with running programs and see visual output.

  12. Assemble and Paste Your Program Schematic

    Write your program in your custom assembly language, assemble it into a binary Minecraft schematic of 0s and 1s, and paste it directly into the Instruction Memory using WorldEdit to run the code.

How it works

This computer separates its hardware into combinational components (which have no memory and immediately compute an output from their inputs) and sequential components (which hold state in memory and only update when pulsed by a central clock signal).

  • Program Counter & Instruction Memory: The Program Counter (sequential) holds the address of the current instruction, starting at 0. Instruction Memory reads that address and sends the encoded binary instruction lines out to control the rest of the hardware.
  • Register File & ALU: When executing an instruction like LDI R1 2 (Load Immediate), the value 2 is clocked into Register 1. When executing ADD R1 R2 R3, the Register File outputs the 8-bit values of R1 and R2 into the combinational ALU with the setting set to ADD. The ALU's carry-cancel adder computes the sum, and the next clock pulse saves that result into R3.
  • Data Memory, Call Stack & Branching: Larger data values are read from or written to the Data Memory bank by address. When a function call or conditional branch occurs, the Call Stack and branching circuits feed a new target address into the Program Counter instead of simply adding 1, allowing loops and subroutines before hitting a HLT (Halt) instruction.

Tips & variations

  • Trade-offs vs. Single-Purpose Circuits: A general-purpose Redstone computer is much slower than a dedicated hardwired circuit (often up to 1,000x slower), so use external simulation mods like Carpet (tick rate speeding) or MCHPRS (Minecraft High Performance Redstone Server) if you want to run complex games like Tetris at playable speeds.
  • Prerequisite Knowledge: Before building a full CPU from scratch, practice building basic binary logic gates, 8-bit carry-cancel adders, multiplexers, and D flip-flop registers.
  • Use Schematics for Software: Rather than flipping hundreds of levers by hand to program the ROM, use an external assembler script to convert text assembly code into a schematic file and paste it into the instruction memory with WorldEdit.

Frequently asked questions

Is this Redstone computer Turing-complete?
Yes. Because it supports conditional branching, reading and writing memory, and arbitrary instruction sequences, it can simulate a Turing machine and compute any general algorithm within its memory limits.
What operations can the 8-bit ALU perform?
The ALU performs 8 operations on two 8-bit inputs: addition (via a carry-cancel adder), subtraction (by inverting input B with Redstone torches and adding 1), and six bitwise logic operations (OR, AND, XOR, NOR, NAND, and XNOR).
Why use a custom assembly language instead of C++ or Python?
High-level languages require a complex compiler to translate code into assembly before becoming machine code. Writing directly in a simplified custom assembly language lets you assemble commands directly into binary schematics of 1s and 0s that can be pasted into Minecraft.

Components used

More computer