Matrix Binary Decoder

A matrix binary decoder combines a horizontal decoder and a vertical decoder to turn two 1D binary addresses into a 2D grid of outputs. By crossing two 4-bit decoders (16 outputs each), you create an 8-bit system with 256 individual intersection points without building a massive single-line decoder. This circuit is essential for addressing X/Y pixels on a redstone display screen or selecting memory cells in large RAM and ROM arrays.

Redstone ComputingAdvancedJava Edition
Matrix Binary Decoder video tutorial

Video: Logical Redstone Tutorial 2: Our First Matrix Decoder by WildEngineering

How to build it

  1. Build the First 4-Bit Horizontal Slice

    Start with a single vertical-to-horizontal 4-bit decoder slice set to the zero binary address. Extend its output forward with a block staircase that carries redstone dust upward to feed a vertical column.

  2. Stack the Horizontal X-Axis Decoder

    Tile or stack your horizontal decoder slice 15 times horizontally so you have 16 columns (addresses 0 through 15), encoding the binary torch pattern across the 4 input lines. Update the top redstone line so only the selected column's output remains active.

  3. Add Repeaters for Vertical Signal Strength

    Along the vertical output columns coming off the bottom decoder, insert redstone repeaters going up the staircase. Because the signal has to climb across 16 rows, you will need repeaters spaced along the vertical line so power reaches the very top.

  4. Position the Vertical Y-Axis Decoder

    Directly above and intersecting the horizontal decoder's vertical output columns, build a single horizontal-to-vertical 4-bit decoder slice. Its horizontal output line should run across all 16 vertical columns.

  5. Stack the Vertical Y-Axis Rows

    Stack the vertical decoder slice upward 15 times to create 16 horizontal rows (0 through 15) on the Y-axis, encoding the binary address torches for each row. This forms a 16x16 grid of 256 output torches where the X columns and Y rows intersect.

  6. Combine Inputs into an 8-Bit Vertical Bus

    Route the 4 input lines from the bottom (X) decoder and the 4 input lines from the top (Y) decoder over to a single 8-lever vertical input panel. The bottom 4 levers act as the least significant bits (X position 0–15) and the top 4 levers act as the most significant bits (Y position 0–15).

  7. Update Lines and Test X/Y Coordinates

    Ensure repeaters are placed on the horizontal row lines so signal strength reaches all 16 columns across the grid, then update the redstone lines. Toggle the bottom 4 levers to move the active output torch left/right (X) and the top 4 levers to move it up/down (Y).

How it works

A standard 1D decoder takes an n-bit binary input and activates one of 2^n outputs in a single row or column. A matrix decoder multiplies two smaller decoders together across two axes (X and Y), squaring the total number of outputs:

  • X-Axis (Bottom 4 Bits): The lower 4-bit decoder reads the first 4 levers (values 0 to 15). All unselected columns remain powered, while the single selected column turns off its inhibiting line (or vice versa, depending on torch inversion), enabling only that vertical column.
  • Y-Axis (Top 4 Bits): The upper 4-bit decoder reads the upper 4 levers (values 0 to 15, representing increments of 16 in an 8-bit number) and selects a single horizontal row across the 16-high grid.
  • 2D AND Intersection: At each of the 256 grid points (16 columns × 16 rows), an output redstone torch is controlled by both its column line and its row line. Because a redstone torch only turns on when all powering inputs to its block are off (NOR/AND logic), only the single torch where the selected X column and selected Y row meet will light up.

Tips & variations

  • Watch Signal Strength on 16x16 Grids: Redstone dust only travels 15 blocks. Across a 16-wide by 16-tall matrix, both the vertical column lines and the horizontal row lines will fall short of the last bit unless you place repeaters midway through the lines and adjust the block spacing so no cross-connections occur.
  • Use WorldEdit for Stacking: Building 256 intersections by hand is tedious. In creative mode, build one slice, use //stack 15 horizontally and vertically, and then break/replace a block on the most significant bit line to fix any stuck redstone torch states after pasting.
  • Synchronizing Timing: Adding repeaters to extend signal reach introduces 1-tick delays to the far side of the grid. If you are hooking the matrix up to high-speed RAM or a synchronized display, add matching delay repeaters to earlier segments so all 256 outputs switch at the same tick.

Frequently asked questions

Why build a matrix decoder instead of a single 8-bit decoder?
A single-axis 8-bit decoder requires a line of 256 outputs in a row, which is huge and slow to bus. By crossing two 4-bit decoders (16x16), you still get 256 unique outputs in a compact 2D square that naturally matches pixel screens and memory grids.
How are the 8 bits split between X and Y?
The first 4 bits (values 1, 2, 4, 8) control the X-axis column (0–15), and the upper 4 bits (values 16, 32, 64, 128) control the Y-axis row (0–15). Together they can address any number from 0 to 255.
Why stay some torches lit after using WorldEdit //stack?
Pasting redstone with WorldEdit often skips block updates. Toggle the input levers or replace a piece of redstone dust along the main bus lines to force the torches to update to their proper state.

Components used

More decoder / encoder