Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Logic Gates – Building Blocks of Digital Circuits – DE Part 4

By Hai Prasaath K December 24, 2020

In the previous tutorial, it was discussed how arithmetic operations on binary numbers can be implemented by the means of boolean logic operations. In a digital circuit, the logic operations are executed by logic gates. A Logic gate is an electronic circuit which makes logical decisions. The AND, OR and NOT are the basic logic gates.

The NAND and NOR gates are derived from these. Any computing problem in digital circuitry can be expressed by a boolean equation or boolean expression. A boolean expression can be minimized to Minterms or Maxterms reducing the expression to a two-level implementation which can be designed with the NAND or NOR gates. That is why, NAND and NOR gates are called the Universal gates. The exclusive – OR gates is another logic gate which can be constructed using basic gates such as OR and NOT gates.

The logic gates can have two or more inputs and only one output expect for the NOT gate, which has only one input. The output signal from a logic gate appears only for certain combinations of the input signals as the number of combinations is always limited by the number of boolean variables (where each boolean variable represent an input channel).

So, basically, the logic gates are the building blocks of a digital circuit that can perform basic manipulation of the binary information. Any digital IC contains nothing but interconnected network of logic gates. Each gate is represented by a distinct logic symbol and its operation can be described by means of an algebraic function. The relationship between the input and output variables of each gate can be represented by means of a truth table  and signal response of any logic gate can be represented by the timing diagram. So, let us learn about various logic gates.

OR Gate –

The OR gate performs logical addition, commonly known as OR function. The OR gate has two or more inputs and only one output. The operation of OR gate is such that HIGH (1) on the output is produced when any of the inputs is HIGH (1). The output is LOW (0) only when all the inputs are LOW (0). Suppose, if A and B are the input variables of an OR gate and Y is its output, then

Y = A + B

Similarly, for more than two input variables, the output of OR gate can be expressed as follow –

Y = A + B + C + D +……

An OR gate built using diodes is shown below in which A and B represent the inputs and Y the output. The resistance RL is the load resistance. The Logical symbol of OR gate is also shown below –

 

Image showing OR Gate Symbol And Circuit

Fig. 1: Image showing OR Gate Symbol And Circuit

If A = 0 and B = 0, both the diodes will not conduct, hence the output Y = 0. If A = 1 and B = 0, diode D1 conducts, hence the output Y = 1. If A = 0 and B = 1, diode D2 conducts, hence the output Y = 1. If A = 1 and B = 1, both the diodes conduct and hence Y = 1. The output of an OR gate for two boolean variables can be represented by the following truth table –

Truth Table of OR Gate

Fig. 2: Truth Table of OR Gate

The truth table for OR gate can be graphically represented by the following timing diagram –

OR Gate Timing Diagram

Fig. 3: Timing Diagram of OR Gate

AND Gate –

The AND gate performs logical multiplication, commonly known as AND function. The AND gate has two or more inputs and a single output. The operation of AND gate is such that the HIGH (1) is only when all the inputs are HIGH (1). Even when one of the inputs is 0, the output will be zero. Suppose, if A and B are the input variable of the AND gate and Y is its output, then

Y = A · B

The dot (·) denotes the AND operation, but typically it can also be written as Y = AB. The two input AND gate built using the diodes  is shown below  in which A and B represent the inputs and Y the output. The Logical symbol of AND gate is also shown below –

Image showing AND Gate Symbol And Circuit

Fig. 4: Image showing AND Gate Symbol And Circuit

If A = 0 and B = 0, both the diodes conduct as they are forward biased, hence the output Y = 0. If A = 0 and B = 1, the Diode D1 conducts as they are forward biased, and hence the output Y = 0. If A = 1 and B = 0 the diode D2 conducts as they are forward biased, and hence the output Y = 0. If A = 1 and B = 1 both the diodes don’t conduct as they are reverse biased, and hence the output Y = 1. The output of an AND gate for two boolean variables can be represented by the following truth table –

Image showing NAND Gate Symbol And Circuit

 Fig. 5: Truth Table of AND Gate

The truth table for AND gate can be graphically represented by the following timing diagram –

Image showing NAND Gate Symbol And Circuit

     Fig. 6: Timing Diagram of AND Gate

NOT Gate –

The NOT gate performs the basic logical function called Inversion or the complementation. The purpose of this gate is to convert the one logic level into the opposite logic level. It has one input and one output. When the High level is applied at the input the low level appears at the output and vice-versa. A NOT gate built using a transistor is shown below, where A represent the input and Y represents the output. The Logical symbol of NOT gate is also shown below –

 

Image showing NOT Gate Symbol And Circuit

Fig. 7: Image showing NOT Gate Symbol And Circuit

When the input is HIGH, the transistor is in the ON state and the output is LOW. When the input is LOW, the transistor is in the OFF state and the output is HIGH. The output of a NOT gate can be represented by the following truth table –

Truth Table of NOT Gate

Fig. 8: Truth Table of NOT Gate

The truth table for NOT gate can be graphically represented by the following timing diagram –

Timing Diagram of NOT Gate

  Fig. 9: Timing Diagram of NOT Gate

NAND Gate –

