Unit 2
Unit 2
Unit 2
Any logic system can be represented by a black box, having a set of input lines that receive binary data,
one or more output lines as shown in fig. 2.1.
1
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
Block Diagram –
Block Diagram –
Note: - https://computationstructures.org/lectures/sequential/sequential.html
2
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
Logic Levels
Figure 1–6 illustrates the general range of LOWs and HIGHs for
a digital circuit. The variable VH(max) represents the maximum
HIGH voltage value, and VH(min) represents the minimum
HIGH voltage value. The maximum LOW voltage value is
3
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
represented by VL(max), and the minimum LOW voltage value is represented by VL(min). The
voltage values between VL(max) and VH(min) are unacceptable for proper operation. A voltage
in the unacceptable range can appear as either a HIGH or a LOW to a given circuit.
For example, the HIGH input values for a certain type of digital circuit technology called CMOS
may range from 2 V to 3.3 V and the LOW input values may range from 0 V to 0.8 V. If a voltage
of 2.5 V is applied, the circuit will accept it as a HIGH or binary 1. If a voltage of 0.5 V is applied,
the circuit will accept it as a LOW or binary 0. For this type of circuit, voltages between 0.8 V and
2 V are unacceptable.
Digital Waveforms
Digital waveforms consist of voltage levels that are changing back and forth between the HIGH and LOW levels or
states. Figure 1–7(a) shows that a single positive-going pulse is generated when the voltage (or current) goes from its
normally LOW level to its HIGH level and then back to its LOW level. The negative-going pulse in Figure 1.7(b) is
generated when the voltage goes from its normally HIGH level to its LOW level and back to its HIGH level. A digital
waveform is made up of a series of pulses.
4
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
Logic Gates
The basic digital electronic circuit that has one or more inputs and single output is known as
Logic gate. Hence, the Logic gates are the building blocks of any digital system. We can classify
these Logic gates into the following three categories.
• Basic gates
• Universal gates
• Derived gates
Truth table
A logic gate may have one or more inputs, but only one output. The relation between the
possible values of input and output signals are expressed in a table which is called the “truth
table”.
Thus, the truth table of a logic gate is a table that shows all possible input
combinations and the corresponding outputs for the logic gate.
Basic Gates
Basic logic gates are the fundamental logical operations from which all the functions no matter
how complex can be derived. AND, OR and NOT are the three main basic gates which are
massively used in digital systems.
The OR Logic Gate
The OR gate is a device that has two (or more) input variables A and B and one output variable
Y. The Boolean expression for the OR gate is:
A+B=Y
The possible combinations of the input A and B and the output Y of the OR gate can be
illustrated with the help of an electrical circuit shown in Figure.
In this circuit, two switches A and B (inputs) are connected in parallel with a battery and a bulb
Y (output).
The opening and closing of the switches A and B correspond to binary numbers 0 and 1
respectively. Similarly, if the bulb remains OFF, the output Y is 0; if it glows, the output Y
is 1.
5
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
• If both switches are open (A = 0, B = 0) the bulb will not glow (Y = 0).
• If switch A is open and B is closed (A = 0, B =1) the bulb will glow (Y = 1).
• If switch A is closed and B is open (A = 1, B =0) the bulb will glow (Y = 1).
• If both switches are closed (A = 1, B = 1) the bulb will glow (Y= 1).
These possible combinations of A, B and Y are shown in Figure in the form of a table which is
the truth table of OR logic gate.
Therefore, the working of the OR gate can be stated as: the output Y will be 1 when the input
A or B or both are 1.
6
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
The AND gate is also a two-input and one-output logic gate. Its Boolean expression is as
follows:
A*B = Y
The possible combinations of the inputs A and B and the output Y of the AND logic gate can be
illustrated with the help of the electric circuit shown in Figure.
In this circuit, two switches A and B (inputs) are connected in series with a battery and a bulb Y
(output). The working of circuit is as follows:
• If both switches are open (A = 0, B = 0) the bulb will not glow (Y = 0).
• If switch A is open and B is closed (A = 0, B = 1) the bulb will not glow (Y = 0).
• If switch A is closed and B is open (A = 1, B =0) the bulb will not glow (Y = 0).
• If both switches are closed (A = 1, B = 1) the bulb will glow (Y = 1).
7
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
These possible combinations of A, B and shown in Figure in the form of a table which is the
truth table of AND logic gate.
Therefore, the working of the AND gate can be stated as: the output Y will be 1 when both the
inputs A and B are 1 otherwise Y will be zero.
The not gate has only one input and the one output. It combines the input A with the output Y
according to the Boolean expression:
The logic symbol of the NOT gate is shown in Figure. The possible combinations of the input A
and the output Y of the NOT gate can be illustrated with the help of the electric circuit shown in
Figure. In this circuit, a switch A (input), a battery and a bulb Y (output) is connected as shown
in Figure.
8
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
Derived Gates
The logic gates which are derived from the basic gates such as AND, OR, NOT gates are called
derived gates. These derived gates have their own unique Symbols, Truth Tables and Boolean
Expressions.
Here we will explore the most common derived gates such as NAND Gate, NOR Gate, EX-OR
Gate, and EX-NOR Gate.
The NAND gate is a combination of AND and NOT gates. If the output of AND gate is
connected to the input of NOT gate as shown in Figure, the gate so obtained is called NAND
gate.
The NAND gate truth table can be illustrated by a simple circuit consisting of two switches A
and B, a battery and a bulb Y connected as shown in Figure. A small resistance R is added to
limit the current when both switches are closed.
• When the switches A and B both are open ( A = 0, B = 0), the bulb glows (Y = 1). This
illustrates the first row of the truth table.
• When either A alone is open (A = 0, B = 1) or B alone is open (A = 1, B = 0), the bulb
glows (Y = 1). This illustrates the second and third row of the truth table.
9
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
• If both A and B are closed (A = 1, B = 1) the current finds an easier path through R, A
and B and hence the bulb does not glow (Y = 0). This illustrates the fourth row of the
table.
The NAND output is an inverse of AND output. This means that an input giving 1 output in
AND gate will give zero output in NAND gate and vice-versa.
For example, in AND gate, the output Y is 1 only when both A and B are 1, but in NAND gate,
Y will be zero for such a case. Similarly, when both inputs A and B are not simultaneously 1,
then output is 0 in AND gate but it is 1 in NAND gate.
The NAND gate is a universal gate because it can perform all logic operations of OR gate,
AND gate and NOT gate, as shown ahead.
The NOR gate is a combination of OR and NOT gates. If the output of OR gate is connected to
the input of NOT gate, as shown in Figure, the resulting gate is called the NOR gate.
10
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
The NOR gate truth table can be illustrated by a simple circuit shown in Figure.
• When the switches A and B both are open (A = 0, B = 0), the bulb glows (Y = 1). This
illustrates the first row of the truth table.
11
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
• Exclusive OR gate sometimes also known as XOR or EOR is an electronic circuit that
gives an output of 1 if either, but not both, of its two inputs, are 1. Otherwise, it gives
0.
• EX-OR operation is shown using an encircled plus sign.
• The logical diagram and the truth table for the two input EX-OR Gate.
EX-OR Gate
• Exclusive NOR gate is also known as XNOR Gate is an electronic circuit that works the
opposite to the EX-OR gate.
• EX-NOR gate gives an output of 0 if either, but not both, of its two inputs, are 1.
Otherwise, it gives 1.
• EX-NOR operation is shown with a small circle on the output. The small circle represents
inversion.
• The logical diagram and the truth table for the two input EX-NOR Gate.
12
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
•
EX-NOR Gate
• So, that’s all for today. I hope you have gained some knowledge about the truth tables
and the logic gates.
Universal gates
A universal gate is a logic gate which can implement any Boolean function without the need to
use any other type of logic gate. The NOR gate and NAND gate are universal gates. This means
that you can create any logical Boolean expression using only NOR gates or only NAND gates.
In practice, this is advantageous since NOR and NAND gates are economical and easier to
fabricate than other logic gates. So much so that an AND gate is typically implemented as a NAND
gate followed by an inverter (not the other way around)! Similarly, an OR gate is typically realised
as a NOR gate followed by an inverter.
Other logical gates – such as AND gates, NOT gates and OR gates – do not have this property of
universality. Note that combined these three logic gates can implement all of the possible Boolean
switching functions, but not individually. Hence unlike the NOR and NAND logic gates, they are
not classified as universal gates.
Now we will look at the operation of NOR gates and NAND gates as universal gates.
The below diagram is of a two-input NAND gate. The first part is an AND gate and the second
part is a dot after it represents a NOT gate.
13
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
During the operation of the NAND gate, the inputs are first going through AND gate and after
that, the output gets reversed, and we get the final output. Now we will look at the truth table of
NAND gate.
We will consider the truth table of the above NAND gate i.e. a two-input NAND gate. The two
inputs are A and B.
Now we will see how this gate can be used to make other gates.
This is the circuit diagram of a NAND gate used to make work like a NOT gate, the original
logic gate diagram of NOT gate is given besides the circuit diagram below.
The above diagram is of an OR gate made from combinations of NAND gates, arranged in a
proper manner. The truth table of an OR gate is also given beside the diagram.
14
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH
Now we will see the design of an AND gate from NAND gates.
The above diagram is of an AND gate made from NAND gate. So we can see that all the three
basic gates can be made by only using NAND gates, that’s why this gate is called Universal
Gate, and it is appropriate.
We have seen how the NAND gate can be used to make all the three basic gates by using that
alone. Now we will discuss the same in case of NOR gate.
The above diagram is of an OR gate made by only using NOR gates. The output of this gate is
exactly similar to that of a single OR gate. We can see the circuit arrangement of OR gate using,
NOR gate is similar to that of AND gate using NAND gates.
The above diagram as the name suggests is of AND gate using only NOR gate, again we can see
that the circuit diagram of AND gate using only NOR gate is exactly similar to that of OR gate
using only NAND gates. Now we will finally see how we can make a NOT gate by using only
NOR gates.
The above diagram is of a NOT gate made by using a NOR gate. The circuit diagram is similar
to that of NOT gate made by using only NAND gate.
So, from the above discussion, it is clear that all the three basic gates (AND, OR, NOT) can be
made by only using NOR gate. And thus, it can be aptly termed as Universal Gate.
15