Computer Register File

A register file is an essential memory component for a redstone computer, allowing you to store multiple binary numbers and read or write to them using specific addresses. You will need this circuit alongside an Arithmetic Logic Unit (ALU) so your computer can save intermediate results and execute complex multi-step instructions.

Memory CircuitsExpertJava Edition
Computer Register File video tutorial

Video: The Register File - Let's Make a Redstone Computer! #3 by mattbatwings

How to build it

  1. Stack the 8-Bit Repeater Locks

    Build a vertical column of 8 redstone repeaters stacked on top of one another with a 1-block gap between each level. Each repeater acts as a data latch for a single bit, forming one vertical 8-bit register.

  2. Add Comparator Locking for Writing

    Place a comparator facing directly into the side of each data repeater, and feed a signal strength of 1 into the back of these comparators to keep the repeaters locked. Run a vertical glass tower with redstone dust alongside the side inputs of those comparators so powering the tower cancels the signal and unlocks all 8 bits at once.

  3. Build the Double-Inversion Read Circuit

    At the output of each data repeater, build a two-stage inversion using a comparator outputting a signal strength of 2 leading into a block with a redstone torch. Run a second vertical glass tower with redstone dust that powers the line before the torches; when this tower is powered, it forces the torches off and blocks the register from being read.

  4. Tile and Stagger 15 Physical Registers

    Duplicate this vertical 8-bit register design side-by-side to create registers 1 through 15. Stagger every other register horizontally so the comparator logic does not interfere with adjacent slices, making the array 2-wide tileable.

  5. Connect the Shared 8-Bit Data Input Bus

    Wire the back of all the data repeaters across all 15 registers to a single 8-bit input bus. Any binary number placed on this input bus will be sent to the entrance of every register simultaneously, waiting for one to unlock.

  6. Wire the 4-Bit Write Decoder and Clock

    Build a 4-bit binary decoder above or beside the array and connect its outputs 1 through 15 to the write glass towers of your 15 registers. Connect the write address input through a 2-tick pulse generator triggered by a button (your clock signal) so the address is only released to unlock the chosen register for 2 ticks.

  7. Leave Address 0 Empty for the Zero Register

    Do not build a physical register for address 0 on your decoder. When the write input is cancelled (defaulting to 0) or when address 0 is explicitly selected, any written data is simply discarded and any read operation defaults to outputting 0.

  8. Mirror the Array for Simulated Dual Read

    Build an identical, symmetrical copy of the entire 15-register array right next to the first one. Connect both the original array and the mirrored copy to the exact same write decoder lines and 8-bit data input bus so both copies stay perfectly in sync whenever you press the clock button.

  9. Attach Two Independent Read Decoders

    Build two separate 4-bit read decoders—one for the left register array (Read Port 1) and one for the right mirrored array (Read Port 2). Wire them so that selecting an address unpowers that specific register's read glass tower, allowing its 8-bit stored value to pass through to that side's output bus.

  10. Add the Master Enable Line

    Run a master enable lever line that cancels all three address inputs (Write, Read 1, and Read 2) whenever the lever is turned off. Cancelling the addresses forces the entire register file to point to address 0 (the zero register), disabling all writes and forcing both read outputs to 0 without erasing your saved data.

How it works

This register file stores up to fifteen 8-bit numbers (plus a hardcoded 0 at address 0) and allows two independent addresses to be read at the exact same time.

  • Data Latching (Write): A redstone repeater locked from the side holds its current powered or unpowered state indefinitely. In the compact 2-wide design, a redstone-comparator with a signal strength of 1 constantly locks each repeater. When the Clock (Write) button is pressed, a 2-tick pulse generator briefly releases the 4-bit write address into the write decoder. The selected decoder line powers that register's write glass tower, cancelling the locking comparators from the side for 2 ticks so the new 8-bit data flows in and gets relocked.
  • Signal-Strength Isolation (Read): Reading uses double inversion so the signal polarity stays accurate. The first inversion uses a comparator with a signal strength of 2, and the second uses a redstone-torch. By default, every register's read glass tower is powered, forcing the torches off and blocking output. When a read decoder selects an address, it unpowers that register's glass tower. The signal strength of 2 is just strong enough to reach its own output torch without bleeding into adjacent 2-wide slices.
  • Zero Register (Address 0): Because cancelling a binary address forces its lines to 0000, having a physical register at address 0 would cause it to stay constantly unlocked whenever the write button isn't pressed. By omitting physical register 0, address 0 becomes a dedicated Zero Register: writing to it throws the data away, and reading from it outputs nothing (zero).
  • Simulated Dual Read: Rather than weaving two messy sets of output buses through one bank of registers, the physical memory is mirrored into two identical banks. Both banks receive the exact same write pulses simultaneously to keep their data identical, while two separate read decoders allow you to read two completely different addresses from each side at once.

Tips & variations

  • Simpler 4-Register Variant: If you don't need a compact 16-register array, you can build a wider 4-register version (registers 1–3 plus a zero register) using standard repeaters locking the data repeaters directly instead of the staggered comparator setup.
  • Pulse Length Matters: Always use a 2-tick pulse generator for the write/clock button. A raw stone button pulse is much longer than necessary and slows down your computer's clock cycle, while a 1-tick pulse is too short for the repeaters to reliably unlock, take in new data, and relock.
  • Staggering Slices: When building the 2-wide tileable comparator version, make sure adjacent registers are offset (staggered) properly. If you align the signal-strength-2 read comparators directly beside each other without staggering, the dust lines will connect and corrupt nearby registers.
  • Enable Without Resetting: Toggling the Enable lever off does not wipe the memory latches—it simply forces the read and write addresses to 0. Flipping Enable back on immediately restores normal access to your stored numbers.

Frequently asked questions

Why is there no physical register for address 0?
Cancelling the write address when the clock button isn't pressed sets the decoder input to 0. By removing physical register 0, nothing is unlocked while idle, and address 0 doubles as a convenient 'zero register' that always outputs 0 and discards any data written to it.
What is the difference between true dual read and simulated dual read?
True dual read uses one set of registers with two separate output buses wired to every bit, which gets very bulky in redstone. Simulated dual read duplicates the entire register bank into two symmetrical copies that get written to at the exact same time, allowing each side to be read cleanly with its own decoder.
Why use comparators to lock the repeaters instead of normal repeaters?
Repeaters can be locked by a comparator facing their side just like another repeater, but using comparators with signal strength 1 and 2 allows the read and write logic to be staggered and compressed into a 2-wide tileable footprint.
Does turning off the Enable line erase the stored numbers?
No. Turning off the Enable input simply blocks the address lines so the decoders point to address 0. All locked repeaters inside registers 1 through 15 keep holding their data until overwritten.

Components used

More register / shift register