The NAND gate performs the logical function which is the serial combination of the NOT and AND Gates. It has two or more inputs and only one output. The Logical symbol for the NAND gate is shown below –

Image showing NAND Gate Symbol And Circuit

Fig. 10: Image showing NAND Gate Symbol And Circuit

At a NAND gate, when all the inputs are HIGH, the output is LOW. When any one of the inputs is LOW, then the output is HIGH. The output of a NAND gate for two boolean variables can be represented by the following truth table –

 

 

Fig. 11: Truth Table of NAND Gate

The truth table for NAND gate can be graphically represented by the following timing diagram –

Timing Diagram of AND Gate

Fig. 12: Timing Diagram of NAND Gate

NOR Gate –

The NOR gate performs the logical function which is the serial combination of the NOT and OR Gates. It has two or more inputs and only one output. The Logical symbol for the NOR gate is shown below –

Truth Table of XOR Gate

Fig. 13: Image showing NOR Gate Symbol And Circuit

At a NOR gate, when all the inputs are LOW, the output is HIGH. When any one or both of the inputs is HIGH, then the output is LOW. The output of a NOR gate for two boolean variables can be represented by the following truth table –

Truth Table of XOR Gate

Fig. 14: Truth Table of NOR Gate

The truth table for NOR gate can be graphically represented by the following timing diagram –

Truth Table of NOR Gate

Fig. 15: Timing Diagram of NOR Gate

 

EXCLUSIVE – OR (Ex – OR) Gate –

An Exclusive – OR gate is a gate with two or more inputs and outputs. The output of a two-input XOR gate assumes a HIGH state if one and only one input assumes a HIGH state i.e. the output is HIGH only if input A or input B is HIGH and the output is LOW when both the inputs are either HIGH or LOW. The logical symbol of the XOR is shown below –

Image showing XOR Gate Symbol And Circuit

Fig. 16: Image showing XOR Gate Symbol And Circuit

The output of an XOR gate for two boolean variables can be represented by the following truth table –

Truth Table of XOR Gate

Fig. 17: Truth Table of XOR Gate

The truth table of the XOR gate shows that the output is HIGH when any one, but not all of the inputs is 1 and when the both inputs are same i.e. either 0 or 1, the output is LOW. This exclusive feature eliminates a similarity to the OR gate. The truth table for XOR gate can be graphically represented by the following timing diagram –

Truth Table of XOR Gate

Fig. 18: Timing Diagram of XOR Gate

Exclusive – NOR (XNOR) Gate –

The XNOR gate performs the logical function which is the serial combination of the NOT and XOR Gates. The output of a XNOR gate assumes a HIGH state if all the input assumes either HIGH state or LOW state. If either input has a different logic state, the output of XNOR gate is LOW. The logical symbol of the XNOR is shown below –

Image showing NOR Gate Symbol And Circuit

Fig. 19: Image showing XNOR Gate Symbol And Circuit

The output of an XNOR gate for two boolean variables can be represented by the following truth table –

Truth Table of NOR Gate

Fig. 20: Truth Table of XNOR Gate

The truth table for XNOR gate can be graphically represented by the following timing diagram –

Timing Diagram of OR Gate

Fig. 21: Timing Diagram of XNOR Gate

These logic gates are the building blocks of any digital circuit. In the next tutorial, learn about theorems of boolean algebra and how a boolean expression can be minimized to Minterms and Maxterms, so, it can be implemented by two level interconnection of universal logic gates (NAND and NOR).

You may also like:

  • beginners guide
    Basic Electronics 01 – Beginners guide to setting up an…

  • What are the top tools for developing embedded software?

  • What is the Modbus protocol and how does it work?

  • Choosing Batteries for Robots
  • VHDL
    VHDL Tutorial 1: Introduction to VHDL

  • What is an Actuator Sensor Interface (AS-i)?

Filed Under: Digital Electronics, Tutorials

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • GanFet power switch starts burning after 20 sec
  • Colpitts oscillator
  • problem identifying pin purpose on PMA5-83-2WC+ amplifier
  • Voltage Regulator Sizing Question
  • Genetic algorithm code in matlab for cost optimization

RSS Electro-Tech-Online.com Discussions

  • LED circuit for 1/6 scale diorama
  • Electronic board faulty?!?
  • Can I use this charger in every country?
  • using a RTC in SF basic
  • An Update On Tarrifs

Featured – Designing of Audio Amplifiers part 9 series

  • Basics of Audio Amplifier – 1/9
  • Designing 250 Milli Watt Audio Power Amplifier – 2/9
  • Designing 1 Watt Audio Power Amplifier – 3/9
  • Designing a Bass Boost Amplifier – 4/9
  • Designing a 6 Watt Car Audio Amplifier – 5/9
  • Design a low power amplifier for headphones- 6/9

Recent Articles

  • Fischer connector system adds ratchet locking system designed for 300g shock resistance
  • Littelfuse introduces tactile switch with enhanced bracket peg design for mounting strength
  • Infineon releases GaN switch with monolithic bidirectional design
  • Sienna Semiconductor data converters feature sample rates from 20 to 250 Msps
  • Delta’s 5,500 W power supplies achieve 97.5% energy efficiency for AI servers

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe