• Written By Anum
  • Last Modified 22-06-2023

Logic Gate: Definition, Types, AND, OR, NOT, NOR Gates

img-icon

Logic Gate: We communicate with those around us using words, gestures, expressions, sounds, or hand signals. We are surrounded by electrical devices, which we use daily to help us with our tasks. But how do we communicate with devices? How does a fan, air conditioner, or washing machine know if it has to start or stop when we press the switch? How does a device understand the command? LOGIC GATE!

Like our brain works on logic, digital devices work on our commands based on logic. So for digital devices to function the way they do, logic acts between the input and output voltages. How is this logic conveyed to a device, or what controls a device? A logic gate or a digital circuit that follows a logical relationship is called a logic gate. They control the information flow based on a certain logic. Read on to learn about types of logic gates.

What are Logic Gates?

Logic Gates

A logic gate is one of the most basic switching circuits used in digital circuits to determine if an input pulse can pass through to the output. Logic gates are the building blocks of a digital circuit, and these perform various logical operations, which are necessary for any given digital circuit. These can have two or more inputs, but these give only one output. The output of a logic gate depends upon the combination of inputs applied across it. Logic gates perform logical operations based on Boolean algebra. Logic gates are employed in almost all the digital devices that we use in our daily lives. Our cellphones, computers, tablets and memory devices are designed using a combination of logic gates.

What is Boolean Algebra?

The logical algebra in which symbols represent the logic levels is called Boolean algebra. The logic levels in this algebra are associated with the digits(or symbols) \(1\) and \(0\); for the electronics circuits, logic \(1\) will represent a closed switch, a high voltage, or an “on” state of a device. Logic \(0\) will represent an open switch or low voltage or “off” state of the device.

A digital device will either be in any one of these two binary conditions at any given instant. The working of a logic gate can be understood with the help of a light bulb. When logic \(0\) is applied on the switch, it is in an OFF state, and hence the bulb will not glow. When logic \(1\) is applied on the switch, it is in an ON state, and hence the bulb will glow. Logic gates are commonly used in integrated circuits (IC).

Truth Table: A truth table is a tabulated form of the outputs for all possible combinations of inputs that can be applied to a logic gate or circuit. When putting values into a truth table, we often write them as \(1\) or \(0\), where \(1\) represents True, and \(0\) represents False logic.

Types of Logic Gates

The logic gate serves as a digital gate to the transfer of data. Just as at a toll booth, cars are allowed to pass based on the logic: if they have paid the toll or not. Similarly, logic gates work on logic to determine whether to pass the signal or not. Logic gates, thus, control the flow of information based on certain logic. Commonly, we use the following types of logic gates:

  1. AND
  2. OR
  3. NOT
  4. NOR
  5. NAND
  6. XOR
  7. XNOR
Types of Logic Gates

Basic Logic Gates

The commonly used basic logic gates are explained below:

AND Gate

An AND gate can have two or more inputs and a single output.

  1. In this gate, the output is \(1\) when all the inputs are \(1\).
  2. If there are two inputs \(A\) and \(B\), the Boolean expression for AND gate is:
    \(Y = A \cdot B\)
  3. The symbol and truth table for an AND gate can be given as:
AND Gate

As we can see from its truth table, the output is high when all the inputs are high.

OR Gate

An OR gate can have two or more inputs and one output.

  1. The logic of this gate is that the output would be \(1\) when at least one of the inputs is \(1\).
  2. If there are two inputs \(A\) and \(B\), then the OR gate’s output will be given by the following mathematical operation:
    \(Y = A + B\)
  3. The symbol and truth table for an OR gate can be given as:
OR Gate

As we can see from the truth table, the output is high when any of the inputs is high.

NOT Gate

NOT gate is a simple gate with one input and one output.

  1. The output is ‘\(0\)’ when the input is ‘\(1\)’ and vice-versa. Due to this property, a NOT gate is also known as an inverter.
  2. If there is a single input \(A\), then the output can be given by the Boolean expression:
    \(Y = \bar A\)
  3. The symbol and truth table for a NOT gate can be given as:
NOT Gate

As we can see from its truth table, a NOT gate reverses the input signal.

Universal Logic Gates

The universal logic gates are explained below:

NOR Gate

A NOR or “NOT-OR” gate is simply an OR gate followed by a NOT gate.

  1. The output of this gate is \(1\) only when all inputs are \(0\). Or the output is high when all the inputs are low.
  2. If there are two inputs \(A\) and \(B\) then, the Boolean expression for the NOR gate is
    \(Y = A + B\)
  3. The symbol and truth table for a NOR gate can be given as:
NOR Gate

As we can see by comparing the truth tables, the outputs obtained from the NOR gate are opposite to that of an OR gate. Also, This gate is called a universal gate since the OR gate, AND gate and NOT gates can be realised using the NOR gate.

NAND Gate

A NAND or ‘NOT-AND’ gate is simply the combination of a Not gate followed by an AND gate.

  1. The output of this gate is \(1\) only when all inputs are NOT \(1\). Or the output is high when all the inputs are NOT high, and at least one is low.
  2. If there are two inputs \(A\) and \(B\) then, the Boolean expression for the NAND gate is:
    \(Y = \overline {A \cdot B} \)
  3. The symbol and truth table for a NAND gate can be given as:
NAND Gate

As we can see by comparing their truth tables, their outputs are the exact opposite of an AND gate. NAND gate is called a universal gate since the AND gate, OR gate and NOT gates can be realised using this gate.

Other Logic Gates

The other logic gates are explained below:

XOR Gate

The Exclusive-OR or ‘Ex-OR’ gate is a digital logic gate with more than two inputs and gives only one output.

  1. The output of XOR Gate is ‘High’ if either input is ‘High’. The output is ‘Low’ if both the inputs are ‘High’ or if both the inputs are ‘Low’.
  2. If there are two inputs \(A\) and \(B\) then, the Boolean expression for the XOR gate is:
  3. \(Y = \bar A \cdot B + A \cdot \bar B\).
  4. The symbol and truth table of the XOR gate can be shown as:
XOR Gate

As we can see from the truth table, Its outputs are based on the OR gate logic.

XNOR Gate

The Exclusive-NOR or ‘EX-NOR’ gate is a digital logic gate with more than two inputs and gives only one output.

  1. The output of XNOR Gate is ‘High’ if both the inputs are ‘High’ or if both the inputs are ‘Low.’ The output is ‘Low’ if either of the input is ‘Low’.
  2. If there are two inputs \(A\) and \(B\) then, the Boolean expression for the XNOR gate is:
    \(Y = A \cdot B + \bar A\bar B\)
  3. The symbol and truth table of an XNOR gate can be given as:
XNOR Gate

As we can see from the truth table, Its outputs are based on the NOR gate logic.

De-Morgan’s Theorems

They are the mathematical tools that are used to verify and equate the NOR and NAND gates. These theorems come in handy while working with difficult Boolean equations. Using these equations, we can easily simplify Boolean algebraic expressions.

  1. De-Morgan’s First Theorem: This theorem sets the equivalency between the complement of AND gate and the OR gate. This means that a bubbled OR gate is equivalent to the NAND gate.
     \(\overline {A \cdot B} = \bar A + \bar B\)
  2. De-Morgan’s Second Theorem: This theorem sets the equivalency between the complement of OR gate and AND gate. This means that bubbled AND gate is equivalent to the NOR gate.
    \(\overline {A + B} = \bar A \cdot \bar B\)

Uses of Logic Gates

Logic gates are used in several devices. These form a part of chips (ICs) and these chips are a part of computers, phones, laptops etc. Several combinations of logic gates can be made, and a million such combinations are required to build the latest gadgets, satellites or even robots. Simple logic gate combinations can be found in burglar alarms, buzzers, switches, and even the street lights too. These gates can make a decision to start or stop based on logic and hence are often employed in various industries. Logic gates also play a significant role in data transfer, computation and data processing. Even the transistor-transistor logic or the CMOS circuits are heavily designed using logic gates.

Summary

A logic gate is one of the most basic switching circuits used in digital circuits to determine if an input pulse can pass through to the output. Logic gates are the building blocks of a digital circuit, and these perform various logical operations, which are necessary for any given digital circuit.

Based on their operation, we have the following types of logic gates:

  1. AND: The Boolean equation for AND gate is \(Y = A \cdot B\).
  2. OR: The Boolean expression for OR gate is: \(Y = A + B\).
  3. NOT: The Boolean expression for the NOT gate is: \(Y = \bar A\).
  4. NOR: The Boolean expression for the NOR gate is: \(Y = A + B\).
  5. NAND: The Boolean expression for the NAND gate is: \(Y = \overline {A \cdot B} \).
  6. XOR: the Boolean expression for the XOR gate is: \(Y = \bar A \cdot B + A \cdot \bar B\).
  7. XNOR: the Boolean expression for the XNOR gate is: \(Y = A \cdot B + \bar A\bar B\).

Frequently Asked Questions on Logic Gates

The answers to the most commonly asked questions about Logic Gates are provided here:

Q.1. Write the Boolean expression for AND gate.
Ans:
If \(A\) and \(B\) are the input, then the AND gate output can be given as \(Y = A \cdot B\).
Q.2: Define logic gates.
Ans:
Logic gates are the digital circuits used to perform logical operations on the input applied across them and provide suitable output.
Q.3. What are universal gates? Give examples.
Ans:
Universal gates are designed by combining two or more basic gates to perform a certain logical operation. NAND and NOR gates are known as universal gates.
Q.4. If the input 0 is applied on a NOT gate, what will be the output?
Ans:
Since NOT gate is an invertor. Thus, if \(0\) is applied at the input, the output will be \(1\).
Q.5. Write the Boolean expression for OR gate.
Ans:
If \(A\) and \(B\) are the input, then the OR gate output can be given as \(Y = A + B\).
Q.6. Which logic gate is known as an “invertor”?
Ans:
NOT gate is known as an invertor. The output obtained is the reverse of the input.

Learn Examples on Combination of AND, NOT and NAND gates

We hope you find this article on Logic Gate helpful. In case of any queries, you can reach back to us in the comments section, and we will try to solve them. 

Unleash Your True Potential With Personalised Learning on EMBIBE