Redstone Arithmetic Logic Unit

An Arithmetic Logic Unit (ALU) is the core processing component of any Minecraft redstone computer or advanced calculator. This tutorial shows you how to modify a vertical 8-bit carry cancel adder into a complete ALU capable of addition, subtraction, bitwise operations (AND, OR, XOR), and division by two via right-shifting. You will also wire a central control ROM panel to easily toggle between different mathematical and logic functions.

Redstone ComputingExpertJava Edition
Redstone Arithmetic Logic Unit video tutorial

Video: How to make an ALU by Electric_van

How to build it

  1. Prepare the 8-Bit Carry Cancel Adder

    Start with a base 8-bit vertical carry cancel adder. Ensure you have clear access to the A and B input lines at the front, the internal carry lines, and the output lines at the back.

  2. Build the 'Invert A' and 'Invert B' Gates

    Extend the A and B input lines outward from the adder. Construct a vertical stack of eight standard XOR gates on the A input side and another stack of eight XOR gates on the B input side.

  3. Wire the Inversion Control Towers

    Build two vertical glass redstone towers next to your new XOR stacks—one for Invert A and one for Invert B. Connect a solid block partway up if needed to boost the signal strength so a single lever at the bottom can toggle all eight XOR gates at once.

  4. Test Addition and Subtraction

    Verify that all inputs are properly connected by testing a simple addition problem (like 3 + 5 = 8). Next, turn on the Invert B line and the Carry-In line to test two's complement subtraction (such as 5 - 3 = 2).

  5. Install the Flood Carry Mechanism

    Locate the internal carry blocks inside each bit of the adder. Place a repeater and a redstone torch feeding into every carry block, then link them to a single vertical glass tower so you can force all carries on or off simultaneously for bitwise logic.

  6. Add the XOR-to-OR Bypass

    Near the back of the adder, build an L-shaped glass bridge that routes around each bit's final XOR gate. Place a comparator in subtraction mode along with a repeater on each bridge, and use solid blocks to isolate the dust lines so adjacent bits do not cross-connect.

  7. Connect the XOR-to-OR Control Tower

    Run a vertical glass redstone tower up the side of the bypass bridges. When powered, this line enables or cancels the bypass through the subtract-mode comparators, allowing the ALU to output standard OR logic instead of XOR.

  8. Construct the Right-Shift Output Module

    At the output end of the ALU, extend the lines and build a vertical switching array using repeaters and comparators set to subtraction mode. Route an alternate path from each bit down one level into the bit below it, leaving the bottom bit without a downward shift output.

  9. Wire the Right-Shift Toggle

    Connect the subtraction-mode comparators of the output module to a vertical redstone tower with redstone torches. Toggling this control line blocks the normal straight-through output and redirects every bit down by one position, dividing the binary number by two.

  10. Build the Control ROM Panel

    Run all your control lines (Invert A, Invert B, Carry-In, Flood Carry, XOR-to-OR, and Right Shift) to a single accessible control panel. Set up a bank of levers or a decoder ROM so you can activate specific combinations of control lines for each operation.

How it works

This ALU operates by manipulating the inputs, internal carries, and outputs of a standard 8-bit carry cancel adder using dedicated control lines:

  • Invert A & Invert B: Each input bit passes through an XOR gate before entering the adder. When the control tower is off, the signal passes unchanged. When the control tower is powered, the XOR gate acts as a conditional NOT gate, inverting all 8 bits. Combining Invert B with a Carry-In performs two's complement subtraction.
  • Flood Carry: Normal addition propagates carries from lower bits to higher bits. For bitwise logic, bits must not affect their neighbors. Activating Flood Carry forces the internal carry state across all 8 bits uniformly, disabling arithmetic carry propagation and enabling bitwise operations like AND and NAND.
  • XOR-to-OR Bypass: An adder naturally uses XOR gates to calculate sums. The bypass circuit uses a comparator in subtraction mode to route signals around the final XOR gate, allowing the unit to compute standard inclusive OR logic.
  • Right Shift: Using two paths controlled by subtract-mode comparators and redstone torches, the output stage either sends bit N straight out or shifts it down to bit N-1. Shifting a binary number one place to the right divides it by 2 (ignoring the remainder).

Tips & variations

  • Signal Strength in Glass Towers: Redstone torches cannot power glass blocks directly, and a 15-strength signal won't reach the top of an 8-bit vertical stack on its own. Replace a glass block partway up the tower with a solid block and a repeater to refresh the signal.
  • Preventing Cross-Talk: When wiring tightly packed vertical slices (especially in the XOR-to-OR and Right-Shift stages), place solid blocks above diagonal dust connections to cut the line and prevent upper bits from bleeding into lower bits.
  • Comparator Mode: Make sure every comparator used in the XOR-to-OR bypass and Right-Shift multiplexers has its front torch lit (subtraction mode), as they act as signal switches rather than analog comparators.

Frequently asked questions

What prerequisite build do I need before starting this ALU tutorial?
You need an 8-bit vertical carry cancel adder already built, as this tutorial modifies an existing adder by attaching input inverters, carry overrides, and output shifters.
How does the ALU perform subtraction without a dedicated subtractor circuit?
It uses two's complement math. By turning on both the 'Invert B' line and the 'Carry-In' line, the B input is inverted and 1 is added, turning A + B into A - B.
What does the Right Shift function do in a redstone ALU?
Right shifting moves every binary bit down by one place value (e.g., the 4s place moves to the 2s place), which divides any binary number by two.

Components used

More alu / cpu part