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.

Edge Detectors
These devices send a short pulse when they have a rising or falling edge as their input. A rising edge is when a signal changes from low (0) to high (1) and falling is the opposite, high to low. A "zero-crossing" detector responds to both edges. Many other circuits have implicit edge detectors, but some don't, and these can be used to feed them pulses.

For design A the Repeaters can be adjusted to give a signal lasting 1 or 2 ticks, for B this is 1 to 3 ticks. Circuit C can be adjusted to create longer or shorter pulses separately for rising and falling edges.

All three sorts of edge detector can be made more compact and 1-wide with pistons. In all three of these designs, the piston is atop a solid block.

Design D is a rising edge detector; design F, a falling edge detector; both with an output pulse of 2 ticks. Design E is a zero crossing detector, activating on both rising and falling edges. However, it only produces a single-tick pulse output. This can be moderated by adding a 2-tick repeater to the output, producing a 2-tick pulse, same as the other two.

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.

<!-- --?