Redstone circuits/Pulse

Here we have several groups of circuits with related purposes. They all produce an output pulse in response to a rising or falling edge, but they have different emphases and tradeoffs. In rough order of pulse length, they include Edge Detectors, Pulse Generators, and Monostable Circuits. In later sections, we have circuits designed specifically to lengthen or shorten pulses, or pass pulses according to a minimum or maximum length.

Pulse Generators
A Pulse Generator creates a pulse output when the input changes. A pulse generator is required to clock flip-flops without a built-in edge trigger if the clock signal will be active for more than a moment (i.e., excluding Stone Buttons). This is an integral part of a T flip-flop, as it prevents the flip-flop changing more than once in a single operation.

Design A will create a short pulse when the input turns off. By inverting the input as shown in B, the output will pulse when the input turns on. The length of the pulse can be increased by adjusting the repeater, or even adding a second repeater on the side loop.

Designs A and B can be put together in parallel to report both the input's turning on, and off, as separate outputs. These can then be read to show when the input changes, regardless of its state.

Design C is the same as B, but in a vertical orientation.

Design D responds both when the input turns off and when it turns on ("dual-edge"). It produces a six tick pulse, and requires approximately double the space required by design C, not to mention many more repeaters.

Design E was noted as "fixed for 1.5". All repeaters are required, and it can go up to an 8-tick pulse.

Monostable Circuits
A monostable circuit sends an output pulse of determined length when triggered by an input pulse. Another way to describe it is as a device which turns itself off a specific time after it has been activated. They can be triggered by either a rising or falling edge of a pulse or both. The term monostable refers to the fact that only one state of the circuit is stable, while the unstable state reverts to the stable state after a set period (a bistable circuit is a latch). As a pulse will often lose duration as it passes through complex circuitry, monostable circuits are useful for re-lengthening the duration; the output always lasts the same amount of time, regardless of input duration.

Design A consists of an RS NOR latch with a delay hooked up to its reset. The trigger input activates the latch's SET input, and after a delay set by the repeaters, the RESET activates, turning the output off again. The delay (how long the output is high) can be made as long as desired, by adding more repeaters, or even a long-period timer such as a water clock.

Design B is a more compact version that fits into a (3x2x3) space. However, as shown, it produces a very short pulse (1 or 2 ticks). The duration is 2 less than the repeater delay, and said delay must be set to 3 or 4 for the circuit to work. Repeaters can be added to lengthen the output pulse, at the cost of increasing the size.

Alternatively, design C, a (7x2x1) vertical device can be built to fit neatly against/into a wall. As in the other cases, the length of time that the output is high can be adjusted by adding or removing repeaters. This design lacks the RS NOR latch of other designs and will only be useful in constant-input circuits. For momentary circuits, this design will not lengthen an input signal like the other designs, just cut the signal early.

A compact yet simple 2x1xn device, can also be built if you're constricted to long hallways with little room for width. However, due to the design, this only works with pulsed inputs and not with constant-input circuits. Unlike the previous designs, however, it can deal with 1-tick pulses.

Design D1 shows the basic device, which lengthens the incoming pulse by the delay on the second repeater. Pulses can be lengthened more by adding repeaters and/or increasing their delay, as in D2. Unfortunately, this version only works properly if the incoming pulse is at least two ticks long. Design D3 shows how to allow for 1-tick input pulses, at the cost of increasing the size to 3 wide. For all three variations, the number of ticks to lengthen the pulse by is equal to the sum of the delays on the repeaters not including the first one at the input. The dots by D2 and D3 indicate the repeating units to extend further.

Pulse Limiters
A pulse limiter limits the length of a pulse. It is useful in sequential bit activation to prevent multiple bits from being activated by the same pulse. Designs A and C can create 1 tick pulses, but design B can create a minimum of a 2 tick pulse.

Design A limits "on" pulses in a circuit that's normally "off". It can produce pulses of 2 or 3 ticks long (2 less than the repeater delay). The repeater must be set to at least a 3 tick delay, or the signal will not be sent.

Design B limits "off" pulses in a circuit that's expected to be "on" (both input and output). It can create pulses of any length down to 1 tick. When the input turns off the circuit generates an off-pulse of length equal to whichever is shorter: the input pulse, or the delay of the right repeater minus the delay of the left repeater, plus 1 tick for the torch. (Make sure that this yields a positive value!). For example: in the picture, the pulse is calculated as 4-1+1 = 4 or four ticks, assuming the activation pulse is at least that long. Be aware of the North/South quirk, as this can affect the delay of the torch. When the input is turned back on, the limiter will not emit a second pulse.

