# Incorporating Logic Gates in Your Next Electronic Circuit Part 2

Logic gates are the fundamental building blocks of digital electronic circuits. They follow Boolean Algebra rules, which are very easy to understand and implement for everyone—including beginner-level designers. They help circuits make decisions, so they form a significant chunk of the microprocessor and microcontroller circuitry.

Essentially, there are seven types of logic gates, out of which we have discussed three (AND, OR, NOR) in the previous blog post. In this blog post, we will cover the following gates and see how they work when incorporated in digital circuits:

NOT NAND XOR XNOR

By the end of this post, you will be able to perform various mathematical operations using logic gates and build useful circuits that use multiple logic gates’ features.

NOT Gate

NOT gate is, by far, the simplest logic gate because it performs the fundamental function of inverting, which is why a NOT gate is also called an Inverter. What does a logic inverter do?

A logic inverter, or a NOT gate, inverts the logic level present on its input terminal. For instance, if there is a ‘1’ on a NOT gate’s input, it will generate a ‘0’ as the output and vice versa. NOT gate is the only gate with a single input terminal, while all the other gates have two or more input terminals. The Boolean equation for a NOT gate can be given as follows:

F=A

Which generates the following truth table:

Internal Working

We can use resistors and transistors to represent the internal working of a NOT gate. The transistor base acts as the input terminal, while the output is measured from the collector terminal. The circuit is designed, as shown in the diagram below.

Voltage probes are used to measure the logic level at the input and output terminals. V(A) represents the point where the input signal is measured, while V(F) represents the output terminal. As you can see, a 0V signal is present at the input, which implies that the NOT gate must invert this signal. Let’s study the simulation results.

The blue line represents the input signal, which is present at a logic level 0 (0 Volts), while the red line represents the output signal, which resides at logic level 1; this is precisely how a NOT gate works. If logic level ‘1’ is present at the input, the output would be ‘0’.

Simple NOT Gate Circuit

Let’s see how we can use this gate to implement a practical circuit used in real-life applications. Consider a cabinet where you wish to install a bulb that lights up when the cabinet door is opened and lights off when the door is shut. To do so, you will need a pushbutton switch installed inside the cabinet, such that, when the door closes, the pushbutton remains pressed, and when the door is opened, the button goes back to its original state; where it is not pressed.

We can simulate this scenario by using a digital pulse signal representing the door’s opening and closing. When the door is open, the button is not pressed; hence it is characterized by a logic level 0. The NOT gate inverts this signal into a high logic level, which in turn, switches the light on. The circuit and its simulation

This post was originally published on this site