Minecraft Wiki

The Minecraft Wiki is no longer considered as official by Microsoft and therefore several changes are required to be made, including to the wiki's logo. Please read this announcement for more information.

READ MORE

Minecraft Wiki
Minecraft Wiki
(Moved Latches and Flip Flops section)
 
Line 1: Line 1:
  +
{{Mcrs_diagrams}}
  +
  +
{{about|Redstone circuitry|other Redstone related articles, or to learn the basics|Redstone}}
  +
 
[[Wikipedia:Latch (electronics)|Latches and flip-flops]] are effectively 1-bit memory cells. They allow circuits to store data and deliver it at a later time, rather than acting only on the inputs at the time they are given. Functions using these components can be built to give different outputs in subsequent executions even if the inputs don't change, and so circuits using them are referred to as "sequential logic". They allow for the design of counters, long-term clocks, and complex memory systems, which cannot be created with combinatorial logic gates alone.
 
[[Wikipedia:Latch (electronics)|Latches and flip-flops]] are effectively 1-bit memory cells. They allow circuits to store data and deliver it at a later time, rather than acting only on the inputs at the time they are given. Functions using these components can be built to give different outputs in subsequent executions even if the inputs don't change, and so circuits using them are referred to as "sequential logic". They allow for the design of counters, long-term clocks, and complex memory systems, which cannot be created with combinatorial logic gates alone.
   
Line 180: Line 184:
   
 
=T Flip-Flop=
 
=T Flip-Flop=
T flip-flops are also known as "toggles." Whenever T changes from OFF to ON, the output will toggle its state. A useful way to use T flip-flops in Minecraft could for example be a button connected to the input. When you press the button the output toggles (a door opens or closes), and does not toggle back when the button pops out. ''(Design '''D''' does not have an incorporated edge trigger and will toggle multiple times unless the input is passed through one first.)'' It is also the core of all binary counters and clocks, as it functions as a "period doubler", turning two input pulses into one output pulse.
+
T flip-flops are also known as "toggles." Whenever T changes from OFF to ON, the output will toggle its state. A useful way to use T flip-flops in Minecraft could for example be a button connected to the input. When you press the button the output toggles (a door opens or closes), and does not toggle back when the button pops out. ''(Design '''D''' does not have an incorporated edge trigger and will toggle multiple times unless the input is passed through one first.)'' It is also the core of all binary counters and clocks, as it functions as a "period doubler", turning two input pulses in
 
[[Image:T flip-flop ADEJK.png|thumb|T flip-flop designs.]]
 
Design '''A''' has a large footprint, but is easy to build. It is essentially a JK flip-flop with the inputs for J and K removed so that it relies on the edge trigger (right side of the diagram) to keep it in the stable state and only allow a single operation per input.
 
 
Designs '''D''' and '''E''' are much taller than the others, but only a single block wide; both are shown from the side. '''D''' is level-triggered, which can save space when distributing one input pulse to multiple flip-flops. Design '''E''' has an edge trigger. The output Q is accessible in two locations; if <span style="text-decoration:overline">Q</span> is needed as well, an inverter can be connected to one of them.
 
 
The edge trigger makes the unit insensitive to the duration of the input pulse, thus it's easy to daisy-chain multiple units to create a binary counters or period-doublers for slow clocks.
 
 
These designs are based on the vertical gated D latch (design '''C''') with the inverse output looped back to the input.
 
 
Design '''J''' is the smallest design of T Flip-Flop on this page and has an edge trigger. Depending on a combination of game mode (SMP or single player), orientation, and game version, the repeater delay may need to be adjusted to eliminate output flickers on state changes. In some situations, it will not work at all unless the repeater delays are adjusted. It has been reported that for proper operation in some cases, the repeaters have needed to be set to 2-1-4 or even 4-2-4.
 
 
[[File:T flipflop L.png|thumb|left|A compact, piston-based version]]
 
Design '''K''' is a simplification made on the design '''J'''. The period of the looping part is increased to 3 ticks in order to match the length of pulses which adjusted by the edge trigger. It is likely to be a solution to the stability problem in design '''J'''.
 
 
[[File:Flipflop.png|thumb|left|An in-game example of a T Flip-Flop using two pistons]]
 
