The Wayback Machine - https://web.archive.org/web/20240922011551/https://www.geeksforgeeks.org/introduction-of-logic-gates/
Open In App

Introduction of Logic Gates

Last Updated : 12 Aug, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In Boolean Algebra, there are three basic operations, [Tex]+,\:.\:,\:^\prime       [/Tex]which are analogous to disjunction, conjunction, and negation in propositional logic. Each of these operations has a corresponding logic gate. Apart from these, there are a few other logic gates as well. It was invented by George Boole.

What is a Logic Gate?

 A gate can be defined as a digital circuit that can allow a signal (electric current) to pass or stop. A type of gate that allows a signal to pass through when certain logical conditions are met. Different logic gates have different logical conditions.

Truth Table: A truth table is a table that shows all possible combinations of inputs and outputs for a logic gate.

Types of Gate

Given Below are the different types of Logic Gates :

  • AND Gate(.)
  • OR Gate(+)
  • NOT Gate(‘)
  • XOR Gate
  • NAND Gate
  • NOR Gate
  • XNOR Gate
  • Buffer Gate
  • Universal Logic Gates

AND Gate(.)

The AND gate gives an output of 1 when if both the two inputs are 1, it gives 0 otherwise. For n-input gate if all the inputs are 1 then 1 otherwise 0.The AND gate operation is similar to the standard multiplication of 1s and 0s.The (.) dot represents the AND operation.

AND Gate in Digital Electronics-22

AND Gate


The Expression for AND gate can be given as

X=(A.B)

Where,

X is the output of gate

A and B are the inputs of the gate

OR Gate(+)

The OR gate gives an output of 1 if either of the two inputs are 1, it gives 0 otherwise. For n-input gate if all the inputs are 0 then 0 otherwise 1.The OR Operation is represented by the +.

2-input-Or-gate

OR Gate


The Expression for OR Gate is given as

X=A+B

Where,

X is the output of gate

A and B are the inputs of the gate

NOT Gate(‘)

The NOT gate gives an output of 1 if the input is 0 and vice-versa. It is also known as Inverters. In Boolean algebra NOT operation is represented by bar over the variable such as [Tex]\overline{A}[/Tex].

NOT-Gate

NOT Gate


The Expression for NOT Gate can be given as

[Tex]Y=\overline{A}[/Tex]

Where,

X is the output of gate

A is the inputs of the gate

XOR Gate

The XOR gate gives an output of 1 if either both inputs are different, it gives 0 if they are same. For n-input gate if the number of input 1 are odd then it gives 1 otherwise 0.For a two-input XOR gate it means that the output is true only if exactly one of the inputs is true.

XOR Gate

XOR Gate


The Expression for XOR Gate can be given as

X = A’B + AB’

Where,

X is the output

A and B are the inputs


Thus we need 5 NOR GATE to implement XOR GATE.

NAND Gate

The NAND gate (negated AND) gives an output of 0 if both inputs are 1, it gives 1 otherwise. For n-input gate if all inputs are 1 then it gives 0 otherwise 1.The Term “NAND” can be said as “Not AND”.


2-Input-NAND-Gate

NAND Gate


The Expression for NAND Gate can be given as

[Tex]Y=\overline{A.B}[/Tex]

Where,

Y is the Output of gate

A and B is the input of gate


NOR Gate

The NOR gate (negated OR) gives an output of 1 only if both inputs are 0, it gives 0 otherwise. For n-input gate if all inputs are 0 then it gives 1 otherwise 0.The “NOR” can be said as “NOT OR”.

What-is-NOR-Gate

NOR Gate


The Expression for NOR Gate can be given as

[Tex]Y=\overline{A+B}[/Tex]

Where,

Y is the Output of gate

A and B is the input of gate

XNOR Gate

The XNOR gate (negated XOR) gives an output of 1 if both inputs are same and 0 if they are different. For n-input gate if the number of input 1 are even then it gives 1 otherwise 0 or if the number of input 0 is even then the output is 1, otherwise 0′. The “XNOR” can be said as “Exclusive NOR”.

What is XNOR Gate?

XNOR Gate


The Expression for XNOR Gate can be given as

Y=A⊙B

Where,

Y is the Output of gate

A and B is the input of gate

Buffer Gate

The Buffer is the opposite of the NOT gate, as its output is 1 if its input is 1 and vice-versa. 

Buffer

Buffer


The Expression for Buffer can be given as

Y=A

Where,

Y is the Output of gate

A is the input of gate

Every Logic gate has a graphical representation or symbol associated with it. Below is an image which shows the graphical symbols and truth tables associated with each logic gate.  

Universal Logic Gates

Out of the eight logic gates discussed above, NAND and NOR are also known as universal gates since they can be used to implement any digital circuit without using any other gate. This means that every gate can be created by NAND or NOR gates only. Implementation of three basic gates using NAND and NOR gates is shown below –