Design C uses pistons instead of torches, allowing it to produce "on" pulses as short as 1 tick. When the input turns on, a signal will pass through until the piston activates and breaks the circuit. For a longer pulse, repeaters can be added to the upper branch.

Pulse Sustainers
A pulse sustainer is used to lengthen the duration of a pulse input. Here we have two specialized examples, each with its own weakness.

In design D, the pulse input uses a piston to close the redstone torch's circuit. After the signal is delayed by the Redstone repeaters, the circuit is opened once again via the other piston. Note that these are regular pistons, not sticky ones. The output signal can be taken from anywhere along the Redstone repeater circuit segment. (If taken after some or all of the repeaters, the output pulse will be delayed.)

Variation: To be more compact horizontally (at the price of digging into the level below), the power torch can be placed directly underneath the mobile block's ON position. Alternatively, wire can be run underneath the mobile block's OFF position, and the repeater loop continued from there at ground level (so the piston unblocks the circuit rather than closing it).

Design E is a potentially more compact approach without pistons. The pulse will be extended by the difference between the two path delays.

Both of these circuits are simple but must be used with caution -- a monostable circuit may be a safer solution. In design D, if the input pulse lasts long enough for the second piston to activate before the first has retracted, it will become stuck in the "on" state until fixed manually. Design E has the opposite problem: if the input turns off before the pulse has reached the last repeater, two separate pulses will be sent on the output instead of a single, longer one.

Length Detectors
Sometimes it is useful to be able to detect the length of an pulse generated by another circuit, and specifically whether it is longer or shorter than a given value. This has many uses, such as special combination locks (where you have to hold down the button), or detecting Morse code.

To test for a long pulse, we use an AND gate with Redstone repeaters attached (F). These will only allow the signal to pass through if it has a signal length longer than the delay of the repeaters. Design G does the same with a piston AND gate. Note that a pulse that does get through will be shortened by the delay amount, possibly down to 1 tick!

The short pulse detector H uses, not including input and output wiring, a space of 3x4x3. The repeater D is the timing control. Any signal from input that is less than the D+1 ticks in length will pass through, giving a range of 2 to 5 ticks for the filter. Any signal that makes it through will not change in length.

Edge detector
An edge detector outputs a pulse when it detects a specific change in its input.


 * A rising edge detector outputs a pulse when the input turns on.
 * A falling edge detector outputs a pulse when the input turns off.
 * A dual edge detector outputs a pulse when the input changes.

An inverted edge detector is usually on, but outputs an off-pulse (it turns off, then back on again) when it detects a specific change in its input.


 * An inverted rising edge detector outputs an off-pulse when the input turns on.
 * An inverted falling edge detector outputs an off-pulse when the input turns off.
 * An inverted dual edge detector outputs an off-pulse when the input changes.

