Unit 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

DIGITAL LOGIC AND DESIGN BY ER.

SANTOSH KUMAR SHAH

Unit 2: Digital Design Fundamentals


Binary Digits
Each of the two digits in the binary system, 1 and 0, is called a bit, which is a contraction of the
words binary digit. In digital circuits, two different voltage levels are used to represent the two
bits. Generally, 1 is represented by the higher voltage, which we will refer to as a HIGH, and a 0
is represented by the lower voltage level, which we will refer to as a LOW.

Another system in which a 1 is represented by a LOW and a 0 is represented by a HIGH is called


negative logic.
Groups of bits (combinations of 1s and 0s), called codes, are used to represent numbers, letters,
symbols, instructions, and anything else required in a given application.
Logic Operations
An electronic circuit that operates on binary data is called a digital logic system. The circuits within the
system that carry out the elementary logical operations are called gates.

Three general tyoes of logic system can be udentified, namely :

i. Combinational logic system

ii. Sequential logic system

iii. Storage system

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.

i. Combinational Logic System

1. In this output depends only upon present input.


2. Speed is fast.
3. It is designed easy.
4. There is no feedback between input and output.

1
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH

5. This is time independent.


6. Elementary building blocks: Logic gates
7. Used for arithmetic as well as Boolean operations.
8. Combinational circuits don’t have capability to store any state.
9. As combinational circuits don’t have clock, they don’t require triggering.
10. These circuits do not have any memory element.
11. It is easy to use and handle.

Examples – Encoder, Decoder, Multiplexer, Demultiplexer

Block Diagram –

ii. Sequential Logic System

• In this output depends upon present as well as past input.


• Speed is slow.
• It is designed tough as compared to combinational circuits.
• There exists a feedback path between input and output.
• This is time dependent.
• Elementary building blocks: Flip-flops
• Mainly used for storing data.
• Sequential circuits have capability to store any state or to retain earlier state.
• As sequential circuits are clock dependent, they need triggering.
• These circuits have memory element.
• It is not easy to use and handle.

Examples – Flip-flops, Counters

Block Diagram –

Note: - https://computationstructures.org/lectures/sequential/sequential.html

2
DIGITAL LOGIC AND DESIGN BY ER. SANTOSH KUMAR SHAH

iii. Storage System

Logic Levels

The voltages used to represent a 1 and a 0 are called logic levels.


Ideally, one voltage level represents a HIGH and another voltage
level represents a LOW. In a practical digital circuit, however, a
HIGH can be any voltage between a specified minimum value and
a specified maximum value. Likewise, a LOW can be any voltage
between a specified minimum and a specified maximum. There
can be no overlap between the accepted range of HIGH levels
and the accepted range of LOW 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.

A System Using Digital and Analog Methods


The compact disk (CD) player is an example of a system in which both digital and analog circuits are used. The
simplified block diagram in Figure 1–4 illustrates the basic principle. Music in digital form is stored on the compact
disk. A laser diode optical system picks up the digital data from the rotating disk and transfers it to the digital-to-
analog converter (DAC). The DAC changes the digital data into an analog signal that is an electrical reproduction of
the original music. This signal is amplified and sent to the speaker for you to enjoy. When the music was originally
recorded on the CD, a process, essentially the reverse of the one described here, using an analog-to-digital converter
(ADC) was used.

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 Logic Gate

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 Logic Gate

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:

Y = Ā (read as Y equals NOT A)

It means that Y is an inversion of A.

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.

• If switch A is open (A = 0), the bulb will glow (Y = 1).


• If switch is closed (A = 1), the current finds an easier path through R. Hence it does not
flow through the bulb and so the bulb will not glow (Y = 0).

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 Logic 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 Logic Gate

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

• When either A alone is closed (A = 1, B = 0) or B alone is closed (A = 0, B = 1) or both


A and B are closed (A = 1, B = 1), the current always finds an easier path to flow. Hence
it does not flow through the bulb and so the bulb does not glow (Y = 0). This illustrates
the second, third and fourth row of the truth table.

EX-OR Gate (XOR)

• 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

EX-NOR Gate (XNOR)

• 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.

NAND Gate As A Universal Gate

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.

NOR Gate As A Universal Gate

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

You might also like