UNIT IV
DIGITAL
ELECTRONICS
1
Boolean Algebra
• Boolean algebra is a mathematical system for
the manipulation of variables that can have
one of two values.
– In formal logic, these values are “true” and “false.”
– In digital systems, these values are “on” and “off,”
1 and 0, or “high” and “low.”
• Boolean expressions are created by
performing operations on Boolean variables.
– Common Boolean operators include AND, OR, and
NOT.
2
Boolean Algebra
• A Boolean operator can be
completely described using a
truth table.
• The truth table for the Boolean
operators AND and OR are
shown at the right.
• The AND operator is also known
as a Boolean product. The OR
operator is the Boolean sum.
3
3.2 Boolean Algebra
• The truth table for the
Boolean NOT operator is
shown at the right.
• The NOT operation is most
often designated by an
overbar. It is sometimes
indicated by a prime mark
( ‘ ) or an “elbow” ().
4
3.2 Boolean Algebra
• A Boolean function has:
• At least one Boolean variable,
• At least one Boolean operator, and
• At least one input from the set {0,1}.
• It produces an output that is also a member of
the set {0,1}.
Now you know why the binary numbering
system is so handy in digital systems.
5
3.2 Boolean Algebra
• Digital computers contain circuits that implement
Boolean functions.
• The simpler that we can make a Boolean function,
the smaller the circuit that will result.
– Simpler circuits are cheaper to build, consume less
power, and run faster than complex circuits.
• With this in mind, we always want to reduce our
Boolean functions to their simplest form.
• There are a number of Boolean identities that help
us to do this.
6
3.3 Logic Gates
• We have looked at Boolean functions in abstract
terms.
• In this section, we see that Boolean functions are
implemented in digital computer circuits called gates.
• A gate is an electronic device that produces a result
based on two or more input values.
– In reality, gates consist of one to six transistors, but digital
designers think of them as a single unit.
– Integrated circuits contain collections of gates suited to a
particular purpose.
7
3.3 Logic Gates
• The three simplest gates are the AND, OR, and NOT
gates.
• They correspond directly to their respective Boolean
operations, as you can see by their truth tables.
8
3.3 Logic Gates
• Another very useful gate is the exclusive OR
(XOR) gate.
• The output of the XOR operation is true only when
the values of the inputs differ.
Note the special symbol
for the XOR operation.
9
3.3 Logic Gates
• NAND and NOR
are two very
important gates.
Their symbols and
truth tables are
shown at the right.
10
3.3 Logic Gates
• NAND and NOR
are known as
universal gates
because they are
inexpensive to
manufacture and
any Boolean
function can be
constructed using
only NAND or only
NOR gates.
11
3.3 Logic Gates
• Gates can have multiple inputs and more than
one output.
– A second output can be provided for the complement
of the operation.
– We’ll see more of this later.
12
Combinational circuits are defined as the time independent circuits which do
not depends upon previous inputs to generate any output are termed as
combinational circuits.
Sequential circuits are those which are dependent on clock cycles and depends
on present as well as past inputs to generate any output.
13
14
Combinational Logic Circuits Sequential Logic Circuits
Output is a function of clock, present
Output is a function of the present inputs
inputs and the previous states of the
(Time Independent Logic).
system.
Have memory to store the present states
Do not have the ability to store data (state). that is sent as control input (enable) for the
next operation.
It does not require any feedback. It simply It involves feedback from output to input
outputs the input according to the logic that is stored in the memory for the next
designed. operation.
Used mainly for Arithmetic and Boolean Used for storing data (and hence used in
operations. RAM).
Logic gates are the elementary building Flip flops (binary storage device) are the
blocks. elementary building unit.
Independent of clock and hence does not Clocked (Triggered for operation with
require triggering to operate. electronic pulses).
Example: Counter [Previous O/P
Example: Adder [1+0=1; Dependency only
+1=Current O/P; Dependency on present
on present inputs i.e., 1 and 0].
input as well as previous state].
15
HALF ADDER
&
FULL ADDER
16
An adder is a digital logic circuit in electronics that implements addition of
numbers. In many computers and other types of processors, adders are used to
calculate addresses, similar operations and table indices in the ALU and also in other
parts of the processors. These can be built for many numerical representations like
excess-3 or binary coded decimal. Adders are classified into two types: half adder and
full adder. The half adder circuit has two inputs: A and B, which add two input digits
and generate a carry and sum. The full adder circuit has three inputs: A and C, which
add the three input numbers and generate a carry and sum. This article gives brief
information about half adder and full adder in tabular forms and circuit diagrams. 17
An adder is a digital circuit that performs addition of numbers. The half
adder adds two binary digits called as augend and addend and produces two outputs
as sum and carry; XOR is applied to both inputs to produce sum and AND gate is
applied to both inputs to produce carry. The full adder adds 3 one bit numbers, where
two can be referred to as operands and one can be referred to as bit carried in. And
Full Adder
produces 2-bit output, and these can be referred to as output carry and sum.
This adder is difficult to implement than a half-adder. The difference between a half-adder
and a full-adder is that the full-adder has three inputs and two outputs, whereas half
adder has only two inputs and two outputs. The first two inputs are A and B and the third
input is an input carry as C-IN. When a full-adder logic is designed, you string eight of them
18
19
3.5 Combinational Circuits
• As we see, the sum can be
found using the XOR
operation and the carry
using the AND operation.
20
3.5 Combinational Circuits
• We can change our half
adder into to a full adder
by including gates for
processing the carry bit.
• The truth table for a full
adder is shown at the
right.
21
3.5 Combinational Circuits
• How can we change the
half adder shown below
to make it a full adder?
22
3.5 Combinational Circuits
• Here’s our completed full adder.
23
3.5 Combinational Circuits
• Just as we combined half adders to make a full
adder, full adders can connected in series.
• The carry bit “ripples” from one adder to the next;
hence, this configuration is called a ripple-carry
adder.
Today’s systems employ more efficient adders.
24
ENCODER
&
DECODER
25
An Encoder is a combinational circuit that performs the reverse operation of
Decoder. It has maximum of 2n input lines and ‘n’ output lines. It will produce a binary
code equivalent to the input, which is active High. Therefore, the encoder encodes
2n input lines with ‘n’ bits. It is optional to represent the enable signal in encoders.
26
4 : 2 Encoder
The 4 to 2 Encoder consists of four inputs Y3, Y2, Y1 & Y0 and two outputs A1
& A0. At any time, only one of these 4 inputs can be ‘1’ in order to get the respective
binary code at the output. The figure below shows the logic symbol of 4 to 2 encoder :
27
The Truth table of 4 to 2 encoder is as follows :
Logical expression for A1 and A0 :
A1 = Y3 + Y2
A0 = Y3 + Y1
28
The above two Boolean functions A1 and A0 can be implemented using two
input OR gates :
29
8 : 3 Encoder (Octal to Binary) –
The 8 to 3 Encoder or octal to Binary encoder consists of 8 inputs : Y7 to Y0
and 3 outputs : A2, A1 & A0. Each input line corresponds to each octal digit
and three outputs generate corresponding binary code.
The figure below shows the logic symbol of octal to binary encoder:
30
The truth table for 8 to 3 encoder is as follows :
31
Logical expression for A2, A1 and A0 :
A2 = Y7 + Y6 + Y5 + Y4
A1 = Y7 + Y6 + Y3 + Y2
A0 = Y7 + Y5 + Y3 + Y1
The above two Boolean functions A2, A1 and A0 can be implemented using four input
OR gates :
32
Decimal to BCD Encoder –
The decimal to binary encoder usually consists of 10 input lines and 4 output
lines. Each input line corresponds to the each decimal digit and 4 outputs
correspond to the BCD code. This encoder accepts the decoded decimal data as
an input and encodes it to the BCD output which is available on the output lines.
The figure below shows the logic symbol of decimal to BCD encoder :
33
34
35
36
37
A decoder does the opposite job of an encoder. It is a combinational circuit that
converts n lines of input into 2n lines of output.
Let’s take an example of 3-to-8 line decoder.
38
39
HENCE
40
3.5 Combinational Circuits
• Decoders are another important type of
combinational circuit.
• Among other things, they are useful in selecting a
memory location according a binary value placed
on the address lines of a memory bus.
• Address decoders with n inputs can select any of 2n
locations.
This is a block
diagram for a
decoder.
41
MULTIPLEXUR
&
DEMULTIPLEXUR
42
In the large-scale-digital systems, a single line is required to carry on two
or more digital signals – and, of course! At a time, one signal can be placed on the
one line. But, what is required is a device that will allow us to select; and, the signal
we wish to place on a common line, such a circuit is referred to as multiplexer.
The function of a multiplexer is to select the input of any ‘n’ input lines and
feed that to one output line. The function of a de-multiplexer is to inverse the
function of the multiplexer and the shortcut forms of the multiplexer. The de-
multiplexers are mux and demux. Some multiplexers perform both multiplexing and
43
44
A multiplexer is a circuit that accept many input but give only one
output. A demultiplexer function exactly in the reverse of a multiplexer, that is
a demultiplexer accepts only one input and gives many outputs. Generally
multiplexer and demultiplexer are used together, because of the communication
Mutliplexer:
systems are bi directional.
Multiplexer means many into one. A multiplexer is a circuit used to
select and route any one of the several input signals to a signal output. An
simple example of an non electronic circuit of a multiplexer is a single pole
45
multiposition switch.
Multiposition switches are widely used in many electronics circuits. However
circuits that operate at high speed require the multiplexer to be automatically
selected. A mechanical switch cannot perform this task satisfactorily.
Therefore, multiplexer used to perform high speed switching are constructed
Multiplexer handle two type of data that is analog and digital. For analog
of electronic components.
application, multiplexer are built of relays and transistor switches. For digital
application, they are built from standard logic [Link] multiplexer used for
digital applications, also called digital multiplexer, is a circuit with many input but
only one output. By applying control signals, we can steer any input to the output. 46
Following figure shows the general idea of a multiplexer with n input signal, m
control signals and one output signal.
47
four input bits are D0,D1,D2 and D3. only one of this is transmitted to the output y.
The output depends on the value of AB which is the control input. The control input
determines which of the input data bit is transmitted to the output.
48
Applications of Multiplexer:
Multiplexer are used in various fields where multiple data need to be transmitted
using a single line.
Communication system – Communication system is a set of system that enable
communication like transmission system, relay and tributary station, and
communication network. The efficiency of communication system can be increased
considerably using multiplexer. Multiplexer allow the process of transmitting
different type of data such as audio, video at the same time using a single
transmission line. 49
Telephone network – In telephone network, multiple audio signals are integrated
on a single line for transmission with the help of multiplexers. In this way,
multiple audio signals can be isolated and eventually, the desire audio signals
reach the intended recipients.
Computer memory – Multiplexers are used to implement huge amount of
memory into the computer, at the same time reduces the number of copper lines
required to connect the memory to other parts of the computer circuit.
Transmission from the computer system of a satellite – Multiplexer can be
50
Demultiplexer:
Demultiplexer means one to many. A demultiplexer is a circuit with one input
and many output. By applying control signal, we can steer any input to the
output. Few types of demultiplexer are 1-to 2, 1-to-4, 1-to-8 and 1-to 16
demultiplexer.
Following figure illustrate the general idea of a demultiplexer with 1 input
signal, m control signals, and n output signals.
51
Understanding 1- to-4 Demultiplexer:
The 1-to-4 demultiplexer has 1 input bit, 2 control bit, and 4 output bits. An
example of 1-to-4 demultiplexer is IC 74155. The 1-to-4 demultiplexer is shown
in figure below
52
53
The input bit is labelled as Data D. This data bit is transmitted to the data bit of the
output lines. This depends on the value of AB, the control input.
When AB = 01, the upper second AND gate is enabled while other AND gates are
disabled. Therefore, only data bit D is transmitted to the output, giving Y1 = Data.
If D is low, Y1 is low. IF D is high,Y1 is high. The value of Y1 depends upon the
value of D. All other outputs are in low state.
If the control input is changed to AB = 10, all the gates are disabled except the third
AND gate from the top. Then, D is transmitted only to the Y2 output, and Y2 =
54
APPLICATIONS
Demultiplexer is used to connect a single source to multiple destinations. The
main application area of demultiplexer is communication system where
multiplexer are used. Most of the communication system are bidirectional i.e.
they function in both ways (transmitting and receiving signals). Hence, for most of
the applications, the multiplexer and demultiplexer work in sync. Demultiplexer
are also used for reconstruction of parallel data and ALU circuits.
Communication System
55
Multiplexur & Demultiplexur types
2-1 multiplexer ( 1select line)
4-1 multiplexer (2 select lines)
8-1 multiplexer(3 select lines)
16-1 multiplexer (4 select lines)
Vice versa for demultiplexur
56
8-1 multiplexer
(3 select lines)
57
58
59
FLIP FLOP
60
A flip flop is an electronic circuit with two stable states that can be
used to store binary data. The stored data can be changed by applying varying
inputs. Flip-flops and latches are fundamental building blocks of digital
electronics systems used in computers, communications, and many other types
of systems. Flip-flops and latches are used as data storage elements. It is the
Flip flop v/s Latch
basic storage element in sequential logic.
The basic difference between a latch and a flip-flop is a gating or clocking
mechanism
61
Clock
• It is usually derived from an oscillator or other circuitry
that alternates its output between 1 and 0
• It is used to synchronize the flow of data in a digital
system
62
S-R Flip Flop
S R Q Q’
0 0 0 1
0 1 0 1
1 0 1 0
1 1 ∞ ∞
In this circuit diagram, the output is changed (i.e. the stored data is
changed) only when you give an active clock signal. Otherwise, even if the
S or R is active the data will not change. Let’s look at the types of flip-flops 63
There are majorly 4 types of flip flops, with the most common one
being SR flip flop. This simple flip flop circuit has a set input (S) and a reset
input (R). In this circuit when you Set “S” as active the output “Q” would be
high and “Q‘‘” will be low. Once the outputs are established, the wiring of the
circuit is maintained until “S” or “R” go high, or power is turned off. As shown
above, it is the simplest and the easiest to understand. The two outputs, as
shown above, are the inverse of each other. The truth table of SR Flip Flop is
highlighted below. 64
JK Flip-flop
Due to the undefined state in the SR flip flop, another flip flop is
required in electronics. The JK flip flop is an improvement on the SR flip flop
J K Q Q’
0 0 0 0
where S=R=1 is not a problem.
0 1 0 0
1 0 0 1
1 1 0 1
0 0 1 1
0 1 1 0
1 0 1 1
1 1 1 0
65
The input condition of J=K=1, gives an output inverting the output state.
However, the outputs are the same when one tests the circuit practically.
In simple words, If J and K data input are different (i.e. high and low) then
the output Q takes the value of J at the next clock edge. If J and K are both low
then no change occurs. If J and K are both high at the clock edge then the output
will toggle from one state to the other. JK Flip Flop can function as Set or Reset
Flip flop
66
D Flip Flop
D flip flop is a better alternative that is very popular with digital
electronics. They are commonly used for counters and shift-registers and input
synchronisation.
Clock D Q Q’
↓»0 0 0 1
↑»1 0 0 1
↓»0 1 0 1
↑»1 1 1 0
67
In a D flip flop, the output can be only changed at the clock edge, and if
the input changes at other times, the output will be unaffected. The change of
state of the output is dependent on the rising edge of the clock. The output (Q) is
same as the input and can only change at the rising edge of the clock.
68
T Flip Flop
A T flip flop is like JK flip-flop. These are basically a single input
version of JK flip flop. This modified form of JK flip-flop is obtained by
connecting both inputs J and K together. This flip-flop has only one input along
with the clock input. These flip-flops are called T flip-flops because of their
ability to complement its state (i.e.) Toggle, hence the name Toggle flip-flop.
69
T Q Q (t+1)
0 0 0
1 0 1
0 1 1
1 1 0
70
Applications of Flip-Flops
These are the various types of flip-flops being used in digital electronic circuits
and the applications of Flip-flops are as specified below.
Counters
Frequency Dividers
Shift Registers
Storage Registers
71
COUNTER
72
Counter is a device which stores (and sometimes displays) the number
of times a particular event or process has occurred, often in relationship to a
clock signal. Counters are used in digital electronics for counting purpose, they
can count specific event happening in the circuit. For example, in UP counter a
counter increases count for every rising edge of clock. Not only counting, a
counter can follow the certain sequence based on our design like any random
sequence 0,1,3,2… .They can also be designed with the help of flip flops.
Counters are broadly divided into two categories
73
Asynchronous Counter
In asynchronous counter we don’t use universal clock, only first flip
flop is driven by main clock and the clock input of rest of the following counters
is driven by output of previous flip flops. We can understand it by following
diagram-
74
It is evident from timing diagram that Q0 is changing as soon as the rising edge of clock pulse is
encountered, Q1 is changing when rising edge of Q0 is encountered(because Q0 is like clock pulse for
75
second flip flop) and so on. In this way ripples are generated through Q0,Q1,Q2,Q3 hence it is also
Synchronous Counter
Unlike the asynchronous counter, synchronous counter has one global
clock which drives each flip flop so output changes in parallel. The one
advantage of synchronous counter over asynchronous counter is, it can operate
on higher frequency than asynchronous counter as it does not have cumulative
delay because of same clock is given to each flip flop.
76
From circuit diagram we see that Q0 bit gives response to each falling edge of clock while
Q1 is dependent on Q0, Q2 is dependent on Q1 and Q0 , Q3 is dependent on Q2,Q1 and Q0.77
Flip flops can be used to store a single bit of binary data (1or 0).
However, in order to store multiple bits of data, we need multiple flip flops. N flip
flops are to be connected in an order to store n bits of data. A Register is a device
which is used to store such information. It is a group of flip flops connected in
series used to store multiple bits of data.
The information stored within these registers can be transferred with the
help of shift registers. Shift Register is a group of flip flops used to store multiple
bits of data. The bits stored in such registers can be made to move within the
78
The registers which will shift the bits to left are called
“Shift left registers”.
The registers which will shift the bits to right are called
“Shift right registers”.
Shift registers are basically of 4 types. These are:
[Link] In parallel Out shift register
[Link] In Serial Out shift register
[Link] In Serial Out shift register 79
Serial-In Serial-Out Shift Register (SISO)
Serial-In Parallel-Out shift Register (SIPO)
80
Parallel-In Serial-Out Shift Register (PISO)
81
Parallel-In Parallel-Out Shift Register (PIPO)
82