Know about Basic Logic Gates with Truth Tables

Nowadays, computers have become an integral part of life as they perform many tasks and operations in quite a short span of time. One of the most important functions of the CPU in a computer is to perform logical operations by utilizing hardware like Integrated Circuits software technologies & electronic circuits,. But, how this hardware and software perform such operations is a mysterious puzzle. In order to have a better understanding of such a complex issue, we must have to acquaint ourselves with the term Boolean Logic, developed by George Boole. For a simple operation, computers utilize binary digits rather than digital digits. All the operations are carried out by the Basic Logic gates. This article discusses an overview of what are basic logic gates in digital electronics and their working.


What are Basic Logic Gates?

A logic gate is a basic building block of a digital circuit that has two inputs and one output. The relationship between the i/p and the o/p is based on a certain logic. These gates are implemented using electronic switches like transistors, diodes. But, in practice, basic logic gates are built using CMOS technology, FETS, and MOSFET(Metal Oxide Semiconductor FET)s. Logic gates are used in microprocessors, microcontrollers, embedded system applications, and in electronic and electrical project circuits. The basic logic gates are categorized into seven: AND, OR, XOR, NAND, NOR, XNOR, and NOT. These logic gates with their logic gate symbols and truth tables are explained below.

Basic Logic Gates Operation
Basic Logic Gates Operation

What are the 7 Basic Logic Gates?

The basic logic gates are classified into seven types: AND gate, OR gate, XOR gate, NAND gate, NOR gate, XNOR gate, and NOT gate. The truth table is used to show the logic gate function. All the logic gates have two inputs except the NOT gate, which has only one input.

When drawing a truth table, the binary values 0 and 1 are used. Every possible combination depends on the number of inputs. If you don’t know about the logic gates and their truth tables and need guidance on them, please go through the following infographic that gives an overview of logic gates with their symbols and truth tables.

Why we use Basic Logic Gates?

The basic logic gates are used to perform fundamental logical functions. These are the basic building blocks in the digital ICs (integrated circuits). Most of the logic gates use two binary inputs and generates a single output like 1 or 0. In some electronic circuits, few logic gates are used whereas in some other circuits, microprocessors include millions of logic gates.

The implementation of Logic gates can be done through diodes, transistors, relays, molecules, and optics otherwise different mechanical elements. Because of this reason, basic logic gates are used like electronic circuits.

Binary & Decimal

Before talking about the truth tables of logic gates, it is essential to know the background of binary & decimal numbers. We all know the decimal numbers which we utilize in everyday calculations like 0 to 9. This kind of number system includes the base-10. In the same way, binary numbers like 0 and 1 can be utilized to signify decimal numbers wherever the base of the binary numbers is 2.

The significance of using binary numbers here is to signify the switching position otherwise voltage position of a digital component. Here 1 represents the High signal or high voltage whereas “0” specifies low voltage or low signal. Therefore, Boolean algebra was started. After that, each logic gate is discussed separately this contains the logic of the gate, truth table, and its typical symbol.

Types of Logic Gates

The different types of logic gates and symbols with truth tables are discussed below.

Basic Logic Gates
Basic Logic Gates

AND Gate

The AND gate is a digital logic gate with ‘n’ i/ps one o/p, which performs logical conjunction based on the combinations of its inputs. The output of this gate is true only when all the inputs are true. When one or more inputs of the AND gate’s i/ps are false, then only the output of the AND gate is false. The symbol and truth table of an AND gate with two inputs is shown below.

AND Gate and its Truth Table
AND Gate and its Truth Table

OR Gate

The OR gate is a digital logic gate with ‘n’ i/ps and one o/p, that performs logical conjunction based on the combinations of its inputs. The output of the OR gate is true only when one or more inputs are true. If all the i/ps of the gate are false, then only the output of the OR gate is false. The symbol and truth table of an OR gate with two inputs is shown below.

OR Gate and its Truth Table
OR Gate and its Truth Table

NOT Gate

The NOT gate is a digital logic gate with one input and one output that operates an inverter operation of the input. The output of the NOT gate is the reverse of the input. When the input of the NOT gate is true then the output will be false and vice versa. The symbol and truth table of a NOT gate with one input is shown below. By using this gate, we can implement NOR and NAND gates

NOT Gate and Its Truth Table
NOT Gate and Its Truth Table

NAND Gate

The NAND gate is a digital logic gate with ‘n’ i/ps and one o/p, that performs the operation of the AND gate followed by the operation of the NOT gate.NAND gate is designed by combining the AND and NOT gates. If the input of the NAND gate high, then the output of the gate will be low.The symbol and truth table of the NAND gate with two inputs is shown below.

NAND Gate and its Truth Table
NAND Gate and its Truth Table

