REDSTONEPEDIA › Circuits › Memory and counters

Memory and counters

Remember things: a light that stays on after someone crosses a tripwire until you reset it, the digits of a combination lock, or doing something every 4th item through a hopper.

Filter them in the index

The pictures show each design with its inputs and a lamp on its output; the block counts leave those out.

Counter: counts pulses and reacts on a set count

Counts input pulses and changes its output once every few pulses (a set count).

every 4th pulseCounter
every 2nd to 576th pulse · 3 to 29 blocks
pictured, every 4th: made of comparator, copper bulb · fits in 4×2×1
39 versions1 block wide

Copy-and-hold memory (D latch)

The output copies the data input (D) while the enable input allows it, and keeps its last value otherwise.

Copy-and-hold memoryCopy-and-hold memory
reacts in 4 ticks (0.2 s) · 4 blocks
copies its input while its lock input is unpowered, holds while powered · made of repeater · fits in 1×2×2
1 block wide

Copies its input on each clock pulse (D flip-flop)

On one edge of the clock input the output takes the value of the data input D, and holds it until the next such edge (a D flip-flop).

Clocked memoryClocked memory
reacts in 6 ticks (0.3 s) · 9 blocks
copies when the clock turns on · made of redstone torch, repeater · fits in 2×2×3

Copies its input on each clock pulse when enabled (D flip-flop with enable)

A D flip-flop with an enable input: on the clock's edge it takes the data input only while the enable input is powered, otherwise it keeps its value.

Clocked memory with enableClocked memory with enable
reacts in 6 ticks (0.3 s) · 12 blocks
copies when the clock turns on · made of redstone torch, repeater · fits in 2×2×5

On button + off button memory (RS latch)

A pulse on the set input (S) turns the output on and it stays on; a pulse on the reset input (R) turns it off.

On/off memoryOn/off memory
reacts in 6 ticks (0.3 s) · 4 blocks
made of comparator, dropper · fits in 2×2×2
tiles every 2 blocks

Moves bits along on each clock pulse (shift register)

A row of memory cells: each clock pulse moves every bit one step along, so the data comes out a set number of clock pulses later.

2 bitsShift register
2 bits · 27 blocks
reacts in 6 ticks (0.3 s) · made of redstone torch, redstone wire, repeater · fits in 4×3×4

Toggle switch with a reset button (T flip-flop with reset)

A toggle switch with a reset input: each press flips the output, a press on R turns it off.

Toggle switch with resetToggle switch with reset
reacts in 13 ticks (0.65 s) · 8 blocks
resets in 6 ticks (0.3 s) · fits in 3×3×2

A card that comes in several sizes lists every size, with the best design of each, on its page.