Implemented Using NAND

The Implementation of NAND Gates are

Implemented using NOR

The Implementation of NOR Gate are

Applications of Logic Gates

Given Below are the Applications of logic gates

  • Digital Circuits: The Logic gates are the building blocks in the digital circuits. They are used in designing various digital circuits multiplexer, Adder and etc.
  • Arithmetic and Logic Units (ALUs):The ALUs are the important components in the CPUs which performs arithmetic and logical operations on binary data using combinations of logic gates.
  • Memory Units: The Logic gate can be used to design memory units such as flip-flops and registers which can be used to store binary data.
  • Digital Signal Processing (DSP):Logics gates are used in the DSP for operations such as filtering, modulation and etc. of digital signals.

Advantages of Logic Gates

  • ​Basic Functions : Logic gates carry out basic logical functions like AND, OR, NOT, XOR, NAND, and NOR. All digital operations and dat respective processing rely on these functions.
  • ​Versatility : Logic gates may be connected in different combinations to form complex circuits that could perform diverse tasks ranging from simple arithmetic to complicated decision making processes.
  • ​Speed : Their extremely high speed rates make them an essential feature in today’s information processing systems that aim for quickness in data analysis.
  • Reliability : Being elements whose behaviors are accurately defined means there is no uncertainty about how they behave when used as part of a system.
  • Scalability : Digital systems complexity increases by interconnecting and replicating these components without significant variations in size or complexity.
  • Low Cost : Logic Gate costs are relatively low from production viewpoint thus making it popular among those who want to construct digital circuits inexpensively.
  • Low Power Consumption : Power consumption is minimal with logic gates; hence less energy is needed for operating hence suitable for use with gadgets without batteries or devices running low power consumption applications at all times.
  • Incorporating the merits of logic gates into their designs, engineers can come up with high-tech digital systems that make several technologies we use on a daily basis possible.

Di​sadvantages of Logic Gates :

Despite their numerous advantages, logic gates have their disadvantages. The following paragraphs discuss some shortcomings of logic gates.

  • ​Complexity : The advancement and complexity of digital systems results in increasing number of logic gates and their interconnections, which causes designs that are very difficult to handle and troubleshoot.
  • Pr​opogation Delay : Small delay in the propagating signal is introduced with every logic gate. When several such gates are chained together, these delays can add up and have adverse effects on the overall speed and performance of the circuit.
  • ​Noise Sensitivity : Even noise, interference, and interfering fields can make logic gates sensitive to errors in the output signal. Proper shielding and conditioning of signals at times are needed to reduce these effects.
  • Power Dissipation : While logic gates are essentially low power, their dissipation can grow with the complexity of th​e circuit. Heavy energy loss can generate thermal energy which necessitates supplementary cooling systems.
  • ​Limited Functionality : Although it is possible to realize all sorts of logical operations with logic gates, there are usually​ restrictions on the types of functions that can be provided directly by a gate. The implementation of more complex functions may need several gates and extra circuitry.
  • ​Design Constraints : While designing complex digital systems using logic gates, many issues have to be taken into consideration during the design process, like the integrity of the signals, timing constraints, and the power consumed. This may make this phase of design protracted and tricky.
  • Cost of Implementation : Large-scale digital systems that include a large number of logic gates are very expensive in terms of the price of the components and the design and test procedures involved.

Conclusion

In this Article we have gone through Logic Gates, we have seen different types of logic gates with their logical diagrams and truth table, we have also gone through the implementation of Nor and Nand gate and we have seen the applications of the logical gates.

Introduction of Logic Gates – FAQs

What role do logic gates play in communication systems?

The Logic Gates are used in the Communication system for signal processing, encoding, decoding, and error detection/correction.

How are logic gates represented graphically, and what are their symbols?

The Logic Gate are represented by the graphically using symbols such as circles and rectangles with specific shapes denoting different types of gates

Are there any universal logic gates, and how are they useful?

Yes there are universal gates which are NAND and NOR gates, which can be used to form other logic gates.


GATE CS Corner Questions

Practicing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them. 1. GATE CS 2013, Question 21 2. GATE CS 2012, Question 10 3. GATE CS 2007, Question 33 4. GATE CS 2005, Question 15



Similar Reads

