The Wayback Machine - https://web.archive.org/web/20240605081606/https://www.geeksforgeeks.org/universal-logic-gates/
Open In App

Universal Logic Gates

Last Updated : 01 Jun, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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 any arbitrary Boolean function can be implemented using NAND gate or NOR gate alone. This makes NAND and NOR universal gates for developing every other digital logic gates in the technological world.

In this particular article, we have a given a detailed description of universal logic gates. We will understand the way in which other all logical gates such as NOT, AND, OR, XOR, and XNOR gates can be implemented using NAND or NOR gates alone.

What are Universal Gates?

The universal gates are the logic gates that are versatile in that they can be programmed to execute any Boolean function. The most popular types among them are NAND and NOR gates.

To explain it further, the input of the universal gates can be interconnected in one way or the other while the inputs can also be inverted in one way or the other to get the AND, OR, NOT, XOR and XNOR basic Boolean functions.

They are very versatile to be core components when it comes to the implementation of digital circuits and processors. By employing just a single gate or by combining both these gate types, it is possible to construct intricate logic systems.

NAND Gate

A NAND gate is a combination of an AND gate followed by a NOT gate. It outputs a 0 only when all its inputs are 1; otherwise, it outputs 1.

Symbol and Truth Table

NAND-Gate

NAND Gate

NOR Gate

A NOR gate is a combination of an OR gate followed by a NOT gate. It outputs a 1 only when all its inputs are 0; otherwise, it outputs 0.

Symbol and Truth Table

NOR-Gate

NOR Gate

Realizing Basic Gates Using NAND and NOR

Implementing Basic Gates using NAND Gate

We will see Implementing Basic Gates using NAND Gate :

NOT Gate (Inverter)

Circuit: Connect both inputs of a NAND gate to the same input signal.

NOT-Gate-using-NAND-Gate

NOT GATE USING NAND GATE

AND Gate

Circuit: Connect the outputs of two NAND gates to the inputs of a third NAND gate.

AND-Gate-using-NAND-Gate

AND Gate using NAND Gate

Truth Table

A

B

Z

0

0

0

0

1

0

1

0

0

1

1

1

OR Gate

Circuit: Connect each input to a NAND gate and then connect the outputs of these gates to the inputs of another NAND gate.

OR-Gate-USING-NOR-GATE

OR Gate BY USING NAND GATE

Truth Table

A

B

Output (A OR B)

0

0

0

1

0

1

0

1

1

1

1

1

NOR Gate

Circuit: Connect the outputs of two NAND gates to the inputs of a third NAND gate. Then, feed the output of this gate into another NAND gate configured as a NOT gate.

NOR-GATE-USING-NAND-GATE

NOR GATE USING NAND GATE

Truth Table

A

B

A NOR B

0

0

1

0

1

0

1

0

0

1

1

0

XOR Gate

Circuit: Utilize a combination of four NAND gates.

XOR-Gate-USING-NAND-GATE

XOR Gate USING NAND GATE

Truth Table

A

B

A XOR B

0

0

0

0

1

1

1

0

1

1

1

0

XNOR Gate

Circuit: Connect the output of an XOR gate to a NAND gate configured as a NOT gate.

XNOR-Gate-USING-NAND-GATE

XNOR Gate USING NAND GATE

Truth Table

A

N

A XNOR B

0

0

1

0

1

0

1

0

0

1

1

1

Implementing Basic Gates using NOR Gate

We will see Implementing Basic Gates using NOR Gate :

NOT Gate (Inverter)

Circuit: Connect both inputs of a NOR gate to the same input signal.

NOT-Gate-using-NOR-Gate

NOT Gate using NOR Gate

Truth Table

A

Output (NOT A)

0

1

1

0

AND Gate

Circuit: Use three NOR gates. First, connect each input to a NOR gate and then connect their outputs to the inputs of another NOR gate.

AND-Gate-USING-NOR-GATE

AND Gate USING NOR GATE

Truth Table

A

B

Output (A AND B)

0

0

0

0

1

0

1

0

0

1

1

1

OR Gate

Circuit: Use a combination of NOR gates, with the final gate configured as a NOT gate.

OR-Gate-USING-NOR-GATE

OR Gate USING NOR GATE

Truth Table

A

B

Y Output (A OR B)

0

0

0

0

1

1

1

0

1

1

1

1

NAND Gate

Circuit: Use a combination of three NOR gates.

implementation of NAND gate using NOR gate

Truth Table

A

B

OUTPUT(A NAND B)

0

0

1

0

1

1

1

0

1

1

1

0

XOR Gate

Circuit: Utilize a combination of five NOR gates.

XOR-Gate-using-NOR-GATE

XOR Gate using NOR GATE

Truth Table

A

B

OUTPUT(A XOR B)

0

0

0

0

1

1

1

0

1

1

1

0

XNOR Gate

Circuit: Connect the output of an XOR gate (realized using NOR gates) to another NOR gate configured as a NOT gate.

Implementation of XNOR Gate using NOR GATE

Truth Table

A

B

OUTPUT(A X NOR B)

0

0

1

0

1

0

1

0

0

1

1

1

Applications of Universal Logic Gates

  • Computer processors: NAND or NOR gates serves as the basic building block for microprocessors and other ICs incorporating complex functionalities.
  • Simple logic circuits: Universal gates enable any Boolean function to be computed using the gate of a single type in the circuitry design.
  • Programmable logic devices (PLDs): FPGAs for instance, incorporate logic functions based on look-up tables which are constructed from for NAND or NOR gates defined by the customer.
  • Minimalist circuit design: It becomes possible for engineers to develop circuits containing the fewest components as they can design circuits with the help of only NAND or NOR gates.
  • Universal gates can be wired together to form standard digital subcircuits such as arithmetic circuits like adder circuits, circuits for decoding and encoding, multiplexer and demultiplexer circuits etc.
  • The controllability of inputs and scalability of outputs enable the subsequent logic for addition, flip flops, and memory etc.

Conclusion

From this article we can ungerstand why NAND and NOR gates are considered to be unique in the realm of digital logic design, as they are reversible. From the above simple implementation of the universal gate, it was clear that all the gates such as NOT, AND, OR, XOR AND XNOR and any other boolean logic function can be implemented. To be able to perform all of the basic logical operations with just one gate type also makes integrated circuit fabrication easier and requires fewer parts.

Universal Logic Gates – FAQs

What are the reasons as to why NAND and NOR gates are known as universal gates?

NAND and NOR gates are the examples of universal gates because they are able to realize every other basic logic gates such as AND, OR, NOT and so on. Normally, any bolean function can be constructed using only NAND gates or NOR gates. This makes them universal.

Is NAND memory type preferable over NOR or is it the other way round?

There is no difference in their performance and capability and hence, NAND and NOR are equally good. However, with both it is possible to implement all the classes of logic functions equally successfully. This is so since there is no right or wrong way to develop a given application and the decision mainly depends on the designer’s preference or the application’s requirements. Some applications may call for more AND/OR operations than NOT, in which NAND would be more suitable; if, on the other hand, NOT is the required operation, then NOR is the way to go.

It is an interesting question if possible to construct complex logic using only NAND or NOR gates.

Yes, with NAND gates or just NOR gates, complex logic can be created, and it can be rather complicated. Thus, knowing that any two-input boolean function can be implemented using NAND or NOR, we can implement any boolean logic function of any complexity using either of these two gates only. These universal gates are enough to design whole microprocessors and computers.



Previous Article
Next Article

Similar Reads

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. [caption width="800"]Gr
1 min read
Program to implement Logic Gates
A Logic gate is an elementary building block of any digital circuits. It takes one or two inputs and produces output based on those inputs. Outputs may be high (1) or low (0). Logic gates are implemented using diodes or transistors. It can also be constructed using vacuum tubes, electromagnetic elements like optics, molecule etc. In a computer, mos
8 min read
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
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. The
2 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,
6 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
Introduction of Logic Gates
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. Table of Content What is
7 min read
Universal Shift Register in Digital logic
A Universal shift register is a register which has both the right shift and left shift with parallel load capabilities. Universal shift registers are used as memory elements in computers. A Unidirectional shift register is capable of shifting in only one direction. A bidirectional shift register is capable of shifting in both the directions. The Un
2 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
2 min read
Half Adder and Half Subtractor using NAND NOR gates
Introduction:Advantages of using NAND and NOR gates to implement Half Adder and Half Subtractor:Universality: NAND and NOR gates are considered universal gates because they can be used to implement any logical function, including binary arithmetic functions such as addition and subtraction.Cost-effectiveness: NAND and NOR gates are relatively simpl
2 min read