Simple 4-Bit Redstone ALU

An Arithmetic Logic Unit (ALU) is the core calculation component of any Minecraft redstone computer or calculator. This tutorial shows you how to build a straightforward 4-bit ALU capable of adding and subtracting binary numbers using stacked full adders and piston-controlled output gates.

Redstone ComputingAdvancedBedrock Edition
Simple 4-Bit Redstone ALU video tutorial

Video: 4 Bit Redstone Computer Tutorial: Making the ALU P1 by TheDarkness344

How to build it

  1. Place the 8 Input Lines

    In a large open area, place 8 solid blocks in a row with a one-block gap between each. These represent four pairs of A and B inputs for your 4-bit binary numbers (1, 2, 4, and 8).

  2. Build the First Half-Adder XOR Gates

    Place another block in front of each of the 8 starting blocks. For each of the four pairs, attach redstone torches to the fronts and tops of the blocks, connect them with redstone dust, and place a central block between the two output torches to form your first set of 4 XOR gates with an AND output on top for the carry.

  3. Extend into Full Adders

    From the back of each XOR gate, build a 3-block zigzag pattern extending outward, ensuring the middle offset block juts out to the left side. Build a second XOR gate onto the end of each zigzag so that every bit now has two chained XOR gates.

  4. Wire the Carry Lines

    Place a redstone torch on the left side of the top block of each gate to act as the carry-out. Run a stepped line of blocks with redstone dust from each bit's carry-out torch down into the second XOR gate of the next bit over, placing solid blocks over adjacent dust lines so the signals do not cross.

  5. Test the 4-Bit Adder

    Temporarily place levers on the 8 input blocks at the front and test a few binary sums (such as 1 + 1 = 2, or 3 + 2 = 5). Remove the test levers once you confirm the outputs and carries propagate properly.

  6. Build the Subtractor Unit Above

    Leave a 2-block vertical gap above the bottom adder so the redstone lines do not interfere, then construct an identical 4-bit full adder directly on top of the first one. This top layer will serve as your dedicated subtraction circuit.

  7. Link the Shared Input Bus

    At the front of the machine, build redstone dust staircases that merge the 8 bottom inputs with the 8 top inputs into a single row of 8 main input lines. Place redstone repeaters at the split point so toggling one input line powers both the bottom adder and the top subtractor simultaneously.

  8. Invert Input A for the Subtractor

    On the top subtractor layer only, locate the four 'Input A' lines (every other input line, starting with the first one). Break the piece of redstone dust right before the block and place a redstone torch underneath to invert Input A into a NOT gate.

  9. Invert the Subtractor Outputs

    Go to the back of the top subtractor unit and extend the 4 output lines outward by one block. Place a redstone torch on the front of each of these 4 blocks to invert the final output of the subtractor.

  10. Build the Piston Output Selectors

    Extend the 4 outputs from both the top subtractor and the bottom adder into redstone repeaters facing forward. Place downward-facing sticky pistons holding solid blocks directly in front of the repeaters, and wire the top 4 pistons and bottom 4 pistons to control levers with redstone dust so you can toggle which result (addition or subtraction) is allowed to pass through.

How it works

This 4-bit ALU operates by running addition and subtraction in parallel and using sticky pistons as simple multiplexers to choose which answer to read:

  • 4-Bit Binary Adder (Bottom Layer): Each of the 4 bits uses a full adder made from two chained torch-based XOR gates. The sum comes out the back of the second XOR gate, while the carry condition is detected by the top torches and pushed left into the next bit's second XOR gate (calculating values 1, 2, 4, and 8).
  • 4-Bit Subtractor (Top Layer): Instead of forcing a single adder to do both operations, an identical adder is stacked above the first. By inverting Input A with a redstone torch before it enters the circuit and inverting the Final Output with another torch at the end, the standard adder logic is converted into binary subtraction.
  • Output Enable Gates: Because the shared input bus feeds both layers at the same time, both answers are calculated simultaneously. The rows of sticky pistons push or pull solid blocks in front of the output repeaters, physically connecting or breaking the wire so only the chosen operation travels to the rest of your computer.

Tips & variations

  • Java vs. Bedrock Pistons: This circuit was designed in Minecraft Bedrock Edition, where redstone dust can run directly across the tops of downward-facing pistons without unintended triggering. In Java Edition, quasi-connectivity (QC) can keep pistons extended when powered from above; run your piston control line along a row of solid blocks placed directly behind the pistons instead.
  • Avoid Burnout Clocks: When adding the inverting torch to Input A on the top subtractor, always break the redstone dust above the block before placing the torch underneath—otherwise the torch will power itself through the dust and burn out.
  • 5th Bit Carry: The final carry-out on the 4th bit (the value 16 line) is omitted here to keep the output strictly 4-bit, though you can leave the torch attached for debugging overflow.

Frequently asked questions

What can this 4-bit Redstone ALU calculate?
It takes two 4-bit binary numbers (each ranging from 0 to 15) and calculates both their sum and their difference at the same time.
Why does this ALU have two separate layers?
The bottom layer handles addition while the top layer handles subtraction. Stacking two separate units makes wiring the control logic much simpler for beginners than multiplexing a single adder.
Can I build this 4-bit ALU in Minecraft Java Edition?
Yes, the torch-and-dust logic gates work identically in both editions, but you will need to adjust the redstone dust line powering the sticky pistons at the output to account for Java's quasi-connectivity.

Components used

More alu / cpu part