NOR Gate

The NOR gate is a digital logic gate with n inputs and one output, that performs the operation of the OR gate followed by the NOT gate. NOR gate is designed by combining the OR and NOT gate. When any one of the i/ps of the NOR gate is true, then the output of the NOR gate will be false. The symbol and truth table of the NOR gate with the truth table is shown below.

NOR Gate and Its Truth Table
NOR Gate and Its Truth Table

Exclusive-OR Gate

The Exclusive-OR gate is a digital logic gate with two inputs and one output. The short form of this gate is Ex-OR. It performs based on the operation of the OR gate. . If any one of the inputs of this gate is high, then the output of the EX-OR gate will be high. The symbol and truth table of the EX-OR are shown below.

EX-OR Gate and Its Truth Table
EX-OR gate and Its Truth Table

Exclusive-NOR Gate

The Exclusive-NOR gate is a digital logic gate with two inputs and one output. The short form of this gate is Ex-NOR. It performs based on the operation of the NOR gate. When both the inputs of this gate are high, then the output of the EX-NOR gate will be high. But, if any one of the inputs is high (but not both), then the output will be low. The symbol and truth table of the EX-NOR are shown below.

EX-NOR Gate and Its Truth Table
EX-NOR Gate and Its Truth Table

The applications of logic gates are mainly determined based upon their truth table, i.e., their mode of operations. The basic logic gates are used in many circuits like a push-button lock, light-activated burglar alarm, safety thermostat, an automatic watering system, etc.

Truth Table to Express Logic Gate Circuit

Gate circuit can be expressed using a common method is known as a truth table. This table includes all the input logic state combinations either high (1) or low (0) for every input terminal of the logic gate through the equivalent output logic level like high or low. The NOT logic gate circuit is shown above and its truth table is extremely easy indeed

The truth tables of logic gates are very complex but larger than the NOT gate. The truth table of each gate must include many rows like there are possibilities for exclusive combinations for inputs. For instance, for the NOT gate, there are two possibilities of inputs either 0 or 1, whereas, for the two-input logic gate, there are four possibilities like 00, 01, 10 & 11. Therefore, it includes four rows for the equivalent truth table.

For a 3-input logic gate, there are 8 possible inputs like 000, 001, 010, 011, 100, 101, 110 & 111. Therefore, a truth table including 8 rows is required. Mathematically, the required number of rows in the truth table is equivalent to 2 increased to the power of the no. of i/p terminals.

Analysis

The voltage signals in the digital circuits are represented with binary values like 0’s & 1’s calculated in reference to ground. The deficiency of voltage mainly signifies a “0” whereas the existence of full DC supply voltage signifies a “1”.

A logic gate is a special type of amplifier circuit that is mainly designed for input as well as output logic level voltages. Logic gate circuits are most frequently symbolized with a schematic diagram through their own exclusive symbols Instead of their essential resistors and transistors.

Just like with Op-Amps (operational amplifiers), the connections of power supply to logic gates are frequently misplaced in schematic diagrams for the benefit of simplicity. It includes the probable input logic level combinations through their particular output logic levels.

What is the Easiest Way to Learn Logic Gates?

The easiest way to learn the function of basic logic gates is explained below.

  • For AND Gate – If both the inputs are high then the output is also high
  • For OR Gate – If a minimum of one input is high then the output is High
  • For XOR Gate – If the minimum one input is high then only the output is high
  • NAND Gate – If the minimum one input is low then the output is high
  • NOR Gate – If both the inputs are low then the output is high.

De Morgan’s Theorem

The first theorem of DeMorgan states that the logic gate like NAND is equal to an OR gate with a bubble. The logic function of the NAND gate is

A’B = A’+B’

The second theorem of DeMorgan states that the NOR logic gate is equal to an AND gate with a bubble. The logic function of NOR gate is

(A+B)’= A’. B’

The Conversion of NAND Gate

The NAND gate can be formed using AND gate & NOT gate. The Boolean expression & truth table is shown below.

NAND Logic Gates Formation
NAND Logic Gates Formation

Y= (A⋅B)’

A

B Y′=A⋅B

Y

0

0 0 1

0

1 0 1
1 0 0

1

1 1 1

0

NOR Gate Conversion

The NOR gate can be formed using OR gate & NOT gate. The Boolean expression & truth table is shown below.

NOR Logic Gates Formation
NOR Logic Gates Formation

Y = (A+B)’

A

B Y′ = A+B Y

0

0 0 1
0 1 1

0

1 0 1

0

1 1 1

0

Ex-OR Gate Conversion

