
Video: How to make an ALU by Electric_van
How to build it
- 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.
- 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.
- 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.
- 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).
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
ANDandNAND. - 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
ORlogic. - Right Shift: Using two paths controlled by subtract-mode comparators and redstone torches, the output stage either sends bit
Nstraight out or shifts it down to bitN-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.