VHDL code for AND and OR Logic Gates
Prerequisite - Introduction of Logic Gates Design and implement the AND and OR logic gates using VHDL (VHSIC Hardware Description Language) programming language. Different Types of VHDL Modelling Styles The architecture of VHDL code is written in three different coding styles : Dataflow Modelling Behavioral ModellingStructural Modelling 1. Logic De
2 min read
Control Logic Gates in Computer Organization
Control Logic Gates is the hardware component of a basic computer. It comprises some inputs and outputs. The diagram given below is related to the hardwired control organization. The diagram below consists of the instruction register which has three parts: the I bit (15), the operation code (12, 13, 14), and bits 0 through 11. The symbols as D0 to
2 min read
Binary Adder with Logic Gates
Binary Adder and logic gates are important elements in digital logic. Binary adders are circuit which adds two binary numbers and results in the sum of the two binary numbers. Logic gates are the circuit in which a signal can pass through if a logic is applied through it. In this article we will discuss about the binary adder with logic gates, bina
8 min read
Universal Logic Gates
A logic gate is an active electronic component that uses one or more inputs to produce an output based on the bolean algebra each gate is designed to perform. Though there are various types of gates including AND, OR, NOT, NAND, NOR etc.. NAND and NOR gates are a little special. NAND gate and NOR gate can be termed as universal logic gates since an
7 min read
Basic Conversion of Logic Gates
In the Digital System, logic gates are the basic building blocks.  In these logic gates, we can find the gates having more than one input, but will have only one output. The connection between the input and the output of a gate is based on some logic. Based on this logic, different gates are developed like OR gate, AND gate, NOT gate, and more.   T
6 min read
Program to Implement Logic Gates
In a computer, most of the electronic circuits are made up logic gates. Logic gates are used to create a circuit that performs calculations, data storage or shows off object-oriented programming especially the power of inheritance. Logic gates can also be constructed using vacuum tubes, electromagnetic elements like optics, molecule etc. What is Lo
8 min read
Realization of Logic Gate Using Universal gates
In Boolean Algebra, the NAND and NOR gates are called universal gates because any digital circuit can be implemented by using any one of these two i.e. any logic gate can be created using NAND or NOR gates only. Every logic gate has a representation symbol. The below image shows a graphical representation of all logic gates.  Implementation of AND
7 min read
Two Level Implementation of Logic Gates
The term "two-level logic" refers to a logic design that uses no more than two logic gates between input and output. This does not mean that the entire design will only have two logic gates, but it does mean that the single path from input to output will only have two logic gates. In two-level logic, irrespective of the total number of logic gates,
10 min read
Difference between Programmable Logic Array and Programming Array Logic
Programmable Logic Array (PLA) and Programming Array Logic (PAL) are the categories of programming logic devices. In PLA or Programmable Logic Array, there are massive functions can be implemented. Whereas in PAL or Programmable Array Logic, there is finite functions can be implemented. The distinction between PLA and PAL is that, PAL have programm
5 min read
Implementation of Full Adder using NOR Gates
In Digital Logic Circuit, Full Adder is a Digital Logic Circuit that can add three inputs and give two outputs. The three inputs A, B, and input carry as Cin. Cout is represented as output carry and Sum is represented as output. We can say Cout is called the majority 1’s detector, when more than one input is high (logic 1) then its output will be h
8 min read
Implementation of Full Adder using NAND Gates
In Digital Logic Circuit, Full Adder is a Digital Logic Circuit that can add three inputs and give two outputs. The three inputs such as A, B, and input carry as Cin. The output carry is represented as Cout and the normal output is represented as S, Sum. The Cout is also known as the majority 1’s detector, whose output goes high when more than one
9 min read
Half Adder and Half Subtractor using NAND NOR gates
Introduction : A Half Adder is a digital circuit that adds two single-bit binary numbers and outputs the sum and carry. It can be implemented using either NAND gates or with NOR gates. When using NAND gates : The sum output is given by A AND B. The carry output is given by the complement of A AND B. ​ ​W​hen NOR gate is used : The sum output is NOR
5 min read
Introduction to logic family
In this article, We will be going through the Logic Family. we will start our article with an introduction to the logic families, then we will go through their classification and go through their characteristics. Also, we will go through the comparison between CMOS, TTL, and ECL logic families. At last, we will conclude our article with the advanta
14 min read
Half Adder in Digital Logic
Introduction: A half adder is a digital logic circuit that performs binary addition of two single-bit binary numbers. It has two inputs, A and B, and two outputs, SUM and CARRY. The SUM output is the least significant bit (LSB) of the result, while the CARRY output is the most significant bit (MSB) of the result, indicating whether there was a carr
4 min read
Full Subtractor in Digital Logic
A full subtractor is a combinational circuit that performs subtraction of two bits, one is minuend and other is subtrahend, taking into account borrow of the previous adjacent lower minuend bit. This circuit has three inputs and two outputs. The three inputs A, B and Bin, denote the minuend, subtrahend, and previous borrow, respectively. The two ou
3 min read
Encoder in Digital Logic
An encoder is a digital circuit that converts a set of binary inputs into a unique binary code. The binary code represents the position of the input and is used to identify the specific input that is active. Encoders are commonly used in digital systems to convert a parallel set of inputs into a serial code. The basic principle of an encoder is to
6 min read
Shift Registers in Digital Logic
Pre-Requisite: Flip-Flops Flip flops can be used to store a single bit of binary data (1 or 0). However, in order to store multiple bits of data, we need multiple flip-flops. N flip flops are to be connected in order to store n bits of data. A Register is a device that is used to store such information. It is a group of flip-flops connected in seri
8 min read
Consensus Theorem in Digital Logic
Prerequisite - Properties of Boolean algebra, Minimization of Boolean Functions Redundancy theorem is used as a Boolean algebra trick in Digital Electronics. It is also known as Consensus Theorem: AB + A'C + BC = AB + A'C The consensus or resolvent of the terms AB and A'C is BC. It is the conjunction of all the unique literals of the terms, excludi
3 min read
Variable Entrant Map (VEM) in Digital Logic
Prerequisite - Karnaugh Map (K-map) K-map is the best manual technique to solve Boolean equations, but it becomes difficult to manage when number of variables exceed 5 or 6. So, a technique called Variable Entrant Map (VEM) is used to increase the effective size of k-map. It allows a smaller map to handle large number of variables. This is done by
3 min read
Static Hazards in Digital Logic
A hazard, if exists, in a digital circuit causes a temporary fluctuation in the output of the circuit. In other words, a hazard in a digital circuit is a temporary disturbance in the ideal operation of the circuit which if given some time, gets resolved itself. These disturbances or fluctuations occur when different paths from the input to output h
4 min read
Ring Counter in Digital Logic
A ring counter is a typical application of the Shift register. The ring counter is almost the same as the shift counter. The only change is that the output of the last flip-flop is connected to the input of the first flip-flop in the case of the ring counter but in the case of the shift register it is taken as output. Except for this, all the other
3 min read
5 variable K-Map in Digital Logic
Prerequisite - Implicant in K-Map Karnaugh Map or K-Map is an alternative way to write a truth table and is used for the simplification of Boolean Expressions. So far we are familiar with 3 variable K-Map & 4 variable K-Map. Now, let us discuss the 5-variable K-Map in detail. Any Boolean Expression or Function comprising of 5 variables can be s
5 min read
Self Dual functions in Digital Logic
A function is said to be Self dual if and only if its dual is equivalent to the given function, i.e., if a given function is f(X, Y, Z) = (XY + YZ + ZX) then its dual is, fd(X, Y, Z) = (X + Y).(Y + Z).(Z + X) (fd = dual of the given function) = (XY + YZ + ZX), it is equivalent to the given function. So function is self dual. In a dual function: AND
2 min read
Adders and Subtractors in Digital Logic
Subtraction of two binary numbers can be accomplished by adding 2's complement of the subtrahend to the minuend and disregarding the final carry if any. If the MSB bit in the result of addition is a '0'. then the result of addition is the correct answer. If the MSB bit is a '1'. , this implies that the answer has a negative sign. The true magnitude
4 min read
Array Multiplier in Digital Logic
An array multiplier is a digital combinational circuit used for multiplying two binary numbers by employing an array of full adders and half adders. This array is used for the nearly simultaneous addition of the various product terms involved. To form the various product terms, an array of AND gates is used before the Adder array. Checking the bits
3 min read
Serial Binary Adder in Digital Logic
Serial binary adder is a combinational logic circuit that performs the addition of two binary numbers in serial form. Serial binary adder performs bit by bit addition. Two shift registers are used to store the binary numbers that are to be added. A single full adder is used to add one pair of bits at a time along with the carry. The carry output fr
2 min read
Non-binary Counter in Digital Logic
A counter is a circuit that counts the number of occurrences of an input. The circuit consists of flip-flops which along with combinational elements are used for generation of control signals. If M = Total number of states, and n = Total number of flip-flop Then, M <= 2n If M = 2n ; Binary counter and M < 2n ; Non-binary counter Block Diagram
2 min read
Logic Synthesis in Digital Electronics
The process of resolving into component parts or analyzing, interpreting, translating, optimizing (rearranging or rewriting to improve efficiency), and mapping RTL (Register Transfer Level) code into a particular and indicated cell library. Programmed production of logic components in a specific digital circuit which may involve various kinds of co
5 min read
List of “Difference Between” Digital Logic and Design Topics
Digital Logic and Design are the main part of ultramodern electronic systems which enable the structure of complex circuits that power our world of digital and technology. This is a system in computers that uses simple values to produce I/ O operations. These distinctions include sense gates, circuit designs, and design approaches, and They have a
4 min read
Wired Logic in Digital Electronics
Wired logic is a type of digital logic where some logic operations are carried out by directly coupling the outputs of a single or several logic gates. This approach is determined by the electrical properties of the gates involved. A logic gate that uses just passive components like diodes and resistors to implement boolean algebra is known as a wi
4 min read
Article Tags :