The Ex-OR gate can be formed using NOT, AND & OR gate. The Boolean expression & truth table is shown below. This logic gate can be defined as the gate that gives high output once any input of this is high. If both the inputs of this gate are high then the output will be low.

Ex-OR Logic Gates Formation
Ex-OR Logic Gates Formation

Y=A⊕B or A’B+AB’

A B

                       Y

0

0 0

0

1

1

1 0

1

1 1

0

Ex-NOR Gate Conversion

The Ex-NOR gate can be formed using EX-OR gate & NOT gate. The Boolean expression & truth table is shown below. In this logic gate, when the output is high “1” then both the inputs will be either “0” or “1”.

Ex-NOR Gate Formation
Ex-NOR Gate Formation

Y = (A’B + AB’)’

A

B

Y

0

0 1

0

1 0
1 0

0

1 1

1

Basic Logic Gates using Universal Gates

Universal gates like NAND gate and NOR gate can be implemented through any boolean expression without using any other type of logic gate. And, they can also be used for designing any basic logic gate. Additionally, these are extensively utilized in integrated circuits as they are simple as well as cost-effective to make. The basic logic gates design using universal gates are discussed below.

The basic logic gates can be designed with the help of universal gates. It uses an error, a bit of test otherwise you can utilize Boolean logic for attaining these through the logic gates equations for a NAND gate as well as a NOR gate. Here, Boolean logic is used to solve the output you require. It takes some time but it is needed to perform this to obtain a hang of Boolean logic as well as basic logic gates.

Basic Logic Gates Using NAND Gate

The designing of basic logic gates using NAND gate is discussed below.

NOT Gate Design using NAND

The designing of the NOT gate is very simple by simply connecting both the inputs as one.

AND Gate Design using NAND

The designing of AND gate using NAND gate can be done at the NAND gate’s output to reverse it & obtain AND logic.

OR Gate Design using NAND

The designing of OR gate using NAND gate can be done by connecting two NOT gates using NAND gates at the NAND’s inputs to obtain OR logic.

NOR Gate Design using NAND

The designing of NOR gate using NAND gate can be done by simply connecting another NOT gate through NAND gate to the o/p of an OR gate through NAND.

EXOR Gate Design using NAND

This one’s a bit tricky. You share the two inputs with three gates. The output of the first NAND is the second input to the other two. Finally, another NAND takes the outputs of these two NAND gates to give the final output.

Basic Logic Gates using NOR Gate

The designing of basic logic gates using NOR gate is discussed below.

NOT Gate using NOR

The designing of NOT gate with NOR gate is simple by connecting both the inputs as one.

OR Gate using NOR

The designing of OR Gate with NOR gate is simple by connecting at the o/p of the NOR gate to reverse it & obtain OR logic.

AND Gate using NOR

The designing of AND gate using NOR gate can be done by connecting two NOT with NOR gates at the NOR inputs to obtain AND logic.

NAND Gate using NOR

The designing of NAND Gate using NOR gate can be done by simply connecting another NOT gate through NOR gate to the AND gate’s output with NOR.

EX-NOR Gate using NOR

This type of connection is a bit difficult because the two inputs can be shared with three logic gates. The first NOR gate output is the next input to the remaining two gates. Finally, another NOR gate uses the two NOR gate outputs to provide the last output.

Applications

The applications of basic logic gates are so many however they mostly depend on their truth tables otherwise form of operations. Basic logic gates are frequently used in circuits like a lock with push-button, the watering system automatically, burglar alarm activated through light, safety thermostat & other types of electronic devices.

The main advantage of basic logic gates is, these can be used in a different combination circuit. In addition, there is no boundary to the number of logic gates that can be utilized in a single electronic device. But, it can be limited because of the specified physical gap within the device. In digital ICs (integrated circuits) we will discover a collection of the logic gate region unit.

By using mixtures of basic logic gates, advanced operations are often performed. In theory, there’s no limit to the number of gates that may be clad along during a single device. However, in the application, there’s a limit to the number of gates that may be packed into a given physical area. Arrays of the logic gate area unit are found in digital integrated circuits (ICs). As IC technology advances, the desired physical volume for every individual gate decreases, and digital devices of an equivalent or smaller size become capable of acting with more complicated operations at ever-increasing speeds.

Infographics of Logic Gates

Different types of digital logic gates

This is all about an overview of what is a basic logic gate, types like AND gate, OR gate, NAND gate, NOR gate, EX-OR gate, and EX-NOR gate. In this, AND, NOT and OR gates are the basic logic gates. By using these gates we can create any logic gate by combining them. Where NAND and NOR gates are called universal gates. These gates have a particular property with which they can create any logical Boolean expression if designed in a proper way. Furthermore, for any queries regarding this article, or electronics projects, please give your feedback by commenting in the comment section below.