The Wayback Machine - https://web.archive.org/web/20240921223134/https://www.geeksforgeeks.org/two-level-implementation-of-logic-gates/
Open In App

Two Level Implementation of Logic Gates

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

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, the maximum number of logic gates that can be cascaded between any input and output is two. The outputs of first-level logic gates are connected to the inputs of second-level logic gates in this configuration.

What is Logic Gate?

A Logic gates is a basic component of digital circuits which perform basic logical operations. Just like algebraic structures or mathematical systems they execute basic logical operations that are so critical in designing intricate digital networks. A gate can operate applying Boolean algebra with input that can be given to it and yields outputs as a result. Here’s a quick overview of the primary logic gates used in two-level logic design:

  • AND Gate: Outputs true (1) only if all inputs are true.
  • OR Gate: Outputs true (1) if at least one input is true.
  • NAND Gate: Outputs true (1) unless all inputs are true.
  • NOR Gate: Outputs true (1) only if all inputs are false.

Example of two-level logic implementation

An Example of Two-level implementation

An Example of Two-level implementation

We explore four logic gates in two-level logic implementation: AND Gate, OR Gate, NAND Gate, and NOR Gate. There are a total of 16 two-level logic combinations if we choose one of these four gates at the first level and one at the second level. These are 

AND-AND, AND-OR, AND-NAND, AND-NOR,
OR-AND, OR-OR, OR-NAND, OR-NOR,
NAND-AND, NAND-OR, NAND-NAND, NAND-NOR,
NOR-AND, NOR-OR, NOR-NAND, NOR-NOR.

Each two-level combination implements a separate logic function. These 16 combinations are divided into two categories.

  1. Degenerative form  of logic gate Combination
  2. Non-Degenerative form of logic gate Combination

Degenerative form

Degenerative form occurs when the output of a two-level logic realization can be achieved with only one logic gate. The advantage of degenerative form is that the number of inputs of single Logic gate increases which results in the increment of fan-in of logic gates.

In those 16 combinations, there are 8 degenerate forms. Below are instances of each of these degenerate types.

AND-AND Implementation

Because the entire function results in an AND function of all the inputs, this AND-AND gate combination is a degenerate form.

And-And Implementation

AND-AND Implementation

        

The outputs of first-level logic gates: F1=AB and F2=CD. These outputs are applied as inputs of the second level, so the output of the second level is F=F1F2, which means F=ABCD.

OR-OR Implementation

The output of an OR-OR gate combination is the Logic Function OR. With this combination, the OR function can be implemented with several inputs.

Or-Or implementation

OR-OR implementation

The outputs of first-level logic gates: F1=A+B and F2=C+D. These outputs are applied as inputs of the second level, so the output of the second level is F=F1+F2  which means F=A+B+C+D.

AND-NAND Implementation

AND gate are present in the first level of this logic implementation, while NAND gates are present in the second level. An example of AND-NAND logic realization is shown in the diagram below.

And-Nand Implementation

AND-NAND Implementation

The outputs of first-level logic gates: F1=AB and F2=CD. These outputs are applied as inputs of the second level, so the output of the second level is F= (F1F2)’  which means F=(ABCD)’.

OR-NOR Implementation

OR-NOR combination of gates results in NOR logic function. And this degenerate form can be used for the NOR function with multiple inputs.

Or-Nor Implementation

OR-NOR Implementation

The outputs of first-level logic gates: F1=A+B and F2=C+D. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1+F2)’ which means F=(A+B+C+D)’.

NAND-NOR Implementation

The outcome function of NAND-NOR in two-level logic is AND logic. The following is its expression and schematic:

Nand-Nor Implementation

NAND-NOR Implementation

The outputs of first level logic gates: F1=(AB) ‘ and F2=(CD)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1+F2)’ which means F=((AB)’+(CD)’)’.

NOR-NAND Implementation

Because the NOR-NAND combination also produces an OR function, it is likewise a degenerate form. The following is an example of it with a diagram;

Nor-Nand Implementation

NOR-NAND Implementation

The outputs of first level logic gates: F1=(A+B) ‘ and F2=(C+D)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1.F2)’  which means F=((A+B)'(C+D)’)’.

NAND-OR Implementation

This combination, like the AND-NAND combination, produces a NAND logic function.

Nand-Or Implementation

NAND-OR Implementation

The outputs of first level logic gates: F1=(AB) ‘ and F2=(CD)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1+F2) which means F=((AB)’+(CD)’)=(ABCD)’.

