Arduino/Electronics, Computer Architecture, Digital Logic

Digital Logic B – Gates, Gates, Gates!

Hello readers! And, welcome back to the Digital Logic series. In this part, we will continue to discover the fundamental Logic Gates that are used to create Digital Logic Devices, as well as introduce Truth Tables. Truth Tables will be important to understanding and easily remembering the rules/function of a logic gate.

If you haven’t already, consider reading my first article, where we introduced logic gates such as AND and NAND. They will be critical to understanding this article. As always, I hope you enjoy it!

Introduction – Truth Tables

A truth table may sound self-explanatory. It is a table that describes the behavior and function of a specific gate or circuit. It lays out every possible combination of inputs (whether they are 1 or 0, or on/off), and how this affects the output. Here is an example that may help you understand.

X and Y are the two Inputs for the AND gate. And, Z is the output for the AND gate.

As you can see, this is a Truth Table for an AND gate. The bottom-most entry shows that if both inputs are on, the output is on. This was described in our previous article. Because of the easily readable format of truth tables, we will be using them more to describe the usage of other logic gates.

Whenever you are confused about a logic gate, and it’s behavior, search for its truth table! Many sites have archived these tables, including tables for more complex circuits. And, they are extremely useful when developing projects in the real world!

Gates – The NOT Gate

Now, let’s continue to discuss other Logic Gates. The NOT Gate is an extremely important gate, especially for Computer Architecture. The NOT gate has only one input and one output. Here is a truth table to describe it’s sole behavior:

You can probably see the behavior from this table!

As you can see, the output is true if the input is false. Should it be otherwise, the output is false. The name of the gate perfectly explains this behavior. If the gate is not powered or toggled, the output is true. Here is a GIF Example of the gate:

In this example, A is the input and Y is the output. A blue wire means it is powered, or 1.

NOT Gate’s are actually the component used to create NAND Gates. As the name describes, a NAND gate is simply an AND gate that is fed into a NOT gate. This is an example of the modularity of logic gates. Each of these are separate devices, but combined together they can create more abstract behavior.

This is essentially the same behavior as a NAND gate. The left gate is an AND, the right gate is a NOT gate.

Gates – OR and XOR

Let me introduce you to two similar gates, OR and XOR. These two gates are extremely useful. Here is the truth table for OR:

As you can see, the OR Gate‘s behavior comes from its name. If either input, a or b is on, the output is on. As well as, if both inputs are on, the output is on. This is useful to send a signal to a circuit should two separate conditions be true. For example, a ship component may cut power to a device if either water reaches a certain level, or if it is requested by another component.

Now, similar to the OR Gate, the XOR gate follows the same behavior. However, there is a small difference in the truth table. See if you can find out the difference:

Did you catch it? In an XOR Gate, should both inputs be on, the output is off. The name is read as an eXclusive OR. Because of this, it must exclusively be A or B, and not both. Very interesting! Here is an example of an OR and XOR gate operating below. You can also see the Symbol that represents both of them:


In summary, we have demonstrated the usage of truth tables, to explain the logic of individual gates. We also have described the behavior of NOT, OR, and XOR gates. In addition, These three, like AND and NAND, are critical when it comes to designing and implementing digital/electronic circuits in the real world. Like always, try them out yourself with LogicLY or CircuitVerse

If you enjoyed this content, consider commenting below! I will answer any questions as needed. And, consider reading more of our content at batch-man. Thank you for your time!

One thought on “Digital Logic B – Gates, Gates, Gates!

  1. Very nice work! You are really know low-level programming languages.

    It’s really a good concept and I thought I will work on it.

    Hope a nice day today!


Leave a Reply