Basic Logic Gates in Digital Electronics

In this tutorial, you will learn the fundamentals of logic gates, including their definitions, classifications, and advantages. You will explore the functionality of basic gates like AND, OR, and NOT, along with universal gates such as NAND and NOR. The tutorial also covers buffer gates, bistable multivibrators, and the enable/disable inputs for AND and OR gates, highlighting their applications in digital circuits.

Contents:

  1. What are Logic Gates?
  2. Advantages of Logic Gates
  3. AND Gate
  4. OR Gate
  5. NOT Gate
  6. NAND Gate
  7. NOR Gate
  8. XOR Gate
  9. XNOR Gate
  10. Switching Circuit of NOT Gate
  11. Transistor Circuit of NOT Gate
  12. Switching Circuit of AND Gate
  13. Switching Circuit of OR Gate
  14. Differences Between OR AND Logic Gate
  15. Differences Between Buffer and NOT Gate
  16. Buffer Logic Gate and Its Design Using NOT Gates
  17. Bistable Multivibrator
  18. Applications of Buffer Gate in Digital Circuits
  19. Enable and Disable Inputs for AND Gate
  20. Enable and Disable Inputs for OR Gate
  21. Astable Multivibrator

What are Logic Gates?

Logic gates are the fundamental building block of any digital circuit. All the higher components in Digital Electronics are made up of logic gates only. The logic gates are designed using analog electronic components like MOSFETs, diodes, resistors, capacitors, bjts, etc.

The kind of devices used in designing a logic gate constitutes the logic family. The available kind of logic families are: –

  • Unipolar Logic Family: – Made up of Unipolar devices like MOSFETs
  • Bipolar logic family: – Made up of bipolar devices like bjts

Classifications of Logic Gates:

  • Basic Gates: AND, OR and NOT gates are the three basic gates in digital systems. These logic gates are the basic building blocks of a digital circuit.
  • Universal Logic Gates: NAND and NOR gates are the universal logic gates. They can be used to implement any Boolean expression in digital systems.
  • Special Purpose Gates: Exclusive-OR (XOR) and Exclusive-NOR (XNOR) gates are the special-purpose gates used in digital systems.

advertisement
advertisement

Advantages of Logic Gates

The advantages of logic gates are explained below:

  • The inputs and outputs for logic gates are only HIGH or LOW i.e. 1 or 0. So inputs and outputs can be distinguished easily.
  • Circuit designing using logic gates is simple because Boolean algebra is used for logic operations. Logic gates are also very cheap and safe to use.
  • Logic gates consume low power and they usually have a fixed number of input and output ports. Their operations are mostly noise-free and fast.

AND Gate

The AND gate is the direct implementation of the conjunction function used in Boolean algebra. It takes two inputs and produces the output as per A.B operation. The AND operation is also known as product operation.

The truth table is shown below for AND gate.

A B A AND B
0
0
0
0
1
0
1
0
0
1
1
1

Here is the diagram of AND gate.

AND gate

As shown in the figure, it takes two inputs and produces one output AB. It can also be extended to make an n-input AND gate with an output equal to A.B.C….n as it follows associative property.

OR Gate

The OR gate is the direct implementation of the disjunction function used in Boolean algebra. It takes two inputs and produces the output as per A + B operation. The OR operation is also known as the sum operation.

The truth table is shown below for OR gate.

advertisement
A B A OR B
0
0
0
0
1
1
1
0
1
1
1
1

Here is the diagram of OR gate.

OR gate

As shown in the figure, it takes two inputs and produces one output A+B. It can also be extended to make an n-input OR gate with an output equal to A+B+C+D….n as it follows associative property.

NOT Gate

The NOT gate is the direct implementation of the negation function used in Boolean algebra. It takes one input and produces its inverted output. It is also known as an inverter.
The truth table is shown for NOT gate.

A A’
0
1
1
0

Here is the diagram for NOT gate.

advertisement
NOT gate

As shown in the figure, a NOT gate is a single input single-output gate. It cannot be extended to many input gates.

NAND Gate

The NAND gate is obtained by performing inversion operation on the AND gate. It is a two-input gate and it produces a false output only when both the inputs are true. Here is the truth table for the NAND gate.

A B A NAND B
0
0
1
0
1
1
1
0
1
1
1
0

Here is the diagram for the NAND gate. It is shown as an AND gate with a bubble.

NAND gate

As shown in the figure, the NAND gate can have only two inputs and one output. It cannot be made into 3 input NAND gate as it does not have associative property.

NOR Gate

The NOR gate is obtained by performing inversion operation on the OR gate. It is a two-input gate and it produces a true output only when both the inputs are false. Here is the truth table for the NOR gate.

A B A NOR B
0
0
1
0
1
0
1
0
0
1
1
0

Here is the diagram for NOR gate. It is shown as an OR gate with a bubble.

NOR gate

As shown in the figure, the NOR gate can have only two inputs and one output. It cannot be made into 3 input NOR gate as it does not have associative property.

XOR Gate

