Hey guys it’s matt starting off a different type of video today i don’t have a giant project to show you but i’m starting off a new series called logical redstone basics where i’m just going to go over different aspects of logical redstone and show you how they work so I’m going to talk about probably logic gates encoders decoders binary hexadecimal all that stuff and the reason i’m doing this is because a lot of people have given me comments or dms that they’re confused and want to learn more about how my projects work so i’m hoping that by watching this series You’ll learn a lot more about the logic that i use and hopefully you’ll be able to make some projects of yourself as well and even if you’re not super into minecraft i mean all the stuff i’m showing in this series has resemblance to real life electronics so like i mean it’s really important It’s how computers work it’s how calculators work and it’s super cool stuff to get into so i hope you enjoy and today’s video is just going to be over logicgate so we’re going to talk about four different types of logic gates we’ve got or not And and xor so to start let’s just talk about what a logic gate is logic 8 takes inputs which can be either zero or one it does logic on them and it gives an output which can also be zero or one so the representation here is just well if These lamps are off it’s a zero and if the lamp is on it’s a one so this logic gate diagram is taking in two inputs and right now they’re both zero zero because both the lamps are off and it’s giving an output of zero because this lamp is Off as well if i flick one of these levers now we’re inputting one and zero and it’s still outputting zero because this lamp is still off now the output of logic gates is not random or anything it’s completely logical they all follow a truth table and what a truth table is Lays out all the different combinations of your inputs on the left hand side and then it lays out what the corresponding outputs are on the right side so for example with this specific truth table if you input zero and zero it out outputs a zero if you input a one and a One it outputs a one this truth table in specific corresponds to what’s called an or gate and or gate is probably the most basic type of logic gate it gives you an output when you have at least one input turned on so as you can see the only Time it doesn’t give an output is when you have both of them off otherwise you’ve got at least one one coming in and so you get a one coming out and in minecraft we can resemble this with redstone really easily because all you have to do is take two wires and connect Them to each other and now as long as you have at least one of these lamps on the output lamp will be on in addition to truth tables logic gates will always have a symbol that corresponds to them so this is the universal symbol for an or gate you’ll See in schematics everywhere in electronics and all that and so you can use these two inputs the black lines coming in and it gives the output which is the black line coming out and since there’s a million different ways to connect two different lines in minecraft you can make a million different types Of or gates i just pulled out a few cases to show you this one takes two vertical inputs and gives an output using this repeater to joint them and as you can see it still follows the truth table of an or gate this one over here is basically one line And then another line right next to it if you wanted to have them directly stackable and so this repeater powers this block which also hops onto this line of power so if you’ve ever done circuitry in minecraft where you connect lines together you’ve already been doing logic Without even knowing it let’s move on to the second logic gate it’s called a not gate it’s extremely simple it takes one input and one output and this is the truth table that’s it if it’s a one give me a zero if it’s a zero give me a one And in minecraft the representation is even simpler than an or gate you just use a torch a torch is already a not gate and just like or gates there’s a million different ways to make them as long as you have a torch you have a not gate so I just pulled out a few of them to show some of their properties uh this is just like five not gates stacked together and so each one is an individual gate here then over here i’m showing that no matter where you put the torch along the line it still functions the exact same So you can put the torch right at the beginning and it’s a not gate or you can put the torch right at the end and it functions the exact same way and with this last example i just want to show you a property of not gates that i think Is really important so if you have two not gates in a row and i’ll build one real quick if you have a torch into another torch which is two not gates it actually just acts as like a redstone repeater it just continues the signal whatever’s in the Input goes into the output but over here if you have three not gates in a row then it actually acts as one giant knock gate so we have off giving on and on giving off and the cool thing is we can actually generalize this property anytime you Have an even number of not gates in a row the product is going to be a repeater the whole thing is just going to act like a repeater but if you have an odd number of knock kits in a row the product is just going to be one giant Knock gate the whole thing will act as if it’s just one torch alrighty simple gates out of the way we’ve got or and not and don’t forget those are the symbols for them so now we’re going to take those two gates and we’re going to use them to create the next gate this Next gate is called an and gate this is what it looks like this is its truth table it only gives an output when both a and b are one and so we get a one when the inputs are one one otherwise we always get a zero and if you wanna see How it works right here you only get an output when both of these are on so anyways you’re going to use the not and or together to make an and gate and this is exactly how you’re going to do it using this diagram you start with the two inputs down here both Inputs get knotted then both of those outputs get put into an ore and then that final output gets knotted one more time that might sound like a lot but i promise it’s extremely simple in fact this is it right here so you have two inputs they’re both getting Knotted with the torch going up they’re getting bored with the redstone dust in the middle and then they’re getting knotted one more time with the final torch on the side of this block and this functions as an and gate so this final output only goes off when you have both Of these inputs on if it still doesn’t make sense exactly how this works right away don’t worry about it i would honestly just stare at this until it does make sense the way i always think about it is that okay this line is always going to stay on as long As at least one of these torches are on right so it takes the teamwork of both of the inputs to turn off these vertical torches and then only when they finally use that teamwork will this final torch be allowed to turn on and give an output That that’s how i think about it moving on to more designs uh this is like five inputs together so this output only goes off when all five are on and it’s just what you’d expect they all go into their individual knot all the knots get bored and then that final or Gets knotted one more time it takes the teamwork of all five of these repeaters to turn off the torches and to finally allow this ore torch to turn on this one here is a really small vertical and gate here’s another pretty small design we just have torches going straight up into A block into a shared redstone dust into another torch on the side this last and gate is a little bit special some people like to call it a subtraction and gate but it works the exact same way as all the others basically if you didn’t know if you have A comparator in subtract mode you can cancel the input by putting a full signal strength into its side so right now if i wanted to try to put something through it i can’t because it’s being cancelled by this input on the side and so this functions as an and gate because Well you have the first input just trying to get through but again you have to use the teamwork of both inputs you have to not only try to get the first input through but you also have to allow it through right if we didn’t have a signal in the first place We don’t get an output or if we are just canceling it then we also don’t have an output it takes teamwork and again it’s okay if you don’t fully understand this i’m going to give this world as a world download in the description so you can try it out Yourself just keep playing around with these and gates makes them for yourself and you’ll get it last but not least we’ve got an xor gate an xor gate symbol is just an or gate with like a i don’t know a band on the front of it And so it’s truth table looks like this it’s almost the exact same as an ore but if you have two in at the same time it actually doesn’t allow it so in other words it only allows one at a time that’s why it’s called exclusive or So the schematic for it down here again you can just use uh knots and ors just like the and gate but we have a lot more of them this time so we’ve got the two inputs uh the inputs get split into like a middle or here and also into some ores Up here and yeah i mean you can follow it through we’ve got four ores in total and three knots in total and this does give us the truth table that we want for an xor thankfully there are better ways to make an xor than having all those Ores and all those knots we can actually use comparators again so these are two comparators on subtract mode and this functions as an xor gate if you put one in it goes one in it goes but if you put both in it gets cancelled i think a lot of people Just consider this type of xor as like the holy grail of xors like it’s so small so fast it’s not really ever a reason to use something else but of course we have a ton of different ways to do it um i don’t i can’t really summarize this very well but again you Can download the map and try it out yourself if you want to see the inner workings of these torches and how they all combine to make an xor gate so as you can see if you put two inputs in it gets cancelled but it allows in one at a Time here we have another version this version is relatively flat so you can see all the logic that’s going on i think this version actually directly resembles the schematic over there so that’s pretty cool that you can do it in this small of a space and then finally We have a vertical xor gate using some repeaters and torch tricks so one at a time fine one at a time fine both in not allowed and that’s pretty much it i mean if you got any questions you can always just join my discord ask me questions ask other people questions I think we all like to help and uh yeah thanks for watching you Video Information
This video, titled ‘Logic Gates | Logical Redstone #1’, was uploaded by mattbatwings on 2021-10-08 02:51:52. It has garnered 170675 views and 6477 likes. The duration of the video is 00:10:16 or 616 seconds.
!!! Check out the NEW AND IMPROVED logical redstone series here! https://youtube.com/playlist?list=PL5LiOvrbVo8keeEWRZVaHfprU4zQTCsV4 !!!
In this episode, I go over what a logic gate is and a few examples.
Patreon: https://www.patreon.com/mattbatwings Discord: https://discord.gg/V5KFaF63mV My socials: https://linktr.ee/mattbatwings My texture pack: https://github.com/Xyverle/MattPack World Download: (JAVA 1.16.5) https://www.planetminecraft.com/project/logic-gates-from-tutorial-video/
————————-
Want to get more involved in the logical redstone community? Learn Logical Redstone! https://youtube.com/playlist?list=PL5LiOvrbVo8keeEWRZVaHfprU4zQTCsV4 Open Redstone Engineers (ORE): https://openredstone.org/
0:00 Welcome to my new series! 0:43 What’s a logic gate? 1:48 OR gates 3:16 NOT gates 4:56 AND gates 8:00 XOR gates 9:49 Subscribe!
Music: https://youtu.be/mWebB6zby6Y