NOR-AND Implementation

This combination is identical to the OR-NOR combination since this combination similarly results in a NOR function.

Nor-And Implementation

NOR-AND Implementation

The outputs of first level logic gates: F1=(A+B) ‘ and F2=(C+D)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1.F2) which means F=((A+B)'(C+D)’)=(A+B+C+D)’.

Non-Degenerative form

A non-degenerative form occurs when the output of a two-level logic realization cannot be achieved using a single logic gate. Non-degenerate forms are two-level logic combinations that implement the Sum of Product form or the Product of Sum form.

In those 16 combinations, there are 8 non-degenerate forms. Below are instances of each of these non-degenerate types.

AND-OR implementation

The first level gate in a While-OR combination is an AND gate, and the second level gate is an OR gate. As shown in the diagram below, this combination implements the Sum of Product (SOP) form.

And-Or Implementation

AND-OR Implementation

The outputs of first-level logic gates: F1=AB and F2=CD. These outputs are applied as inputs of the second level, so the output of the second level is  F=(F1+F2) which means F=(AB+CD).

NAND-NAND Implementation

NAND is a universal gate, and its NAND-NAND combination, like the AND-OR combination, is used to produce the Sum of Product form.

Nand-Nand Implementation

NAND-NAND Implementation

The outputs of first-level logic gates: F1=(AB)’ and F2=(CD)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1.F2)’ which means F=(AB)+(CD).

OR-AND Implementation

The first level gate in an OR-AND combination is an OR gate, and the second level gate is an AND gate. The Product of Sum form is implemented with an OR-AND combination.

Or-And Implementation

OR-AND Implementation

The outputs of first-level logic gates: F1=(A+B) and F2=(C+D). These outputs are applied as inputs of the second level, so the output of the second level is F=(F1.F2) which means F=(A+B)(C+D).

NOR-NOR Implementation

NOR is also a universal gate and its NOR-NOR combination can be used to implement the Product of Sum form.

Nor-Nor Implementation

NOR-NOR Implementation

The outputs of first-level logic gates: F1=(A+B)’ and F2=(C+D)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1+F2)’ which means F=((A+B)’+(C+D)’)’=(A+B)(C+D).

AND-NOR Implementation

The AND-NOR combination is used to implement the AND-OR-INVERT compound logic (AOI).

And-Nor Implementation

AND-NOR Implementation

The outputs of first-level logic gates: F1=(AB) and F2=(CD). These outputs are applied as inputs of the second level, so the output of the second level is F=(F1+F2)’ which means F=(AB+CD)’.

NAND-AND Implementation

The AND-OR-INVERT (AOI) form can also be implemented using NAND-AND.

Nand-And Implementation

NAND-AND Implementation

The outputs of first-level logic gates: F1=(AB)’ and F2=(CD)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1F2) which means F=(AB)'(CD)’=(AB+CD)’.

OR-NAND Implementation

The OR-NAND form is used to implement the OR-AND-INVERT compound logic (OAI).

Or-Nand Implementation

OR-NAND Implementation

The outputs of first-level logic gates: F1=(A+B) and F2=(C+D). These outputs are applied as inputs of the second level, so the output of the second level is F=(F1F2)’ which means F=[(A+B)(C+D)]’.

NOR-OR Implementation

The NOR-OR combination, like the OR-NAND combination, is used to build OR-AND-INVERT compound logic (OAI).

Nor-Or Implementation

NOR-OR Implementation

The outputs of first-level logic gates: F1=(A+B)’ and F2=(C+D)’. These outputs are applied as inputs of the second level, so the output of the second level is F=(F1+F2),  which means F=(A+B)’+(C+D)’=[(A+B)(C+D)]’.

Advantages of Two-Level Logic

  • Simplified Design: Two level logic reduces the design complexity because all that is used in the process is logic gates that only two levels deep. This can help circuit design to be more feasible and less complex.
  • Efficient Implementation: There are only two levels of gates where two-level logic makes more sense of speed since the signal will only traverse through a few gates at most.
  • Reduced Gate Count: It can be useful in the first-level design for reducing the total number of gates possibly bringing down the cost and power consumption of a preferred design from the second level.

