Logic gates are the fundamental building blocks of digital circuits, using transistors to process binary inputs and produce predictable outputs. This content covers the OR, AND, and NOT gates, including their behavior, truth tables, and circuit symbols.
Logic Gates
Gates are made up of different amounts of transistors. As we mentioned before, if we press a one on here that means that we're applying power to it. Let's say we're pressing the button, or we have an input of one here. What's going to happen is it's going to make contact here and power will flow through here. However, if we release that, so essentially we're putting a zero in there, now power can't make it through this conductor because there's a gap now, and so it's not going to get onto the other side. The mechanics of a transistor work differently than that, but we're just using this button as a representative of that transistor.
Let's first of all make an OR gate. As you can see here, I have two transistors. What an OR gate says is that if one of the transistors, or the other transistor, or both transistors are turned on, the output will be one. Otherwise, if there's no input on either of those, then the output is going to be zero.
I just gave away the answer to what we're going to be creating here, but let's go through this process. There is power put to the circuit right here, so we've got a positive charge right here. Let's say we have a zero and a zero inputted into here. What happens is no electricity can pass from this side or this side, and so we don't have any output right here, and therefore we have an output of zero.
What you can do is try to fill in the rest of this, play around with it and start putting ones on each side, and see if you can come up with what this table is going to look like with the outputs. Go through this exercise, see what you come up with, and we'll walk through it together.
Let's see what this looks like. For the next input, one and zero: what happens is we push this button down and we get electricity through here and out this side. We don't even need to take a look at the other side, but it would be a zero on that side. We're getting power through this output, so now we've got a one in this column, this output right here.
Now let's take a look if we have a 0 and a 1 as the two inputs. Let me remove some of these marks so it's not so cluttered. In this case, now we have zero, so nothing is flowing through this side and we're not getting any power from that side, but on this side power can now go through because we're depressing this button right here. Because of that we get a one, so we can put a one right there.
Now let's go ahead and press a one right here. Now we get power from this side. So whether it's this side that's depressed, or this side that's depressed, or both, it's going to operate as one. So there's the answer right there.
Another one that we have is the AND gate. Let's go through the same process here. Rather than me telling you what the answer is, go ahead and try to figure out this table. Input one and input two are right here, and what is going to be the output given these sets of inputs into it? See if you can figure it out, and then we'll walk through it together.
Let's see what happens here. If we have a zero and a zero and electricity gets applied here, it can't go even through this first transistor here, so it never makes it to the end. That's going to be zero.
Next up we have a 1 and a 0. We press this right here, electricity gets through there, but it can't get to this point right here. By the way, electricity works a little differently than that, so forgive my terminology there. Essentially it gets stopped right here at this switch, this transistor right here. So once again there's a zero output.
Now let's switch these around: this is zero and one. Electricity can't make it past this first transistor here, so it can't ever get to the end. That's going to be a zero.
Now let's have both ones. At this point in time electricity can pass through here and through here, and now we finally have a one. So this needs to be a one and this needs to be a one, hence the name AND gate. They both have to be present in order for us to get a one right there.
Then we have a NOT gate. A NOT gate just says that if we press this button, so there's an input of one, then it's going to break the connection. Notice I flipped this around so it looks a little different, and it looks like that when we press the button, or give an input of one, then it breaks the contact. Normally there would be contact if there's a zero up here, but then it breaks the contact if we put a one there. So as you can guess, that means if we don't press it then we have an output of one, and if we do press it then it breaks the contact, it doesn't flow through, and we have an output of zero. The NOT gate just inverses whatever the input is going to be.
Here is the summary of what each one of those gates are. This is the AND gate right here, this is the OR gate, and this is the NOT gate. From a symbol's perspective, this looks like this one right here, and then the OR looks a little different. The actual symbol for it looks a little more pointed. I couldn't quite find something that worked quite right for that, but essentially it's close there. Then the NOT gate, that's what the symbol looks like for the NOT gate. And here are the output tables for each one of those.
There are other gates out there, like the XOR gate, so just realize that this isn't a complete view of all of the gates that you could put together. But do realize that what we've created now is a building block to create some sort of circuit that performs some sort of function. The function that we're going to create next is a half adder, and what it's going to do is add a column together.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →