Tileable 4-Bit Redstone ALU

An Arithmetic Logic Unit (ALU) is the core calculation component of any Minecraft redstone computer, capable of handling both mathematical operations and logical comparisons. This tileable 4-bit Bedrock Edition design includes built-in A and B input registers, controllable inverters, and control lines to execute addition, two's complement subtraction, AND, OR, XOR, and NOR operations.

Redstone ComputingExpertBedrock Edition
Tileable 4-Bit Redstone ALU video tutorial

Video: Minecraft Bedrock ALU Tutorial - Redstone Computing by TheDarkness344

How to build it

  1. Set Up the 4-Bit Input Bus

    Build four parallel input lines spaced apart for the 1, 2, 4, and 8 binary bit values, placing the least significant bit (1) on the left and the most significant bit (8) on the right. Place a lever at the start of each line to act as your manual data input.

  2. Place Slab Diodes for Registers

    At the end of each input line, step the redstone signal up using a top slab rather than a repeater or glass block. In Bedrock Edition, slabs act as zero-tick one-way diodes that allow signals to travel upward while preventing register feedback from flowing backward into the input bus.

  3. Frame the A and B Register Flip-Flops

    Branch each bit line into two parallel paths so every bit has a Location A and a Location B. Place 1-tick repeaters leading into the two paths and build elevated block frames above them to house the D flip-flop memory latches.

  4. Install the D Flip-Flop Torch Latches

    Attach redstone torches to the register blocks to create the vertical feedback loops for the D flip-flops. Place redstone dust connecting the upper torch outputs to the lower torch blocks, then remove any temporary supporting blocks in the center so each bit stores its state cleanly.

  5. Wire the Register Write Control Lines

    Run two horizontal control buses across the top of all four bit slices—one for Register A and one for Register B. Place inverting redstone torches over the corresponding A and B latches (alternating A, B, A, B across the array) and add repeaters behind the torches if the signal strength runs out.

  6. Build the Input Inverter Modules

    Extend the output torches from both A and B registers forward into dedicated inverter circuits. For each line, place a lower 1-tick repeater path and an upper redstone torch path so the signal can travel through either an uninverted or inverted route.

  7. Add Pistons to Control Input Inversion

    Mount downward-facing sticky pistons above the inverter blocks for both Register A and Register B, and wire them to two separate horizontal control lines (Invert A and Invert B). Toggling these lines pushes a block into place to switch between the normal signal and the inverted signal.

  8. Construct the Logic and Ripple-Carry Adder Stages

    Route the outputs of the A and B inverters into the main logic and ripple-carry adder section. Build the XOR and AND logic gates for each bit slice, linking the carry-out of each bit from left to right (from the 1s bit toward the 8s bit) and adding a Carry In input on the least significant bit.

  9. Wire the Carry Cut and Adder Bypass Lines

    Run control lines across the adder array for AND enable, Cut Carry, and Cut Adders (Bypass Adders), using Bedrock glass mechanics where needed to prevent accidental piston powering. Finish the output stage by adding an Invert Output control line and an ALU Out read gate.

How it works

This ALU processes data in three distinct stages: temporary storage, input manipulation, and arithmetic/logic execution.

  • Dual D Flip-Flop Registers: A single 4-bit input bus feeds both Register A and Register B. Because slabs act as one-way diodes, both registers can sit on the same input lines without back-feeding each other. Pulsing the Register A or Register B control line unlocks only those specific latches to store the first and second numbers on consecutive clock cycles.
  • Independent Input Inverters: Each register output passes through a piston-controlled inverter. By enabling Invert A or Invert B along with Carry In, the ALU performs subtraction using two's complement arithmetic (either A - B or B - A).
  • Control Flags & Opcodes: By combining control lines, the same hardware performs multiple bitwise and arithmetic functions:
    • SUM (001): ALU Out
    • A - B (010): ALU Out + Invert B + Carry In
    • B - A (011): ALU Out + Invert A + Carry In
    • AND (100): ALU Out + AND + Cut Carry + Bypass Adders
    • XOR (101): ALU Out + Cut Carry
    • OR (110): ALU Out + AND + Cut Carry
    • NOR (111): ALU Out + AND + Cut Carry + Invert Output

Tips & variations

  • Use Slabs, Not Glass, for Diodes: In Minecraft Bedrock Edition, redstone signals can travel both up and down on glass blocks, whereas top slabs only allow signals to travel upward. Using glass at the register input will cause the D flip-flop feedback loop to leak back into your input bus.
  • Repeater Placement on Control Lines: When extending the Register A and B control lines across wider bit widths (such as 8-bit or 16-bit), never place a repeater directly on top of a block holding a control torch. Place the repeater on the block behind the torch block so it properly powers the block and turns the torch off.
  • Clean Up Temporary Blocks: Always remove scaffolding blocks inside the D flip-flops and inverters as you build each slice; stray solid blocks can accidentally cut redstone lines or redirect torches in tightly packed slices.
  • Reversing Bit Order: This build places the Least Significant Bit (1) on the left and the Most Significant Bit (8) on the right. If you prefer the 1s bit on the right, reverse the direction of the half-adder connections and route the carry line from right to left.

Frequently asked questions

Does this ALU work in Minecraft Java Edition?
No, this specific layout is designed for Bedrock Edition. It relies on Bedrock-specific redstone behaviors, such as how glass and slabs interact with vertical redstone signals and nearby pistons.
Can I expand this ALU to 8 bits or more?
Yes. The design is completely tileable. You can build additional bit slices to the right of the 8s bit and extend the horizontal control lines using repeaters placed behind the torch blocks to maintain signal strength.
How does this ALU handle subtraction?
It uses two's complement subtraction. To calculate A minus B, you activate the Invert B line and the Carry In line at the same time while reading the ALU output.
Can this ALU shift bits left or right?
You can shift left by adding the same number to itself (A + A), or you can wire a dedicated bit-shifting module after the ALU output for dedicated shift-left and shift-right operations.

Components used

More alu / cpu part