Minecraft

Minecraft: Redstone Logic Gates Explained

Minecraft: Redstone Logic Gates Explained
Written by ga_dahmani
Minecraft: Redstone Logic Gates Explained

The technical side of Minecraft is one of the most interesting aspects of the game, but it can be quite overwhelming for players just starting out. There’s a lot to learn about Redstone, but simple logic gates are a great place to start. These are essential to know for Redstone projects of any size, from simple automated farms to massive calculators, and are great for learning the basics of how different Redstone elements work with each other.

For those who don’t know, logic gates are devices that consist of one or more inputs and a single binary output. Different situations require different types of logic gates. For example, a player may want to have a door that only opens if a specific set of levers is activated, or they may want a set of buttons that only work when pressed in the correct order. This is where these devices come in.

DUALSHOCKERS VIDEO OF THE DAY

How to build logic gates in Minecraft

It should be noted that each and every type of logic gate can be created in multiple different ways. This guide will cover the most common and simple layouts, but players can use the reasoning behind why they work to build them in different ways. As long as the same logic applies, they should all work the same way.

Entry/exit doors and NO

Pictured above are the two most common logic gates in the game. The left is a standard input/output gate, which means that when the input is activated, it sends a signal to an output and something will happen (in this case, a light will come on). The right gate shown is a NOT gate, also known as an inverter, and this is the main purpose redstone torches serve. Redstone torches are active and emit a signal by default, but turning them on will turn them off. This means that in this example, the light is on by default, but pressing the switch turns it off.

These two gates are fairly self explanatory, but they are the building blocks of all other logic gates in the game. What is important to note is that the NOT gate can be added to the output of none another type of gate to invert the signal. Whenever players want the default state to be “on” or “open”, use a torch.

AND and OR gates

An OR gate, shown to the right, is a device that can be powered by any of several inputs. Setting up one of these is as simple as connecting multiple cables to the same outlet, nothing more. This can be useful for players looking to be able to open Redstone gates from either side or those who want to have toggle switches for their XP farms that can be activated from multiple different areas.

An AND gate, illustrated on the left, is a circuit that requires input from multiple sources to drive an output. In this example, the light would turn on only if both the blue input Y the yellow input was activated, hence the name. This works, because if either of the two torches above the levers are still active, the attached Redstone dust will be active. If that powder is active, then the torch on the side of the block will stay off. So, for it to turn on, both the torches must be inactive. This simple example uses only two inputs, but as long as all the torches are connected by one continuous cable, they can be extended indefinitely.

XOR gate

This is where things get a bit more complex. This device shown above is an XOR gate. It is similar to an OR gate in that it is an output that can be activated from multiple different outputs, however it requires one and only an input is active. If both blue and yellow were on, the light would stay off, but if only one was on, the light would be on.

This makes use of a triple AND gate, in addition to an OR gate. For the redstone lamp to be active, it must be powered by the top left torch either the upper right torch. If the center torch is active, then neither of those two torches can be active and that center torch is only active if both levers are pressed. This is because the two levers create an AND gate with that torch as the output.

RS NOR latch

The purpose of an RS NOR latch is to make it so that an output can only be turned on by one particular input and turned off by another. In the image above, the blue input would turn the light on, and even though it’s just a button, not a toggle, it will stay on indefinitely. To turn it off, players must press the yellow button. Pressing the blue button a second time will do nothing.

The reason this works is because of something called tick delay. Essentially, it takes a tick for a redstone torch to turn on or off, while the wire turns on instantly. When a player presses the blue button, it activates the wire next to them instantly, and after two ticks, the Distant Torch will power up, powering that same redstone wire but from the other side. When the button is released, the blue block will still receive power, but instead from the powered wiring. This effectively crashes the system.

Pressing the blue button again will do nothing, since the blue block is already being powered. However, pressing the yellow button will cause the same thing to happen as when the blue button was first pressed, unlocking the system and re-enabling the blue button.

RS NAND latch

RS NAND latches are useful when gamers want a system with two components, where both components cannot be disabled at the same time. An example of this might be a double door set, where they only want one set of doors to be open at a time, preventing things from escaping. In the image above, the blue toggle will turn the top light on and off normally, as will the yellow toggle with the bottom light. However, if one lever is changed, the other is locked.

The logic here is quite simple. When a lever is pulled, the second Redstone torch is lit, keeping the other powered circuit, regardless of the state of its lever. This means that if one lever is pulled, it must be raised again before the other can be used, and vice versa.

flip flops

The last of the basic logic gates is the T Flip-Flop. In simpler terms, the function of the T Flip-Flop is to create a single input switcher that does not use a lever. When a button is pressed on the image, the light will remain active until the button is pressed again. This is incredibly useful for things powered by pressure plates, for example. When a player enters a room and steps on it, they can turn on the lights, then when a player activates them on their way out, they turn them off. This negates the need for a lever.

There are countless designs for T Flip-Flops that can be found online, but the two shown above are the most common. The left one works because when the button is pressed, both torches turn off, however the currently active piston will remain extended, because its extended arm is directly below the active Redstone wiring. When the button is released, there will be a tick where the piston is not powered due to the torch tick delay. It will retract and a second later both pistons will receive power. Because it takes more than one tick for the piston to retract, the other piston will extend instead, changing the state.

The second layout is slightly less complex, but may not be suitable in certain situations, depending on space or resources. Use a downward facing dispenser with a bucket of water inside. A full bucket of water will generate a force of two, while an empty bucket will generate a force of one. Each time the button is pressed, it will empty or fill the bucket, as long as there is empty space below it. This means that if the output is behind two blocks of wire, it will behave like a T Flip Flop.

About the author

ga_dahmani

Leave a Comment