REDSTONEPEDIA › Circuits › Adders
Adder slice: full adders that stack into an adder of any width (ripple-carry adder)
adder slice: copies stack into any width · 54 blocks
A full adder made to be copied: stack copies side by side and each copy's carry out feeds the next copy's carry in, so N copies add two N-bit numbers (a ripple-carry adder).
54 blocks per bit · reacts in 18 ticks (0.9 s), 12 ticks (0.6 s) more for each bit after the first · fits in 8×2×8
Try it
Turn on A0, B0 and CIN (the carry in) with the buttons under the view: S0 lights when one or three are on, COUT when two or more are (1 + 1 + 1 = 11 in binary). To add longer numbers, stack copies side by side: each copy's COUT is the next copy's CIN. Press play under the view to watch a demo on a loop; touch any other control to take over.
How this design does it: Each bit is two half adders side by side: each half adder's carry feeds a repeater, the two lines join, and a last repeater lights a lamp that is the next bit's carry-in.
Build it
Download .litematic Download the design as text
The .litematic opens in Litematica (Minecraft 26.3): every block of the design in one region. The text file is the same build written as plain text, block by block.
Blocks used: comparator redstone block redstone lamp redstone torch redstone wire repeater stone
Details: how it works, measurements and properties
In depth
adds two binary numbers, bit by bit with the carry
How to try it
Press play under the view to watch the demo on a loop (the badge reads demo with the step it is on; the same sequence is drawn as a timing diagram below). Touch any control to stop it and try the circuit yourself.
To try it: press and hold the A0 button of the bar (or the cell tagged A0) to power that input; a quick tap sends a short 2-tick pulse; press and hold the B0 button of the bar (or the cell tagged B0) to power that input; a quick tap sends a short 2-tick pulse; press and hold the CIN button of the bar (or the cell tagged CIN) to power that input; a quick tap sends a short 2-tick pulse.
Inputs are tagged in lime; the output is tagged COUT, S0: the orange glass marker next to it glows while the output is on (the output strip by the demo badge shows its last 40 game ticks, 2 seconds). Drag to look around, pinch or scroll to zoom, step one game tick at a time with the step button.
Inputs and output over time
The inputs follow this schedule (the 3D view's demo plays the same). Lime: an input is on; orange: the output is on (taller = a stronger signal, 1 to 15). Time runs left to right in game ticks (20 ticks = 1 s).
Swipe the diagram sideways: the whole sequence lasts 1289 ticks (1 min 4.45 s).
Step by step (8 lines)
on-blip: 2 inputs change from a=0 b=0 cin=0 to a=0 b=1 cin=1: s0 on-blip: 2 inputs change from a=1 b=1 cin=0 to a=1 b=0 cin=1: s0 gray: 7 states, worst latency 18 ticks (0.9 s) walk: 25 states, worst latency 18 ticks (0.9 s) jump: 16 states, worst latency 18 ticks (0.9 s) slice x2: latency 30 ticks (1.5 s) (a0 falls from a=01 b=11 cin=1), glitches 66, per bit 54.0 blocks, carry in and out, input fed through the build slice x3: latency 42 ticks (2.1 s) (a0 falls from a=101 b=011 cin=1), glitches 329, per bit 54.0 blocks, carry in and out, input fed through the build slice x4: latency 54 ticks (2.7 s) (a0 falls from a=0111 b=1001 cin=1), glitches 1509, per bit 54.0 blocks, carry in and out, input fed through the build
Measurements
| metric | value | what it means |
|---|---|---|
| latency | 18 ticks (0.9 s) (a0 rises from a=0 b=1 cin=1) | the worst time from an input change to the output's change |
| glitches | 11 | extra output changes while the inputs change |
| carry | in and out | carry in and out: it takes a carry input and gives a carry output, so copies chain into wider adders; carry out: a carry output only |
| input | fed through the build | |
| slice | 54 blocks per bit, latency 18 + 12 (N-1) ticks |
Notes from its designer
Each bit is two half adders side by side: each half adder's carry feeds a repeater, the two lines join, and a last repeater lights a lamp that is the next bit's carry-in. Copies stacked every 7 blocks make a ripple-carry adder of any width.
Properties
| Study | Adders |
|---|---|
| Kind | Adder slice: full adders that stack into an adder of any width (ripple-carry adder) |
| Blocks placed | 54 (not counting the input levers or buttons the view adds) |
| Box | 8×2×8 (128 blocks of space) |
| Made of (the blocks that change state) | comparator, redstone lamp, redstone torch, redstone wire, repeater |
| Inputs / outputs | A0 (repeater), B0 (repeater), CIN (repeater) / COUT, S0 |
| Design file | fa-slice-54b |
The design file
Design file (44 lines)
# Adder slice: adder slice: copies stack into any width · 54 blocks # https://vjeux.github.io/redstonepedia/circuits/adder/fa-slice-54b.html name: fa-slice-54b circuit: adder 1 slice: 0 0 7 port input.a0: 3 1 -1 port input.b0: 2 1 3 port input.cin: -4 1 -2 port output.s0: -4 1 1 port output.cout: -4 1 5 origin: -4 0 -2 palette: R minecraft:redstone_block S minecraft:stone L minecraft:redstone_lamp[lit=false] d minecraft:redstone_wire[east=side,north=side,power=0,south=side,west=side] a minecraft:comparator[facing=south,mode=subtract,powered=false] b minecraft:comparator[facing=east,mode=subtract,powered=false] n minecraft:comparator[facing=north,mode=subtract,powered=false] t minecraft:redstone_wall_torch[facing=south,lit=true] u minecraft:redstone_wall_torch[facing=north,lit=true] e minecraft:redstone_wall_torch[facing=east,lit=true] w minecraft:redstone_wall_torch[facing=west,lit=true] p minecraft:repeater[delay=1,facing=north,locked=false,powered=false] q minecraft:repeater[delay=1,facing=west,locked=false,powered=false] v minecraft:repeater[delay=1,facing=north,locked=false,powered=false] layer 0: ........ .SSS.... .SSSRSS. .R...SS. ...S.SS. SSSSS... S..SS... ........ layer 1: .e...... .nddS... .dqnadbt .bwSupd. ...vSbd. ddddv... v..dd... L.......