LAB 10
Fundamentals of Digital Systems Using Logic Gates
Objectives:
By the end of this lab, students will be able to:
a) Understand the concept of digital signals and distinguish between logic high (1) and logic low
(0).
b) Identify and explain the working of basic logic gates.
c) Analyze the behavior of digital circuits using truth tables.
d) Understand the role of logic gates as basic building blocks of digital systems.
e) Design and verify simple combinational digital circuits using logic gates.
Theory:
Introduction:
Digital systems form the backbone of modern electronic devices such as computers, mobile
phones, washing machines, and communication systems. Unlike analog systems that operate
over a continuous range of values, digital systems operate using only two discrete voltage levels,
known as Logic Low (0) and Logic High (1). These two states represent binary information,
which is the fundamental language of digital electronics.
The most basic elements used to process these binary signals are called logic gates. A logic gate
is an electronic circuit that takes one or more binary inputs and produces a single binary output
based on a specific logical operation. Common examples include AND, OR, and NOT gates.
Logic gates serve as the fundamental building blocks of all digital systems. By combining
different logic gates in various ways, complex digital circuits and systems can be designed, such
as arithmetic units, memory devices, and control units. We can classify these logic gates into the
following three categories.
Basic gates
Universal gates
Special gates
Basic Gates:
These basic gates form the foundation for designing all complex digital systems such as
computers, mobile phones, and control circuits. Among all logic gates, the AND, OR, and NOT
gates are the most basic and widely used.
The AND gate produces an output of 1 only when all its inputs are 1. If any input is 0, the output
will be 0. It is commonly used in situations where multiple conditions must be true at the same
time. The logical AND is represented with the symbol ‘.’.
The following table shows the truth table of 2-input AND gate.
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
In the table A, B are the inputs and Y is the output of two inputs. If both inputs are ‘1’, then
only the output, Y is ‘1’. For remaining combinations of inputs, the output, Y is ‘0’.
The following figure shows the symbol of an AND gate, which is having two inputs A, B and
one output, Y.
Th
e OR gate produces an output of 1 when at least one of its inputs is 1. The output is 0 only when
all inputs are 0. It is used when any one of several conditions being true is enough. The logical
OR is represented with the symbol ‘+’.
The following table shows the truth table of 2-input OR gate.
A B Y=A+B
0 0 0
0 1 1
1 0 1
1 1 1
In the table A, B are the inputs and Y is the output of two inputs. If both inputs are ‘0’, then
only the output, Y is ‘0’. For remaining combinations of inputs, the output, Y is ‘1’.
The following figure shows the symbol of an OR gate, which is having two inputs A, B and one
output, Y.
Th
e NOT gate has only one input and produces the opposite (inverted) output. If the input is 1, the
output becomes 0, and if the input is 0, the output becomes 1. It is also called an inverter.
The following table shows the truth table of NOT gate.
A Y = A’
0 1
1 0
In the table A, Y are the input and output of NOT gate respectively. If the input, A is ‘0’, then
the output, Y is ‘1’. Similarly, if the input, A is ‘1’, then the output, Y is ‘0’.
The following figure shows the symbol of NOT gate, which is having one input, A and one
output, Y.
Un
iversal Gates:
NAND & NOR gates are known as universal gates. Because we can implement any Boolean
function, which is in ‘Sum of Products’ form by using NAND gates alone. Similarly, we can
implement any Boolean function, which is in product of sums form by using NOR gates alone.
NAND gate is a digital circuit that has two or more inputs and produces an output, which is
the inversion of logical AND of all those inputs.
The following table shows the truth table of 2-input NAND gate.
A B Y = (A.B)’
0 0 1
0 1 1
1 0 1
1 1 0
Here A, B are the inputs and Y is the output of two inputs. When both inputs are ‘1’, the output,
Y is ‘0’. If at least one of the input is ‘0’, then the output, Y is ‘1’. This is just opposite to that
of two input AND gate operation.
The following figure shows the symbol of NAND gate, which is having two inputs A, B and
one output, Y.
NOR gate is a digital circuit that has two or more inputs and produces an output, which is
the inversion of logical OR of all those inputs.
The following table shows the truth table of 2-input NOR gate.
A B Y = (A+B)’
0 0 1
0 1 0
1 0 0
1 1 0
Here A, B are the inputs and Y is the output. If both inputs are ‘0’, then the output, Y is ‘1’. If at
least one of the input is ‘1’, then the output, Y is ‘0’. This is just opposite to that of two input
OR gate operation.
The following figure shows the symbol of NOR gate, which is having two inputs A, B and one
output, Y.
Sp
ecial Gates:
Ex-OR and Ex-NOR gates are called as special gates. Because, these two gates are special cases
of OR and NOR gates.
The full form of Ex-OR gate is Exclusive-OR gate. Its function is same as that of OR gate
except for some cases. The output of Ex-OR gate is ‘1’, when odd number of ones are present at
the inputs. Hence, the output of Ex-OR gate is also called as an odd function.
The following table shows the truth table of 2-input Ex-OR gate.
A B Y = A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
Here A, B are the inputs and Y is the output of two inputs. The truth table of Ex-OR gate is
same as that of OR gate for first three rows. The only modification is in the fourth row. That
means, the output Y is zero instead of one, when both the inputs are one, since the inputs having
even number of ones.
Therefore, the output of Ex-OR gate is ‘1’, when only one of the two inputs is ‘1’. And it is ‘0’,
when both inputs are same.
Below figure shows the symbol of Ex-OR gate, which is having two inputs A, B and one
output, Y.
The full form of Ex-NOR gate is Exclusive-NOR gate. Its function is same as that of NOR gate
except for some cases. The output of Ex-NOR gate is ‘1’, when even number of ones are
present at the inputs. Hence, the output of Ex-NOR gate is also called as an even function.
The following table shows the truth table of 2-input Ex-NOR gate.
A B Y = A⊙B
0 0 1
0 1 0
1 0 0
1 1 1
Here A, B are the inputs and Y is the output. The truth table of Ex-NOR gate is same as that of
NOR gate for first three rows. The only modification is in the fourth row. That means, the
output is ‘1’ instead of ‘0’, when both the inputs are one.
The following figure shows the symbol of Ex-NOR gate, which is having two inputs A, B and
one output, Y.
From the above truth tables of Ex-OR and Ex-NOR logic gates, we can easily notice that the
Ex-NOR operation is just the logical inversion of Ex-OR operation.
Two-level logic means that the maximum number of logic gate levels present between the input
and the output is two. This means that, regardless of the total number of logic gates used, the
maximum number of logic gates cascaded between any input and the output is limited to two. In
two-level logic, the outputs of the first-level logic gates are connected as inputs to the second-
level logic gates.
Consider the four logic gates AND, OR, NAND & NOR. Since, there are 4 logic gates, we will
get 16 possible ways of realizing two level logic. Those 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.
These two level logic realizations can be classified into the following two categories.
Degenerative form
Non-degenerative form
Degenerative Form:
If the output of a two-level logic realization can be obtained using a single logic gate, then it is
called a degenerative form. In this case, the number of inputs of the single logic gate increases,
which increases the fan-in of the gate. This reduction in the number of logic levels is an
advantage of the degenerative form, as it leads to faster operation and simpler hardware. Only 6
combinations of two level logic realizations out of 16 combinations come under degenerative
form. Those are AND-AND, AND-NAND, OR-OR, OR-NOR, NAND-NOR, NOR-NAND.
Assume, A, B, C & D are the inputs and Y is the output in each logic realization. The following
figure shows an example for AND-AND logic realization.
We will get the outputs of first level logic gates as Y1=A.B and Y2=C.D. These
outputs, Y1 and Y2 are applied as inputs of AND gate that is present in second level. So, the
output of this AND gate is
Y=Y1.Y2
Substitute Y1 and Y2 values in the above equation.
Y= (A.B).(C.D)
Therefore, the output of this AND-AND logic realization is A.B.C.D. This Boolean function
can be implemented by using a 4 input AND gate. Hence, it is degenerative form.
In this logic realization, AND gates are present in first level and NAND gate is present in
second level. The following figure shows an example for AND-NAND logic realization.
Previously, we got the outputs of first level logic gates as Y1=A.B and Y2=C.D. These outputs,
Y1 and Y2 are applied as inputs of NAND gate that is present in second level. So, the output of
this NAND gate is
Y= (Y1.Y2)′
Substitute Y1 and Y2 values in the above equation.
Y= ((AB).(CD))′
Therefore, the output of this AND-NAND logic realization is (A.B.C.D)′. This Boolean
function can be implemented by using a 4 input NAND gate. Hence, it is degenerative form.
In this logic realization, OR gates are present in both levels. The following figure shows an
example for OR-OR logic realization.
We will get the outputs of first level logic gates as Y1=A+B and Y2=C+D. These
outputs, Y1 and Y2 are applied as inputs of OR gate that is present in second level. So, the
output of this OR gate is
Y=Y1+Y2
Substitute Y1 and Y2 values in the above equation.
Y=( A+B)+(C+D)
Therefore, the output of this OR-OR logic realization is A+B+C+D. This Boolean function can
be implemented by using a 4 input OR gate. Hence, it is degenerative form. Similarly, you can
verify whether the remaining realizations belong to this category or not.
Non-degenerative Form
If the output of two level logic realization cannot be obtained by using single logic gate, then it
is called as non-degenerative form.
The remaining 10 combinations of two level logic realizations come under non-degenerative
form. Those are AND-OR, AND-NOR, OR-AND, OR-NAND, NAND-AND, NAND-OR,
NAND-NAND, NOR-AND, NOR-OR, NOR-NOR. Now, let us discuss some realizations.
Assume, A, B, C & D are the inputs and Y is the output in each logic realization.
In this logic realization, AND gates are present in first level and OR gate is present in second
level. Below figure shows an example for AND-OR logic realization.
Previously, we got the outputs of first level logic gates as Y1=A.B and Y2=C.D. These outputs,
Y1 and Y2 are applied as inputs of OR gate that is present in second level. So, the output of this
OR gate is
Y=Y1+Y2
Substitute Y1 and Y2 values in the above equation
Y=(A.B)+(C.D)
Therefore, the output of this AND-OR logic realization is (A.B)+(C.D). This Boolean function
is in ‘Sum of Products’ form. Since, we cannot implement it by using single logic gate, this
AND-OR logic realization is a non-degenerative form.
In this logic realization, AND gates are present in first level and NOR gate is present in second
level. The following figure shows an example for AND-NOR logic realization.
We know the outputs of first level logic gates as Y1=A.B and Y2=C.D.
These outputs, Y1 and Y2 are applied as inputs of NOR gate that is present in second level. So,
the output of this NOR gate is
Y=(Y1+Y2)′
Substitute Y1 and Y2 values in the above equation.
Y=((A.B)+(C.D))′
Therefore, the output of this AND-NOR logic realization is ((A.B)+(C.D))′. This Boolean
function is in AND-OR-Invert form. Since, we cannot implement it by using single logic gate,
this AND-NOR logic realization is a non-degenerative form.
In this logic realization, OR gates are present in first level and AND gate is present in second
level. The following figure shows an example for OR-AND logic realization.
Previously, we got the outputs of first level logic gates as Y1= A+B and Y2= C+D. These
outputs, Y1 and Y2 are applied as inputs of AND gate that is present in second level. So, the
output of this AND gate is
Y=Y1Y2
Substitute Y1 and Y2 values in the above equation.
Y=( A+B).(C+D)
Therefore, the output of this OR-AND logic realization is (A+B).(C+D). This Boolean function
is in ‘Product of Sums’ form. Since, we cannot implement it by using single logic gate, this OR-
AND logic realization is a non-degenerative form.
Combinational circuits consist of logic gates. These circuits operate with binary values. The
outputs of combinational circuit depend on the combination of present inputs. The following
figure shows the block diagram of combinational circuit.
This combinational circuit has ‘n’ input variables and ‘m’ outputs. Each combination of input
variables will affect the outputs. Combinational circuits are constructed using basic logic gates
such as:
AND Gate: performs logical multiplication.
OR Gate: performs logical addition.
NOT Gate: performs inversion.
Other derived gates such as NAND, NOR, XOR, and XNOR are also commonly used.
Combinational circuits are used in:
Adders and subtractors
Multiplexers and demultiplexers
Encoders and decoders
Digital comparators
Arithmetic Logic Units (ALU)
Lab Task:
1. Using the circuit diagrams provided in the figures of the degenerative and non-degenerative
forms sections, design the truth tables for the 4-variable inputs with A = 1, B = 0, C = 1, and
D = 0.
Answer: