
Video: Building a 16 bit calculator in minecraft! /Addition, subtraction, display/ -Part 1 by 𝕯𝖗𝖎𝖔𝖓_086
How to build it
- Build the Keypad and Control Interface
Create a 3x3 button keypad numbered 1 through 9 (plus a 0 button) so you can enter numbers one digit at a time. Add a lever to toggle between typing your first number (Input A) and second number (Input B), along with selector buttons for addition, subtraction, and resetting.
- Wire the Decimal-to-Binary Encoder
Run 10 redstone lines out from the back of your keypad buttons. Place redstone torches along the lines to build a 4-bit encoder that translates any single button press (0-9) into a 4-bit binary value (1, 2, 4, and 8) plus an extra pulse line to trigger the shift registers.
- Construct the 7-Segment Display Wall
Build a large vertical wall of redstone lamps arranged into 20 seven-segment digits: two 5-digit rows for Input A and Input B (up to 65,535 each) and a 10-digit row for the final answer. Group the lamps into seven distinct segments per digit and wire independent redstone lines behind each segment.
- Attach Display Decoders to All 20 Digits
Behind each of the 20 display digits, stack two decoder layers. The first decoder isolates the incoming 4-bit binary combination into a single unpowered line, and the second uses redstone torches to power the exact combination of the seven lamp segments needed to draw the number 0 through 9.
- Add Shift Registers and Leading Zero Blanking
Wire shift register modules behind the input displays so that each time you press a keypad button, the previously typed digit shifts one place to the left to make room for the new digit in the ones place. Add leading-zero logic across the digits to keep unused zeros to the left completely dark.
- Gate Input A and Input B with Comparators
Connect your keypad encoder output to both the Input A and Input B display shift registers. Place redstone comparators in subtract mode along both buses and wire them to your A/B selection lever with inverting torches; powering the side of a comparator blocks the signal so digits only enter the currently selected number.
- Build the 16-Bit Carry Cancel Adder (CCA)
Stack 16 vertical layers of a Carry Cancel Adder (CCA) to process 16-bit binary numbers (from 1 up to 32,768). Connect the layers with a vertical slab tower so carry signals are managed across all bits simultaneously rather than rippling slowly one bit at a time.
- Wire the BCD-to-Binary Input Accumulator
To convert individual decimal button presses into a single 16-bit binary value, build a modified CCA module for the inputs. Route the previous output back into the adder shifted up by 1 layer (multiplying by 2) and shifted up by 3 layers (multiplying by 8) at the same time—this multiplies the existing value by 10 before adding the newly pressed digit.
- Connect the Subtraction Logic and Binary-to-BCD Converter
Configure the main 16-bit arithmetic unit to handle both addition and binary subtraction, then feed its 16-bit output into a Binary-to-BCD (Binary-Coded Decimal) converter. Finally, wire the converter's 4-bit decimal outputs into the bottom row of your 7-segment display decoders and test calculations from the keypad.
How it works
This 16-bit calculator processes math by converting human-readable decimal digits into pure binary and back again through five sequential stages:
- 4-Bit Keypad Encoding: Pressing a digit button on the 3x3 panel unpowers a dedicated line, unlocking specific redstone torches that output a 4-bit Binary-Coded Decimal (BCD) value (lines weighted
1,2,4, and8) alongside a clock pulse line. - Comparator Bus Gating & Shift Registers: The A/B input lever powers the side of subtract-mode comparators on whichever bus is inactive, completely blocking signals of strength 15 from passing through. On the active bus, the clock pulse shifts stored digits one position to the left while loading the new digit into the rightmost slot.
- Times-10 BCD-to-Binary Accumulation: In binary, shifting a number left by 1 bit multiplies it by
2, and shifting it left by 3 bits multiplies it by8. Whenever a new digit is typed, the input accumulator routes the existing binary total into bit layers+1and+3of a Carry Cancel Adder simultaneously (2x + 8x = 10x) and adds the new 4-bit digit. - 16-Bit Carry Cancel Adder (CCA): Unlike a ripple-carry adder that waits for each carry to travel sequentially through 16 stages, the CCA uses a vertical slab tower to cancel and control carries across all 16 bit layers at once, calculating sums and differences up to
65,535in a fraction of a second. - Binary-to-BCD & 7-Segment Decoding: The resulting 16-bit binary answer passes through a Binary-to-BCD converter to split it back into individual 4-bit decimal digits. Stacked torch decoders behind the redstone lamp wall translate each 4-bit group into the seven lamp segments while suppressing leading zeros.
Tips & variations
- Check Torch Alignment on Decoders: When copying the 7-segment decoders and comparator gates across 20 digits, being off by even a single block on an inverting torch will cause digits to overlap or fail to register. Test each digit with numbers like
3,5, and7before tiling. - Use Comparators Instead of Pistons for Busing: While sticky pistons pulling blocks can break redstone lines to select Input A or Input B, comparators in subtract mode powered from the side are completely silent, instant, and less prone to timing glitches.
- Respect the 16-Bit Limit: A 16-bit unsigned system has a maximum decimal value of
65,535. Entering or adding numbers that exceed this threshold will cause a binary overflow and display an inaccurate result. - Color-Code Your Modules: Use different colors of wool or concrete for the encoder, shift registers, carry cancel adder, and BCD converters so you can easily trace bit lines when debugging.