Disadvantages of Two-Level Logic

  • Limited Complexity: The restriction to two levels means that the logic functions that can be implemented are of a much more limited kind and this may not fit in the more advanced or specialized applications.
  • Design Constraints: If a system is designed with only two levels of gates, it is also possible that to obtain the desired functions more complex logic is required and hence the designs are not very easy ones.
  • Potential for Increased Gate Usage: There are typical situations, where using of two-level logic with required function may increase the number of gates compared to the cases, where multi-level solution can be used.

Conclusion

Two level logic proves efficient in the organization of the external outlines of the project because it puts limitations on the number of logic gate levels between the input and output. Although this can help to reduce the overall number of layers required in the design and can contribute toward increasing the efficiency of some applications. However, such limitation of two levels of implementation might not be good for all types of logic functions especially for those that need more complex circuits. Recognition of benefits and limitations of two-level logic is quite important in order to employ it to proper design of digital circuits.

Frequently Asked Questions on Two Level Implementation of Logic Gates-FAQ’s

What is the difference between degenerate and non-degenerate forms in two-level logic?

Degenerate forms utilize one form of the gate that yields the desired output (i.e. AND-AND or OR- OR) resulting in simpler expressions and limited output. Composite forms use one or the other of the types of gates in the implementation of further functions as Sum of Product (SOP) forms and Product of Sum (POS) forms.

How many unique two-level logic gate combinations are there?

Using four basic gates, namely: AND, OR, NAND and NOR there are 16 possible combinations of two-level logic gates. These combinations include all the possible combination of these gates with regard to their placement in the two levels of the structure.

Why might a designer choose a two-level logic design over a multi-level design?

A designer may decide to adopt the two-level logic design since it is easy to implement particularly when dealing with circuits that require high speeds and virtually minimal gate count. This is because the two levels of logic can make the design process easier and there is likelihood that its application may lead to better performance as compared to other methods. However, the selection of analog or digital circuits depends on the need of the circuit and the degree of function computations required.



Previous Article
Next Article

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
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
9 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
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
DBMS Architecture 1-level, 2-Level, 3-Level
A Database stores a lot of critical information to access data quickly and securely. Hence it is important to select the correct architecture for efficient data management. DBMS Architecture helps users to get their requests done while connecting to the database. We choose database architecture depending on several factors like the size of the data
4 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
Two Level Paging and Multi Level Paging in OS
Paging is the process in which we convert the entire process into equal-sized pages. Each page further consists of a fixed number of words (if it is word addressable). The Pages are represented by the Virtual Address generated by the CPU. These Pages are mapped to the Physical Address by the MMU. So, to help in this mapping we use the concept of Pa
3 min read
RTL (Register Transfer Level) design vs Sequential logic design
In this article we try to explain the fundamental differences between Register Transfer Level (RTL) Design and Sequential Logic Design. In the RTL Design methodology different types of registers such as Counters, Shift Register, SIPO (Serial In Parallel Out), PISO (Parallel In Serial Out) are used as the basic building blocks for any Sequential Log
4 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
Relationship between User level thread and Kernel level thread
Introduction: User-level threads and kernel-level threads are two different approaches to implementing thread management in an operating system. User-level threads are managed entirely by the application, without any involvement from the operating system kernel. The application manages the creation, scheduling, and synchronization of threads, using
9 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
Fuzzy Logic | Introduction
The term fuzzy refers to things that are not clear or are vague. In the real world many times we encounter a situation when we can't determine whether the state is true or false, their fuzzy logic provides very valuable flexibility for reasoning. In this way, we can consider the inaccuracies and uncertainties of any situation. Fuzzy Logic is a form
5 min read
Fuzzy Logic | Set 2 (Classical and Fuzzy Sets)
Prerequisite : Fuzzy Logic | Introduction In this post, we will discuss classical sets and fuzzy sets, their properties and operations that can be applied on them. Set: A set is defined as a collection of objects, which share certain characteristics. Classical set Classical set is a collection of distinct objects. For example, a set of students pas
2 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
Artificial Intelligence - Temporal Logic
Introduction: Temporal logic is a subfield of mathematical logic that deals with reasoning about time and the temporal relationships between events. In artificial intelligence, temporal logic is used as a formal language to describe and reason about the temporal behavior of systems and processes. Temporal logic extends classical propositional and f
7 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