[[File:Two-Piston-T-Flipflop.png|thumb|left|A falling edge-triggered compact T-Flipflop]]
 
Design '''M''' is a compact, mostly-vertical version that uses pistons. It is triggered by a falling edge, whereas the other designs are triggered by a rising edge.
 
 
[[Image:T flip-flop LZ123.png|thumb|left|T flip-flop designs using sticky pistons]]
 
With Beta 1.7.3 operation of the [[Sticky Piston]]s was changed. If a sticky piston is activated with a one-tick pulse, it will push or pull a block, but not push and pull it back. This makes it possible to build more compact T flip-flops. '''Z1''' is the simplest design, with just one repeater. '''Z2''' is the lowest one - only one block height, '''Z3''' is a vertical design. '''Z4''' has the smallest footprint (5x2x2). If it is to be triggered by a button or pressure plate, the first repeater and block ahead of it can be omitted by placing the button or plate on the next block (on level 2). Diagram '''Z5''' is a vertical design with a small footprint Diagram '''L''' is larger and more complex, but provides both Q and <span style="text-decoration:overline">Q</span>. All of these designs include the necessary edge trigger. But keep in mind that it is currently not clear whether this behavior of the sticky pistons is considered a bug or not.
 
 
''NOTE: Using design '''E''' you may require a delay in the connection between the edge trigger and flip-flop in order to maintain a high input long enough to toggle the flip-flop''
 
<!-- designs B, C and H did not work properly. G was extremely sensitive to the length of input pulses, and only worked when powered by a button. F did something, but was not a T flip-flop. all have been removed intentionally -->
 
{| class="wikitable"
 
! Design !! A !! D !! E !! J !! K !! L !! M !! Z1 !! Z2 !! Z3 !! Z4 !! Z5
 
|-
 
| Size || 9x2x7 || 6x6x1 || 11x6x1 || 7x2x3 || 7x2x3 || 6x2x3 || 4x4x2 || 4x2x3 || 5x2x3 || 6x4x1 || 5x2x2 || 7x3x1
 
|-
 
| Torches || 10 || 7 || 12 || 5 || 5 || 4 || 2 || 2 || 3 || 3 || 3 || 2
 
|-
 
| Redstone || 28 || 8 || 12 || 10 || 9 || 4 || 2 || 4 || 4 || 4 || 2 || 4
 
|-
 
| Repeaters || 0 || 0 || 1 || 3 || 2 || 4 || 1 || 1 || 2 || 2 || 2 || 2
 
|-
 
| Pistons || 0 || 0 || 0 || 0 || 0 || 0 || 2 || 0 || 0 || 0 || 0 || 0
 
|-
 
| Sticky Pistons || 0 || 0 || 0 || 0 || 0 || 1 || 0 || 1 || 1 || 1 || 1 || 1
 
|-
 
| Accessible <span style="text-decoration:overline">Q</span>? || No || No* || No* || Yes || No || Yes || No || No || No || No || No || No
 
|-
 
| Trigger || Edge || Level || Edge || Edge || Edge || Edge || Edge || Edge || Edge || Edge || Edge || Edge
 
|}
 
{{-}}
 
 
Along with the 1.3 update, Dispensers can now shoot out/ suck in water source blocks. Combined with a Block Update Detector, it makes a simple T Flip Flop gate:
 
 
[[File:TFlipFlop.png|thumb|left|T Flip Flop gate using dispensers]]
 
 
Simply insert a water bucket inside the Dispenser.
 
 
=Pulse Generators=
 
[[Image:Pulse generator.png|thumb|left|Pulse generator designs.]]
 
A pulse generator is a device that creates a pulsed 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 Button]]s).
 
 
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 with repeaters, as shown in A' and B'. This is an integral part of a T flip-flop, as it prevents the flip-flop changing more than once in a single operation. Designs A and B can be put together in parallel to represent both the increase of input A and the decrease of A as separate outputs, these can then be read to show when the input changes, regardless of its state.
 
 
A pulse generator which causes a short pulse of low power instead of high can be made by removing the final inverter in design B' and replacing it with a wire connection. This is the type used in designs A of the T and JK flip-flops (when J=1 and K=1) to briefly place these devices in the 'toggle' state, long enough for a single operation to take place.
 
 
Design C is the same as B', but in a vertical orientation. Design D can be used when a pulse generator is required to pulse both when the input turns off and when it turns on. It produces a six tick pulse, and requires approximately double the space required by design C.
 
 
 