Rising edge detector
A rising edge detector outputs a pulse when its input turns on (the rising edge of the input).


 * Circuit Breaker


 * 1&times;3&times;3 (9 block volume), 1-wide
 * circuit delay: 1 tick, output pulse: 0.5 ticks


 * The circuit breaker is the most commonly used rising edge detector due to its small size and adjustable output.


 * Variations: The output repeater may be set to any delay, which will also lengthen the output pulse to equal the delay. When oriented north-south, the output repeater may be replaced by any mechanism component, causing the mechanism component to receive a 0.5-tick activation pulse.


 * Dust-Cut Rising Edge Detector
 * features vary (see schematics)


 * A dust-cut rising edge detector works by moving a block so that it cuts the output dust line after only one tick.


 * Because of the output's fractional length, a 1-tick repeater may be needed to force a sticky piston to drop its block.




 * Subtraction Rising Edge Detector
 * features vary (see schematics)


 * A subtraction rising edge detector works by using the subtraction mode of a redstone comparator to shut off the output pulse.


 * Variations: Remove the final block and dust to increase the output pulse to 2 ticks.


 * Earliest Known Publication: 7 January 2013 (basic concept) and 3 May 2013 (1-tick output refinement)




 * Locked-Repeater Rising Edge Detector
 * features vary (see schematics)


 * Uses repeater locking to shut pulses off after 1 tick.


 * Variations: If the input doesn't have to be at the same height as the output, you can move the torch so that it's attached to the top of the block it's currently above, and run the input into that block.




 * Dropper-Hopper Rising Edge Detector


 * 1&times;4&times;2 (8 block volume), 1-wide, silent
 * circuit delay: 3 ticks, output pulse: 3.5 ticks


 * When the input turns on, the dropper pushes an item into the hopper, activating the comparator until the hopper pushes the item back.


 * The initial block is required to activate the dropper without powering it (which would deactivate the adjacent hopper, preventing it from returning the item to turn off the output pulse).


 * Because the output comes from a comparator used as an inventory counter, the output power level will only be 1 (with a stackable item) or 3 (with a non-stackable item) -- add a repeater for a higher power level output.


 * Variations: You can reduce the size of the circuit by putting the hopper on top of the dropper.


 * Moved-Block Rising Edge Detector
 * features vary (see schematics)


 * Uses the same principle as the circuit breaker -- power the output through a block, then remove the block to keep the output pulse short.


 * Earliest Known Publication: 14 March 2013 and 29 March 2013




 * NOR-Gate Rising Edge Detector
 * features vary (see schematics)


 * A NOR-gate rising edge detector compares the current power to the power from 2 ticks ago -- if the current power is on and the previous power was off, the output torch flashes on briefly.


 * All of these designs use a trick to limit the output pulse to a single tick. A redstone torch cannot be activated by a 1-tick pulse from exterior sources, but a torch activated by a 2-tick exterior pulse can short-circuit itself into a 1-tick pulse. Remove the block over an output torch to increase the output pulse to 2 ticks.



Falling edge detector
A falling edge detector outputs a pulse when its input turns off (the falling edge of the input).


 * Dust-Cut Falling Edge Detector


 * 1&times;4&times;3 (12 block volume), 1-wide
 * circuit delay: 0 ticks, output pulse: 2 ticks


 * When the input turns off, the piston immediately retracts the block, allowing the still-powered repeater to output a signal for 2 ticks. When the input turns on again, the piston cuts the connection before the signal can get through the repeater.


 * Moved-Block Falling Edge Detector


 * 1&times;3&times;3 (9 block volume), 1-wide
 * circuit delay: 1.5 ticks, output pulse: 0.5 ticks


 * For some directions and input methods, the repeater may be needed to be set to 3 ticks to operate mechanism components.


 * Earliest Known Publication: 27 May 2013


 * Locked-Hopper Falling Edge Detector


 * 1&times;4&times;2 (8 block volume), 1-wide, silent
 * circuit delay: 1 tick, output pulse: 4 ticks


 * When the input turns off, it takes 1 tick for the torch to turn back on, giving hopper A a chance to push its item to the right and activate the output.


 * This circuit requires time to reset (to push the item back into hopper A), so the fastest input clock it can handle is a 4-clock.


 * Because the output comes from a comparator used as an inventory counter, the output power level will only be 1 (with a stackable item) or 3 (with a non-stackable item) -- add a repeater for a higher power level output.


 * Earliest Known Publication: 22 May 2013


 * Locked-Repeater Falling Edge Detector
 * 2&times;3&times;2 (12 block volume), flat, silent
 * circuit delay: 2 ticks, output pulse: 1 tick


 * When the input turns on, the output repeater is locked before it can be powered by the block behind it. When the input turns off, the output repeater is unlocked and is briefly powered by the block behind it, producing a 1-tick output pulse.


 * Variations: Increase the delay on the output repeater to increase the output pulse length (up to 4 ticks), but also the circuit delay.




 * NOR-Gate Falling Edge Detector
 * features vary (see schematics below)


 * A NOR-gate falling edge detector compares the current power to the power from 2 ticks ago -- if the current power is off and the previous power was on, the output torch flashes on briefly.


 * All of these designs use a trick to limit the output pulse to a single tick. A redstone torch cannot be activated by a 1-tick pulse from exterior sources, but a torch activated by a 2-tick exterior pulse can short-circuit itself into a 1-tick pulse. Remove the block over an output torch to increase the output pulse to 2 ticks.



