TechKnowSurge
CompTIA Tech+ 1.3 CompTIA Tech+ 4.2
VideoComputeFree

Gates

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.

Complete this video to capture a CTF flag worth 1 point.

About this video

Logic gates are the core components of digital circuits, built from transistors that control whether electrical current flows through a circuit path. By treating an active electrical signal as a binary one and the absence of current as a zero, gates perform logical operations that form the basis of all computing hardware. Three fundamental gate types — OR, AND, and NOT — each follow a precise set of rules that determine their output based on their inputs. The OR gate produces an output of one whenever at least one of its inputs is active, and outputs zero only when all inputs are zero. The AND gate is more restrictive, requiring every input to be active simultaneously before passing a one to the output — any inactive input results in a zero. The NOT gate operates on a single input and inverts it, outputting a one when the input is zero and a zero when the input is one. Each gate's behavior can be fully described by a truth table that accounts for every possible input combination. These three gates, along with others such as the XOR gate, are not isolated components but rather building blocks that can be combined to construct circuits capable of performing more complex functions. Understanding how each gate processes binary signals is essential groundwork for topics like digital arithmetic, processor architecture, and the broader principles of how computing hardware operates at the lowest level.

What you'll learn

What's covered

Logic Gates

Aligned to

CompTIA Tech+
1.3 Illustrate the basics of computing and processing.
4.2 Given a scenario, use programming organizational techniques and interpret logic.

Key terms

Logic Gate
A basic electronic circuit that performs a Boolean operation on one or more binary inputs to produce a single binary output.
AND Gate
A logic gate that outputs 1 only when all inputs are 1; outputs 0 in all other cases.
OR Gate
A logic gate that outputs 1 when at least one input is 1; outputs 0 only when all inputs are 0.
NOT Gate
A logic gate that inverts its single input, outputting 1 when the input is 0 and 0 when the input is 1.
Transistor
A microscopic electronic switch found in microprocessors that represents a binary one (on) or zero (off) using electrical voltage.
Truth Table
A table that lists all possible input combinations for a logic gate and their corresponding output values.
Binary
The base-2 number system that uses only the digits 0 and 1; the native language of digital computers, which store and process data as electrical on/off states.

Topics

Logic Gates Digital Circuits Boolean Logic Transistors Binary Systems Computer Hardware

Transcript

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.

The OR gate

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.

The AND gate

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.

The NOT gate

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.

Summary of the gates

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.

About TechKnowSurge

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 →