[[File:FastPulser.png|thumb|200px|Red wool is the output, white is the blocks used by the circuit, and blue is the input]]
 
This design is the only design of pulse generator able to start a rapid pulser [http://www.minecraftwiki.net/wiki/Redstone_Circuits#Repeater_clocks]. It creates a shorter than 1 tick pulse by using pistons.
 
 
=Pulse Limiters=
 
[[File:Pulse limiters.png|thumb|right|Pulse limiters]]
 
[[File:Pulsar design.png|thumb|right|A compact pulse limiter]]
 
 
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. The construction of design A expects a default "on" input and by default gives an "on" output.
 
 
When the limiter receives an off input, it generates a pulse with a length equal to the delay of the right repeater plus the delay of the torch minus the left repeater (make sure that this yields a positive value) or the length of the initial pulse, whichever is shorter. For example: in the picture, the pulse is calculated as .4 + .1 - .1 = .3 or three ticks, assuming the activation pulse is >= 3 ticks. 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 B expects and produces default "off" signals. The repeater must be set to at least a 3 tick delay, or the signal will not be sent.
 
 
Another solution (design C) for having a short pulse is using pistons instead of torches. 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.
 
<!-- Piston_limiter.png removed; couldn't see well enough to reproduce -->
 
{{-}}
 
 
=Pulse Sustainer=
 
[[File:Pulse sustainers.png|thumb|right|Pulse sustaining circuits]]
 
 
A pulse sustainer is used to lengthen the duration of a pulse type input (such as a button or pressure plate). In design A, the pulse input opens a constant power source (Redstone torch) via a piston switch. After the signal is delayed by the Redstone repeaters, the circuit is closed 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. Another more compact approach without pistons is shown as design B.
 
 
Both of these circuits must be used with caution. In design A, 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 B 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. A monostable circuit may be a safer solution.
 
{{-}}
 
 
=Monostable Circuits=
 
[[File:Monostable.png|thumb|left|Monostable circuits]]
 
 
A monostable circuit sends an output pulse of determined length when triggered by an input pulse. 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).
 
 
A device that turns itself off a short time after it has been activated. Design A consists of an RS NOR latch and delay hooked up to its reset. The trigger input activates the latch's SET input, and after a delay set by the [[Redstone Repeater|repeaters]], the RESET activates, turning the output off again. The delay (e.g. the length that the output is high) can be set to any value by adding repeaters into the chain.
 
 
As a pulse will often have a shorter duration as it passes through complex circuitry, monostable circuits are useful for re-lengthening the duration, as the output always lasts the same amount of time, regardless of input duration.
 
 
It can also be used to delay a signal by using its reset signal as output.
 
 
Design B is a more compact version fits into a (3x2x3) space. Very short pulse and repeater has to be set to one of the last two settings in order to work. Repeaters can be added to lengthen pulse.
 
{{-}}
 
 
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 2x1x''n'' 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 that lengthens the incoming pulse by 1.
 
Pulses can be lengthened more by adding repeaters and/or increasing their delay, as in D2. Unfortunately, this particular design only works properly if the incoming pulse is at least two ticks long.
 
Design D3 shows how you can skirt around this problem, increasing the size to 3x2x''n''. It lengthens pulses by 7 and works with any length pulse. Note that the number of ticks the device lengthens the pulse by is equal to the sum of the delays on the repeaters in the design, not including the first one.
 
{{-}}
 
 
=Zero-Crossing Detector=
 
[[File:Zero crossing detector.png|thumb|left|A zero-crossing detector]]
 
A device used to detect a change in a solid input signal, this is a variant of both high and low edge detectors as it detects both changes in signal and can be lengthened to create longer or shorter pulses for each. Can be combined with an ABBA circuit for moving mechanisms that advance through several states between "On" and "Off" where the middle states may only be visible for a moment.
 
{{-}}
 
 
=Edge Detectors=
 
[[File:RSEdgeDetectors.png|thumb|left|100px|Rising (A) and falling (B) 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. You may find you need larger delays for the Redstone Repeaters that have the longer delay. You can also use no repeater for the shorter delay, and use Redstone dust instead, but you must have a block over this piece of wire instead.
 
 
 
[[File:Piston_Based_Edge_Detectors.png|thumb|right|100px|Rising (A), Zero-crossing (B), and falling (C) edge detectors.]]
 
 
 
A 1-wide edge detector can be made with pistons. Design A is a rising edge detector; design C, a falling edge detector; both with an output pulse of 2 ticks. Design B is a zero crossing detector, activating on both rising, and falling edges. It does however, only output a single tick pulse output. This can be combated by adding a 2-tick repeater to the output, producing a 2-tick pulse, same as the other two.
 
{{-}}
 

Revision as of 06:33, 27 October 2012

Mcredstonesim icon.png
This article uses MCRedstoneSim schematics. 
These should be converted to use {{schematic}} if possible.
This article is about Redstone circuitry. For other Redstone related articles, or to learn the basics, see Redstone.

Latches and flip-flops are effectively 1-bit memory cells. They allow circuits to store data and deliver it at a later time, rather than acting only on the inputs at the time they are given. Functions using these components can be built to give different outputs in subsequent executions even if the inputs don't change, and so circuits using them are referred to as "sequential logic". They allow for the design of counters, long-term clocks, and complex memory systems, which cannot be created with combinatorial logic gates alone.

The common feature at the heart of every Redstone latch or flip-flop is the RS NOR latch, built from two NOR gates whose inputs and outputs are connected in a loop (see below). The basic NOR latch's symmetry makes the choice of which state represents 'set' an arbitrary decision, at least until additional logic is attached to form more complex devices. Latches usually have two inputs, a 'set' input and a 'reset' input, used to control the value that is stored, while flip-flops tend to wrap additional logic around a latch to make it behave in different ways.

RS NOR Latch & Input-Stabilizers

RS NOR latch designs.

A device where Q will stay on forever after input is received by S. Q can be turned off again by a signal received by R.

One useful feature of the RS NOR is that it can turn an impulse into a constant redstone signal, similar to a lever in the "On" position. This can be done with separate locations for the On and Off buttons/plates/trip wires and mixed signal length circuits, unlike a lever.

This is probably the smallest memory device that is possible to make in Minecraft. Note that Q̅ means the opposite of Q, e.g. when Q is on, Q̅ is off and vice-versa. This means that in certain cases, you can get rid of a NOT gate by simply picking the Q̅ output instead of putting a NOT gate after the Q output.

A very basic example of use would be making an alarm system in which a warning light would stay turned on after a pressure plate is pressed, until a reset button is hit. Or a train track switch with Q and Q̅ being detector rail.

In the truth table, S=1, R=1 is often referred to as forbidden, because it breaks the inverse relationship between Q and Q̅. Also, some designs where the input is not isolated from the output, such as B and D, will actually result in Q and Q̅ both apparently being 1 in this case. As soon as either S or R becomes 0, the output will be correct again. However, if S and R both become 0 on exactly the same tick, the resulting state could be either Q or Q̅, depending on quirks of game mechanics. In practice, this input state should be avoided because its output is undefined. In design E, S=1 and R=1 results in both Q=0 and Q̅=0.

Along with traditional Redstone designs, an RS-NOR latch can also be achieved with a Sticky Piston. If a repeater is connected into itself, and given power, the power is maintained until the circuit is disconnected. If a Sticky Piston is positioned with a block to cut off power, it can be connected to the R input and reset it. This method is much simpler than traditional Redstone designs, but takes up somewhat more space. A more compact version of this type of RS-NOR latch can be constructed as of Minecraft 1.0, taking up either a 2x5x2 space if the piston remains on the level of circuitry, or 2x3x4 space if it is placed vertically.

Note that designs H, J, and K only have a Q output, and no Q̅. Design H is vertically oriented and is shown from the side.

S R Q
1 1 Undefined Undefined
1 0 1 0
0 1 0 1
0 0 Keep state Keep state
Design A B C D F H I J K
Size 3x1x3 3x2x2 3x3x3 2x2x4 4x1x2 4x3x1 2x1x3 5x1x3 4x1x3
Torches 2 2 2 2 2 2 2 2 0
Redstone wire 4 4 8 6 4 4 0 7 4
Repeaters 0 0 0 0 0 0 2 1 1
Sticky pistons 0 0 0 0 0 0 0 0 1
Inputs isolated? Yes No Yes No Yes No Yes Yes No
Outputs isolated? Yes Yes No No Yes Yes Yes Yes No
Input orientation opposite opposite adjacent opposite opposite opposite opposite perpendicular perpendicular

On another note, you can make an RS NOR Latch disable itself any number of ticks after the RS NOR Latch is true. Split the output redstone path into 2 parts and then place Repeaters on the second path. Lead the second path in to the input that will turn off the Latch. When you turn on the Latch, the redstone will turn off the Latch. This is good for timed parkour jumps.

Enable/Disable RS NOR latch

This can be made by having AND gates on the inputs, and connecting both AND gates to a third input, E. If E is true, the memory cell works as normal. If E is false, the memory cell will not change state.

Input-Stabilizing Cell

File:Input Stabilization Circuit.jpg

Input Stabilization Circuit

This device will stabilize an input once received even after the input source stops. It is essentially a non-resettable RS-NOR Latch where a repeater powers itself. For example a stone button or pressure plate signal could be turned into a permanent power source with one push. This device can be turned into an RS NOR latch with the addition of two sequential NOT gates (torches) along the top row. When the second (right hand) torch is powered, the state returns to 0. This can also be achieved with a piston. They are useful for traps where the trapped player has to stand on a pressure plate or button as they can't be reset.

The simplest solution to reset this circuit is to attach a block to a sticky piston in and have it extended on a NOT gate right behind the repeater. Since blocks carry a redstone signal, the circuit will function until a shutoff wire is tripped and the piston retracts. This can also be placed on an oscillator so that instead of acting like a shutoff, it acts as a reset.

File:Pulsecatch.PNG

With reset option

RS NAND Latch

File:RS NAND latch.png

RS NAND latch designs.

Since NOR and NAND are the universal logic gates, a design for an RS NAND latch is just an RS NOR with inverters applied to the inputs and outputs. The RS NAND is logically equivalent to the RS NOR as the same inputs for R and S give the same outputs. This circuit is impractical in Minecraft because a single Redstone torch acts as a NOR gate.

When S and R are both off, Q and Q are on. When S is on, but R is off, Q will be on. When R is on, but S is off, Q will be on. When S and R are both on, it does not change Q and Q. They will be the same as they were before S and R were both turned on.

S R Q Q
1 1 Keep state Keep state
1 0 0 1
0 1 1 0
0 0 Undefined Undefined
Design A B
Size 6x3x3 6x2x3
Torches 6 6
Redstone 9 7
Input orientation adjacent opposite

D Flip-Flop & Gated D Latch

File:D latch AB.png

A gated D latch and D flip-flop

A D flip-flop, or "data" flip-flop, sets the output to D only when its clock input transitions from OFF to ON (positive edge) or ON to OFF (negative edge). A flip flop is said to be an edge triggered device, while a gated latch is a level triggered device (triggered on either an OFF or ON clock/enable input). The basic level-triggering gated D latch (design A) sets the output to D as long as the clock is set to OFF, and ignores changes in D as long as the clock is ON. However, on a positive clock edge, if D is low, the output will pulse high for 1 tick, before latching low.

You can often turn a gated D latch into a D flip flop by including an edge trigger. Design B includes a positive edge trigger and it will set the output to D only when the clock goes from OFF to ON.

In these designs, the output is not isolated; this allows for asynchronous R and S inputs (which override the clock and force a certain output state). To get an isolated output, instead of using Q simply connect an inverter to Q.

File:D latch CD.png

Vertically-oriented D latches

Design C is a one block wide version of A, except for using a non-inverted clock. It sets the output to D as long as the clock is ON (turning the torch off). This design can be repeated in parallel every other block, giving it a much smaller footprint, equal to the minimum spacing of parallel data lines (when not using a "cable"). A clock signal can be distributed to all of them with a wire running perpendicularly under the data lines, allowing multiple flip-flops to share a single edge-trigger if desired. The output Q is most easily accessed in the reverse direction, toward the source of input. Q can be inverted or repeated to isolate the latch's Set line (the unisolated Q and Q wires can do double duty as R and S inputs, as in design A).

File:D latch EF.png

Compact D latches

Design E provides a more compact version of A, while still affording the same ceiling requirement. E' allows the edge trigger to act on a high input. Design F holds its state while the clock is high, and switches to D when the clock falls low. The repeater serves to synchronize the signals that switch out the loop and switch in D. It must be set to 1 to match the effect of the torch.

Design G employs new repeater mechanics which were added to the game as of snapshot 12w42a. It holds its state while the clock is high, and is by far the most compact of the D flip-flop designs.


Design A B C D E E' F G
Size 7x2x3 7x2x7 6x5x1 2x4x5 3x2x5 3x2x5 6x2x3 2x1x1
Torches 4 8 5 6 4 5 4 0
Redstone wire 11 18 5 6 10 9 7 0
Repeaters 0 0 0 0 0 0 1 2
Trigger Level Edge Level Level Level Level Level Level
Output isolated? No No No No No No Yes Yes
Input isolated? Yes Yes C Only Yes Yes Yes No Yes

BUD based D Flip-flop

Piston BUD based D Flip-flop

Someone[1] discovered a brand-new design of D flip-flop by applying the principle of Block Update Detector. This flip-flop is small so it can be used multiple times at large integrated redstone circuits. Note that when building, all block that's adjacent to the piston cannot be used as circuit components except flip-flop itself.

The lever in the screenshot shown is an example of D input. Redstone wire in the middle is trigger signal input. The trapdoor is just a part of the BUD so it can be replaced by a fence door, a redstone lamp, etc.

JK Flip-Flop & Latch

File:JK flip-flop.png

JK flip-flop designs.

A JK flip-flop is another memory element which, like the D flip-flop, will only change its output state when the clock signal C changes from 0 to 1 xor 1 to 0 (edge-triggered, design A and B), or while it holds a certain value (level-triggered latch, design C). When the flip-flop is triggered, if the input J = 1 and the input K = 0, the output Q = 1. When J = 0 and K = 1, the output Q = 0. If both J and K are 0, then the JK flip-flop maintains its previous state. If both are 1, the output will complement itself — i.e., if Q = 1 before the clock trigger, Q = 0 afterwards. The below table summarizes these states — note that Q(t) is the new state after the trigger, while Q(t-1) represents the state before the trigger.

The JK flip-flop's complement function (when J and K are 1) is only meaningful with edge-triggered JK flip-flops, as it's an instantaneous trigger condition. With level-triggered flip-flops (e.g. design C), maintaining the clock signal at 1 for too long causes a race condition on the output. Although this race condition is not fast enough to cause the torches to burn out, it makes the complement function unreliable for level-triggered flip-flops.

J K Q(t)
0 0 Q(t-1)
0 1 0
1 0 1
1 1 Q(t-1)
Design A C D E
Size 9x2x11 7x4x5 5x2x7 14x10x1
Torches 12 11 8 10
Redstone 30 23 16 24
Repeaters 0 0 6 6
Accessible Q? No Yes Yes No
Trigger Edge Level Edge Edge

Design E is a vertical JK Flip-Flop from the basis of design A. This circuit can be built together in series side-by-side by spacing the circuit one block apart and alternating the direction of the circuit (left-to-right, right-to-left, etc.). By adding an AND gate combining K and Q at the end of this circuit and outputting the result into the inputs J and K of the next gate you can get a binary counter. For optimal space saving you can pass input K through the block it hits by replacing the Redstone wire with a relay. Then you can just add additional Redstone wire on the other side to bring the input of K over to Q. There is also enough space to begin a vertical AND gate to where the result is just to the right of output Q.

T Flip-Flop

T flip-flops are also known as "toggles." Whenever T changes from OFF to ON, the output will toggle its state. A useful way to use T flip-flops in Minecraft could for example be a button connected to the input. When you press the button the output toggles (a door opens or closes), and does not toggle back when the button pops out. (Design D does not have an incorporated edge trigger and will toggle multiple times unless the input is passed through one first.) It is also the core of all binary counters and clocks, as it functions as a "period doubler", turning two input pulses in