Dual edge detector
A dual edge detector outputs a pulse when its input changes (at either the rising edge or the falling edge of the input).


 * Moving-Block Dual Edge Detector


 * 1&times;4&times;3 (12 block volume), 1-wide
 * circuit delay: 1 tick, output pulse: 1 tick


 * The block of redstone moves when the signal turns on and when it turns off. While it is moving it cannot power the dust below it, so the output torch turns on until the block of redstone stops moving. The block over the output torch short-circuits it into a 1-tick pulse -- remove the block and take the output directly from the torch to increase the output pulse to 1.5 ticks.


 * Variations: To get an output on the same side as the input, the torch can be placed on the other side of the bottom blocks (but without the block above it, which would clock the piston). The piston and block of redstone can be moved to the side of the dust, rather than on top of the dust, producing a shorter but wider circuit.


 * Earliest Known Publication: 28 January 2013


 * Dust-Cut Dual Edge Detector
 * features vary (see schematics)


 * The simple version splits the difference between a rising edge detector and a falling edge detector to produce an output of 1 tick on each edge. The instant version adds an unrepeated rising edge detector to reduce the rising edge circuit delay to 0 ticks.




 * Locked-Repeater Dual Edge Detector
 * features vary (see schematics)


 * A locked-repeater dual edge detector uses the timing of repeater locking to detect signal edges.


 * The nor-gate design uses a trick to limit the output pulse to a single tick. A redstone torch cannot be activated by a 1-tick pulse from exterior sources, but a torch activated by a 2-tick exterior pulse can short-circuit itself into a 1-tick pulse. Remove the block over the output torch (and the dust on the block it's attached to) to increase the output pulse to 3 ticks.


 * Earliest Known Publication: 16 April 2013 (NOR-gate locked-repeater FED) and 1 May 2013 (OR-gate locked-repeater FED)



Inverted rising edge detector
An inverted rising edge detector is a circuit whose output is usually on, but which outputs an off-pulse on the input's rising edge.


 * OR-Gate Inverted Rising Edge Detector
 * 1&times;3&times;3 (9 block volume), 1-wide, silent
 * circuit delay: 1 tick, output pulse: 1 to 3 ticks (off-pulse)


 * An OR-gate inverted rising edge detector compares the current and previous input -- if the current input is on and the previous input was off, the output turns off for a brief period.


 * Earliest Known Publication: 1 June 2013


 * Moving-Block Inverted Rising Edge Detector
 * 1&times;4&times;3 (12 block volume), 1-wide, instant
 * circuit delay: 0 ticks, output pulse: 1.5 ticks (off-pulse)


 * This is a moving-block inverted dual edge detector with a repeater added to suppress the output on the falling edge.

Inverted falling edge detector
An inverted falling edge detector (IFED) is a circuit whose output is usually on, but which outputs an off-pulse on the input's falling edge.


 * OR-Gate Inverted Falling Edge Detector
 * 1&times;4&times;4 (16 block volume), 1-wide, instant, silent
 * circuit delay: 0 ticks, output pulse: 1 tick (off-pulse)


 * The input goes straight through to the output, so when the input turns off, the output turns off until the torch can it back on again.


 * Moved-Block Inverted Falling Edge Detector
 * 1&times;4&times;2 (8 block volume), 1-wide, instant
 * circuit delay: 0 ticks, output pulse: 2.5 ticks (off-pulse)


 * Earliest Known Publication: 4 June 2013


 * Locked-Repeater Inverted Falling Edge Detector
 * 2&times;3&times;2 (12 block volume), flat, silent
 * circuit delay: 2 ticks, output pulse: 1 tick (off-pulse)


 * When the input turns on, the output repeater is locked before it can turn off. When the input turns off, the output repeater is unlocked and is briefly un-powered by the block behind it, producing a 1-tick output off-pulse.

Inverted dual edge detector
An inverted dual edge detector is a circuit whose output is usually on, but which outputs an off-pulse when its input changes.


 * Moving-Block Inverted Dual Edge Detector


 * 1&times;3&times;3 (9 block volume), 1-wide, instant
 * circuit delay: 0 ticks, output pulse: 1.5 ticks (off-pulse)


 * Variations: The piston and block of redstone can be moved to the side of the dust, rather than on top of the dust, producing a flat 2-wide circuit.


 * OR-Gate Inverted Dual Edge Detector
 * 3&times;4&times;2 (24 block volume), flat, silent
 * circuit delay: 2 ticks, output pulse: 3 ticks (off-pulse)


 * Uses the timing of repeater locking to detect pulse edges.