The XOR function is also known as Exclusive-OR is given by f = xy’ + yx’. It is made from two AND gates and one OR gate but due to its extensive usefulness, we have a gate dedicated to this function known as the XOR gate.

The XOR function is also known as the odd one’s detector as it returns true as the output only when either of its input is true. Its truth table is given as: –

A B A XOR B
0
0
0
0
1
1
1
0
1
1
1
0

Here is the diagram for the XOR gate.

XOR gate

As shown in the figure, the XOR gate has two inputs and one output. It can be extended to n-inputs with an output equal to A1 XOR A2 XOR A3…An.

Here are some properties of XOR Gate: –

  1. It is commutative and associative.
  2. A XOR A = 0
  3. A XOR A’ = 1
  4. A XOR 0 = A
  5. A XOR 1 = A’
  6. If n = odd, A1 XOR A2 XOR…. An = A1 XNOR A2 XNOR …An, else if n=even, A1 XOR A2 XOR ..An = (A1 XNOR A2 XNOR A3…An)’

XNOR Gate

The XNOR function is also known as exclusive NOR and is given as f = x’y’ + xy. It is made up of two AND gates & one OR gate, but it is also like XOR available as a gate. It is also known as even one’s detector as it gives output as true only when both of its inputs are the same, either both are zeros or ones.

Its truth table is shown below.

A B A XNOR B
0
0
1
0
1
0
1
0
0
1
1
1

Its represented diagrammatically as an inverted XNOR gate as shown in the figure.

XNOR gate

As shown in the figure, the XNOR gate has two inputs and one output. It can be extended to n-inputs with an output equal to (A1 XNOR A2 XNOR A3…An).

Here are some properties of XNOR Gate: –

  1. It is commutative and associative.
  2. A XNOR A = A
  3. A XNOR A’ = 0
  4. A XNOR 0 = A’
  5. A XNOR 1 = A

Switching Circuit of NOT Gate

The following diagram explains the switching circuit of a NOT gate.

switching circuit of a NOT gate
  • The function of a NOT gate is to produce output opposite to the logic level of input which is similar to the switching circuit diagram.
  • When the switch is closed (logic 1), current will not flow through the bulb and it will not glow (logic 0).
  • When the switch is open (logic 0), current will flow through the bulb and it will glow (logic 1).
  • Thus, the switching circuit is showing the behavior of a NOT gate i.e., the bulb glows only when the switch is OFF.

Transistor Circuit of NOT Gate

The following diagram explains the transistor circuit for a NOT gate.

Transistor Circuit of NOT Gate
  • The function of a NOT gate is to produce output opposite to the logic level of input which is similar to the transistor circuit diagram.
  • A common-emitter n-p-n transistor has been used in the circuit. It will be ON, when the base terminal gets some positive voltage.
  • When input IN is HIGH (logic 1), BJT will be in ON state and OUT will be GND (logic 0).
  • When input IN is LOW (logic 0), BJT will be in OFF state and OUT will be Vcc (logic 1). Thus, it is showing the behavior of a NOT gate.

Switching Circuit of AND Gate

The following diagram explains the switching circuit of an AND gate.

Switching Circuit of AND Gate
  • In the circuit, the two switches (switch 1 and switch 2) act as the inputs of an AND gate and glowing of the bulb as the output.
  • When any one of the switches or both the switches are opened, no current passes through the bulb and it is in OFF state (logic 0).
  • When two switches are closed, current passes through the bulb and it glows (logic 1).
  • Thus, the switching circuit is showing the behavior of an AND gate i.e. the bulb glows only when the two switches are closed.

Switching Circuit of OR Gate

The following diagram explains the switching circuit of an OR gate.

switching circuit of an OR gate
  • In the circuit, the two switches (switch 1 and switch 2) act as the inputs of an OR gate and glowing of the bulb as the output.
  • When any one of the switches or both the switches are closed, current passes through the bulb and it glows (logic 1).
  • When the switches are opened, no current passes through the bulb and it is in OFF state (logic 0).
  • Thus, the switching circuit is showing the behavior of an OR gate i.e., the bulb stops glowing (logic 0) only when both the switches are OFF.

Differences Between OR AND Logic Gate

The differences between an OR and an AND logic gate is listed below.

Parameters OR Logic Gate AND Logic Gate
Operation It performs OR logic operation or logical summation. It performs AND logic operation or logical multiplication.
Output It produces LOW output only when all the inputs are LOW. It produces HIGH output only when all the inputs are HIGH.
Expression Y = A + B Y = A.B
Rule If follows the rule of logical disjunction. It follows the rule of logical conjunction.
Symbol It is denoted by the symbol:

OR Logic Gate symbol
It is denoted by the symbol:

AND Logic Gate symbol

Differences Between Buffer and NOT Gate

The difference between a buffer and a NOT logic gate is listed below.

Parameters Buffer logic Gate NOT Logic Gate
Operation It passes input to the output without any change. It performs inversion operation or logical negation.
Output The output of a buffer gate is LOW when input is LOW and HIGH when input is HIGH. The output of a NOT gate is HIGH when input is LOW and LOW when input is HIGH.
Expression Y = A Y = A’
Design Buffer logic gates are designed using NOT logic gates. NOT gates are fundamental logic gates. They are built from transistors.
Symbol It is denoted by the symbol:

Buffer logic Gate Symbol
It is denoted by the symbol:

NOT Logic Gate Symbol

Buffer Logic Gate and Its Design Using NOT Gates

A Buffer logic gate and its design using NOT gates can be explained by the diagrams given below.

Buffer Logic Gate Symbol
Buffer using NOT Gates
  • A buffer has one input and one output. Its function is to pass its input to its output without any change. Its behavior is the opposite of a NOT gate.
  • A buffer can be designed by a series combination of even number of NOT gates without feedback.
  • The above diagrams explain the designing of a buffer gate using two NOT gates. For the first NOT gate input is A and output is A’. For the second NOT gate input is A’ and output will be (A’)’ = A.
  • So, input A is being reflected at the output without any change. It is satisfying the property of a buffer gate.

Bistable Multivibrator

A bistable multivibrator can be explained by the following diagram.

bistable multivibrator
  • It is the basic storage element used to store a bit. It is also known as a flip-flop.
  • It has two stable states and it stays in one of the two stable states. Only an external trigger it can change the state.
  • A bistable multivibrator can be designed by a series combination of even number of NOT gates with feedback.
  • The diagram explains about the designing of a bistable multivibrator using two NOT gates. The output is connected to the input A and it is the feedback path. This feedback path is responsible for the stable states.

Applications of Buffer Gate in Digital Circuits

  • Buffers are mainly used to increase propagation delay. They are also used to isolate inputs from outputs in a digital circuit.
  • Buffer prevents improper current divisions as some circuit components may have high impedance. It provides required amount of current to all the loads.
  • A digital buffer can control the switching (ON or OFF) of data transmission in buses and registers that are widely used in computers.

Enable and Disable Inputs for AND Gate

Disable and enable inputs are the control inputs. The following diagram explains the enable and disable inputs for an AND gate.

Enable and Disable Inputs for AND Gate
  • For an enable control input signal, change in input causes change in output but for a disable control input signal, change in the input doesn’t cause change in the output.
  • If control input is 0 then whatever may be the input at A, output Z will always be 0. Thus, the AND gate is disabled. So, “logic 0” is the disable input for an AND gate.
  • The table for control input ‘0’ is:
    A Control input Z
    0 0 0
    0 1 0
  • If control input is 1 then input A will be reflected at output Z i.e. Z = A. Thus the AND gate is enabled. So, “logic 1” is the enable input for an AND gate.
  • The table for control input ‘1’ is:
    A Control input Z
    0 1 0
    1 1 1

Enable and Disable Inputs for OR Gate

Disable and enable inputs are the control inputs. The following diagram explains the enable and disable inputs for an OR gate.

Enable and Disable Inputs for OR Gate
  • If control input is 0, then input A will be reflected at output Z i.e. Z = A. Thus, the OR gate is enabled as change in input A will cause change in the output Z. So, “logic 0” is the enable input for an OR gate.
  • The table for control input ‘0’ is:
    A Control input Z
    0 0 0
    1 0 1
  • If control input is 1, then whatever may be the input at A, output Z will always be 1. Thus, the OR gate is disabled as no change will occur at the output Z with change in the input A. So, “logic 1” is the disable input for an OR gate.
  • The table for control input ‘1’ is:
  • A Control input Z
    0 1 1
    1 1 1

Astable Multivibrator

An astable multivibrator and its design can be explained by the diagram below.

Astable Multivibrator
  • An astable multivibrator is a switching circuit that doesn’t have any stable output state.
  • An astable multivibrator can be designed by a series combination of odd number of inverters with feedback.
  • Astable multivibrators are used to generate square waves as they can perform inversion of signals with a constant delay.
  • Time period of a generated square wave can be determined by the formula: T = 2 × n × tpd. Where, ‘n’ is the total number of inverters used in the circuit (must be odd) and “tpd” is the time propagation delay of each inverter.

Key Points to Remember

Here are the key points to remember in “Logic Gates”.

  • Logic gates are the fundamental building blocks of digital circuits, made from analog components like transistors and diodes, classified into basic, universal, and special-purpose gates.
  • The main types of logic gates are AND, OR, NOT, NAND, NOR, XOR, and XNOR, each with specific truth tables and applications in digital systems.
  • Logic gates offer several advantages, including simplicity in circuit design, low power consumption, and clear distinction between high (1) and low (0) states.
  • Buffer gates pass inputs directly to outputs without inversion, while NOT gates perform logical negation, resulting in opposite outputs.
  • A bistable multivibrator, or flip-flop, stores a bit and changes state only with an external trigger, while astable multivibrators generate continuous square wave signals.
  • Enable and disable inputs for AND and OR gates control their output based on the status of additional control inputs, allowing for more complex logic operations.
  • Switching circuits for each logic gate (AND, OR, NOT) illustrate their basic functionality, with bulbs representing output states based on the positions of switches as inputs.
  • Understanding the properties and applications of logic gates is essential for designing and analyzing digital circuits in various technologies.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.