Unit 4-dld Notes (Pranalini)
Unit 4-dld Notes (Pranalini)
Combinational logic refers to circuits whose output is strictly depended on the present value of
the inputs. As soon as inputs are changed, the information about the previous inputs is lost, that
is, combinational logics circuits have no memory. Although every digital system is likely to have
combinational circuits, most systems encountered in practice also include memory elements,
which require that the system be described in terms of sequential logic. Circuits whose output
depends not only on the present input value but also the past input value are known as
sequential logic circuits. The mathematical model of a sequential circuit is usually referred to as
a sequential machine.
On the other hand in an unclocked or pulsed sequential circuit, such a clock is not present. Pulse
mode circuits require two consecutive transitions between 0 and 1 - that is a 0-pulseor a 1 pulse to alter
the circuit’s state. A pulse -mode circuit is designed to respond to pulses of certain duration; the constant
signals between the pulses are “null” or “spacer” signals, which do not affect the circuit’s behavior
Fig shows a block diagram of an asynchronous sequential circuit. It consists of a combinational circuit and delay
elements connected to form the feedback loops. The present state and next state variables in asynchronous
sequential circuits called secondary variables and excitation variables respectively.
When an input variable changes in value, the secondary variables, i.e. y1,y2,y3,..,yk do not change instantaneously.
The combinational circuit generates k excitation variables which give the next state of the circuit. The excitation
variables are propagated through delay elements to become the new present state for the secondary variables, i.e.
y1,y2,y3,..,yk. In steady state condition excitation and secondary variables are the same i.e. stable (yi=Yi), but during
transition they are different.
The input variables are considered as; there are two types of asynchronous circuits: fundamental mode
circuits and pulse mode circuits.
Latches and flip-flops are the basic elements for storing information. One latch or flip-
flop can store one bit of information. The main difference between latches and flip-flops is that
for latches, their outputs are constantly affected by their inputs as long as the enable signal is
asserted. In other words, when they are enabled, their content changes immediately when their
inputs change. Flip-flops, on the other hand, have their content change only either at the rising or
falling edge of the enable signal. This enable signal is usually the controlling clock signal. After
the rising or falling edge of the clock, the flip-flop content remains constant even if the input
changes.
A flip-flop (FF), known more formally as s bistable multivibrator, has two stable states. It
can remain in either of the states indefinitely. Its state can be changed by applying the proper
triggering signal. It is also called a binary or one-bit memory.
There are basically four main types of latches and flip-flops: S-R, D, J-K, and T. The
major differences in these flip-flop types are the number of inputs they have and how they
change state. For each type, there are also different variations that enhance their operations. In
this chapter, we will look at the operations of the various latches and flip-flops. The flip-flops
has two outputs, labeled Q and Q‘. The Q output is the normal output of the flip flop and Q‘ is
the inverted output.
S-R latch:
The latch has two outputs Q(HIGH(1) or LOW(0)) and Q‘(complement of Q) and two inputs labelled
S and R.
It can be constructed by:
using two NOR gates, an active-HIGH S-R latch and
using two NAND gates, an active-LOW S-R latch
NOR gate S-R latch (active-high S-R latch):
When the circuit is switched on the latch may enter into any state. If Q=1, then Q‘=0,
which is called SET state (i.e SET input is made HIGH). If Q=0, then Q‘=1, which is called
RESET state (i.e RESET input is made HIGH). Whether the latch is in SET state or RESET
state, it will continue to remain in the same state, as long as the power is not switched off. If
both the inputs S and R are made LOW, there is no change in the state of the latch (i.e) same
state in which it was, prior to the application of inputs. If both are HIGH, the output is
unpredictable.
NAND latch is the fundamental building block in constructing a flip-flop. It has the
property of holding on to any previous output, as long as it is not disturbed.
The operation of NAND latch is the reverse of the operation of NOR latch. If 0‘s are
replaced by 1‘s and 1‘s are replaced by 0‘s we get the same truth table as that of the NOR latch
The gated S-R latch: The gated S-R latch requires an ENABLE (EN) input. The S and R inputs will
control the state of the flip-flop only when the ENABLE is HIGH. The ENABLE input may be
clock. This type of flip-flop responds to the changes in inputs only as long as the clock is HIGH,
these types of flip-flops are called level triggered flip-flops.
Edge-Triggered flip-flop:
In synchronous systems, the exact times at which any output can change states are determined by a
signal commonly called the clock. The flip-flops using the clock signal are called the clocked flip-flops.
Clocked flip-flops may be positive edge-triggered or negative edge-triggered.
Positive edge-triggered flip-flops are those in which ‘state transitions’ take place only at the positive-
going (0 to 1, or LOW to HIGH) edge of the clock pulse and it is indicated by a ‘triangle’.
Negative edge-triggered flip-flops are those in which ‘state transitions’ take place only at the negative-
going (1 to 0, or HIGH to LOW) edge of the clock pulse and it is indicated by a ‘triangle’ with a bubble
at the clock terminal of the flip-flop.
There are three basic types: S-R, J-K, and D. D and J-K are mostly used. D and J-K are derived from S-
R flip-flop.
The momentary change in control input of a latch or flip-flop to switch it from one state to the
other is called trigger and the transition it causes is said to trigger the flip-flop.
The process of applying the control signal to change the state of a flip-flop is called triggering.
There are two types of triggering the flip-flops:
• Level triggering: The input signals affect the flip-flop only when the clock is at logic 1 level.
• Edge triggering: The input signals affect the flip-flop only if they are present at the positive going
or negative going edge of the clock pulse.
SR excitation table:
D excitation table:
The master-slave flip-flop was developed to avoid the problems of logic race in clocked flip-flop. This
flip-flop is also called a pulse-triggered flip-flop because the length of the time required for its output to
change state equals the width of one clock pulse.
The master slave contains two flip-flops-a master flip-flop and slave flip-flop. On the rising edge of the
clock pulse, the levels on the control inputs are used to determine the output of the master. On the falling
edge of the clock pulse, the state of the master is transferred to the slave, whose outputs are Q and Q̅.
There are three basic types of master-slave flip-flops- S-R, D, and J-K. The key to identify master-slave
flip-flop by its logic symbol is the postponed output symbol ┐ at the outputs.
B.Pranalini, Asst. Professor, Dept of IT, GVPCOE(A) 12
The master-slave (pulse-triggered) S-R flip-flop:
When clock input is 1, master flip-flop is activated and when clock is 0, slave flip flop is activated.
The master-slave (pulse-triggered) D flip-flop:
Fig1 shows a register constructed with 4 D-type flip-flops. The common clock input triggers all flip‐flops
on the positive edge of each pulse, and the binary data available at the four inputs are transferred into the
4-bit register. The outputs can be sampled at any time to obtain the binary information stored in the
register. The input Clear_b goes to the active-low R (reset) input of all four flip-flops. When this input
goes to 0, all flip-flops are reset asynchronously.
In Fig2, when the load input is 1, the data at the four external inputs are transferred into the register with
the next positive edge of the clock. When the load input is 0, the outputs of the flip-flops are connected to
their respective inputs.
Shift registers:
Shift registers are used for the storage and transfer of digital data. A shift register are used to
momentarily store binary data at the output of decoder. Operations performed by shift register are
complementation, multiplication and division.
Buffer register:
The buffer register is the simple set of registers. It is simply stores the binary word. The buffer may be
controlled buffer. Most of the buffer registers used D Flip-flops.
B.Pranalini, Asst. Professor, Dept of IT, GVPCOE(A) 17
Figure: logic diagram of 4-bit buffer register
The figure shows a 4-bit buffer register. The binary word to be stored is applied to the data terminals. On the
application of clock pulse, the output word becomes the same as the word applied at the input terminals. i.e.,
the input word is loaded into the register by the application of clock pulse.
When the positive clock edge arrives, the stored word becomes: Q4Q3Q2Q1=X4X3X2X1 or Q=X
Controlled buffer register:
• If C̅L̅R̅ goes LOW, all the FFs are RESET and the output becomes, Q=0000.
• When C̅L̅R̅ is HIGH, the register is ready for action. LOAD is the control input. When LOAD is
HIGH, the data bits X can reach the D inputs of FF‘s. Q4Q3Q2Q1=X4X3X2X1 or Q=X
• When LOAD is low, the X bits cannot reach the FF‘s. If L̅O̅A̅D̅ is HIGH, this forces each flip-flop
output to feed back to its data input.
Data transmission in shift registers:
A no. of FFs connected together such that data may be shifted into and shifted out of them is called shift
registers
Counters:
Counter is a device which stores (and sometimes displays) the number of times
particular event or process has occurred, often in relationship to a clock signal. A Digital counter
is a set of flip flops whose state change in response to pulses applied at the input to the counter.
Counters may be asynchronous counters or synchronous counters. Asynchronous counters are
also called ripple counters
In electronics counters can be implemented quite easily using register-type circuits such as
the flip-flops and a wide variety of classifications exist:
• Asynchronous (ripple) counter – changing state bits are used as clocks to subsequent state
flip-flops
• Synchronous counter – all state bits change under control of a single clock
• Decade counter – counts through ten states per stage
• Up/down counter – counts both up and down, under command of a control input
• Ring counter – formed by a shift register with feedback connection in a ring
• Johnson counter – a twisted ring counter
• Cascaded counter
• Modulus counter.
Each is useful for different applications. Usually, counter circuits are digital in nature, and count
in natural binary Many types of counter circuits are available as digital building blocks, for
example a number of chips in the 4000 series implement different counters.
Occasionally there are advantages to using a counting sequence other than the natural binary
sequence such as the binary coded decimal counter, a linear feed-back shift register counter, or
a gray-code counter.
Counters are useful for B.Pranalini,
digital clocks
Asst.and timers,Dept
Professor, andofinIT,oven timers, VCR
GVPCOE(A) 21 clocks, etc.
Asynchronous counters:
An asynchronous (ripple) counter is a single JK-type flip-flop, with its J (data) input fed
from its own inverted output. This circuit can store one bit, and hence can count from zero to one
before it overflows (starts over from 0). This counter will increment once for every clock cycle
and takes two clock cycles to overflow, so every cycle it will alternate between a transition from
0 to 1 and a transition from 1 to 0. Notice that this creates a new clock with a 50% duty cycle at
exactly half the frequency of the input clock. If this output is then used as the clock signal for a
similarly arranged D flip-flop (remembering to invert the output to the input), one will get
another 1 bit counter that counts half as fast. Putting them together yields a two-bit counter:
Two bit ripple counter used two flip-flops. There are four possible states from 2 – bit up-
counting I.e. 00, 01, 10 and 11.
· The counter is initially assumed to be at a state 00 where the outputs of the tow flip-flops
are noted as Q1Q0. Where Q1 forms the MSB and Q0 forms the LSB.
· For the negative edge of the first clock pulse, output of the first flip-flop FF1 toggles its
state. Thus Q1 remains at 0 and Q0 toggles to 1 and the counter state are now read as 01.
· During the next negative edge of the input clock pulse FF1 toggles and Q0 = 0. The output
Q0 being a clock signal for the second flip-flop FF2 and the present transition acts as a negative
edge for FF2 thus toggles its state Q1 = 1. The counter state is now read as 10.
· For the next negative edge of the input clock to FF1 output Q0 toggles to 1. But this
transition from 0 to 1 being a positive edge for FF2 output Q1 remains at 1. The counter state is
now read as 11.
· For the next negative edge of the input clock, Q0 toggles to 0. This transition from 1 to 0
acts as a negative edge clock for FF2 and its output Q1 toggles to 0. Thus the starting state 00 is
attained. Figure shown below
Two-bit ripple up-down counter using negative edge triggered flip flop:
Figure: asynchronous 2-bit ripple up-down counter using negative edge triggered flip flop:
• As the name indicates an up-down counter is a counter which can count both in upward
and downward directions. An up-down counter is also called a forward/backward counter
or a bidirectional counter. So, a control signal or a mode signal M is required to choose
the direction of count. When M=1 for up counting, Q1 is transmitted to clock of FF2 and
when M=0 for down counting, Q1‘ is transmitted to clock of FF2. This is achieved by
using two AND gates and one OR gates. The external clock signal is applied to FF1.
• Clock signal to FF2= (Q1.Up)+(Q1‘. Down)= Q1m+Q1‘M‘
To design a asynchronous counter, first we write the sequence , then tabulate the values of
reset signal R for various states of the counter and obtain the minimal expression for R and R‘
using K-Map or any other method. Provide a feedback such that R and R‘ resets all the FF‘s after
the desired count
After sixth clock pulse it goes to 000. For the design, write the truth table with present state
outputs Q3, Q2 and Q1 as the variables, and reset R as the output and obtain an expression for R
in terms of Q3, Q2, and Q1that decides the feedback into be provided. From the truth table,
R=Q3Q2. For active-low Reset, R‘ is used. The reset pulse is of very short duration, of the order
of nanoseconds and it is equal to the propagation delay time of the NAND gate used. The
expression for R can also be determined as follows.
The logic diagram and timing diagram of Mod-6 counter is shown in the above fig.
0 0 0 0 0
1 0 0 1 0
2 0 1 0 0
3 0 1 1 0
4 1 0 0 0
5 1 0 1 0
6 1 1 0 1
0 0 0 0
7 0 0 0 0
The count table and the K-Map for reset are shown in fig. from the K-Map R=Q4Q2. So,
feedback is provided from second and fourth FFs. For active –HIGH reset, Q4Q2 is applied to
the clear terminal. For active-LOW reset 𝑄4𝑄2 is connected 𝐶𝐿𝑅 isof all Flip=flops.
Synchronous counters:
Asynchronous counters are serial counters. They are slow because each FF can change state
only if all the preceding FFs have changed their state. if the clock frequency is very high, the
asynchronous counter may skip some of the states. This problem is overcome in synchronous
counters or parallel counters. Synchronous counters are counters in which all the flip flops are
triggered simultaneously by the clock pulses Synchronous counters have a common clock pulse
applied simultaneously to all flip-flops. A 2-Bit Synchronous Binary Counter
Binary Counter:
The design of a synchronous binary counter is so simple that there is no need to go through a sequential
logic design process. In a synchronous binary counter, the flip-flop in the least significant position is
complemented with every pulse. A flip‐flop in any other position is complemented when all the bits in the
lower significant positions are equal to 1.
For example, if the present state of a four-bit counter is A3A2A1A0 = 0011, the next count is 0100. A0 is
always complemented. A1 is complemented because the present state of A0 = 1. A2 is complemented
because the present state of A1A0 = 11. However, A3 is not complemented, because the present state of
A2A1A0 = 011, which does not give an all1’s condition.
Synchronous binary counters have a regular pattern and can be constructed with complementing flip-flops
and gates. The regular pattern can be seen from the four-bit counter depicted in Fig.. The C inputs of all
flip-flops are connected to a common clock. The counter is enabled by Count_enable. If the enable input
is 0, all J and K inputs are equal to 0 and the clock does not change the state of the counter. The first
stage, A0, has its J and K equal to 1 if the counter is enabled. The other J and K inputs are equal to 1 if all
previous least significant stages are equal to 1 and the count is enabled.
The chain of AND gates generates the required logic for the J and K inputs in each stage. The counter can
be extended to any number of stages, with each stage having an additional flip-flop and an AND gate that
gives an output of 1 if all previous flip-flop outputs are 1.
[Note that the flip-flops trigger on the positive edge of the clock. The polarity of the clock is not essential
here, but it is with the ripple counter.Asst.
B.Pranalini, TheProfessor,
synchronous
Dept ofcounter can be triggered
IT, GVPCOE(A) 27 with either the positive or
the negative clock edge. The complementing flip-flops in a binary counter can be of either the JK type, the
T type, or the D type with XOR gates. The equivalency of the three types is indicated in previous fig.
Step 1:State Diagram: draw the state diagram showing all the possible states state diagram which
also be called nth transition diagrams, is a graphical means of depicting the sequence of states
through which the counter progresses.
Step2: number of flip-flops: based on the description of the problem, determine the required
number n of the flip-flops- the smallest value of n is such that the number of states N≤2n--- and
the desired counting sequence.
Step3: choice of flip-flops excitation table: select the type of flip-flop to be used and write the
excitation table. An excitation table is a table that lists the present state (ps) , the next state(ns)
and required excitations.
B.Pranalini, Asst. Professor, Dept of IT, GVPCOE(A) 29
Step4: minimal expressions for excitations: obtain the minimal expressions for the excitations of
the FF using K-maps drawn for the excitation of the flip-flops in terms of the present states and
inputs.
Step5: logic diagram: draw a logic diagram based on the minimal expressions
Step1: determine the number of flip-flops required. A 3-bit counter requires three FFs. It has 8
states (000,001,010,011,101,110,111) and all the states are valid. Hence no don‘t cares. For
selecting up and down modes, a control or mode signal M is required. When the mode signal
M=1 and counts down when M=0. The clock signal is applied to all the FFs simultaneously.
Step2: draw the state diagrams: the state diagram of the 3-bit up-down counter is drawn as
Step3: select the type of flip flop and draw the excitation table: JK flip-flops are selected and the
excitation table of a 3-bit up-down counter using JK flip-flops is drawn as shown in fig.
Step4: obtain the minimal expressions: From the excitation table we can conclude that J1=1 and
K1=1, because all the entries for J1and K1 are either X or 1. The K-maps for J3, K3,J2 and K2
based on the excitation table and the minimal expression obtained from them are shown in fig.
Step5: draw the logic diagram: a logic diagram using those minimal expressions can be drawn as
shown in fig.
Step 1: the number of flip-flops: we know that the counting sequence for a modulo-6 gray code
counter is 000, 001, 011, 010, 110, and 111. It requires n=3FFs (N≤2n, i.e., 6≤23). 3 FFs can have
8 states. So the remaining two states 101 and 100 are invalid. The entries for excitation
corresponding to invalid states are don‘t cares.
Step2: the state diagram: the state diagram of the mod-6 gray code converter is drawn as shown
in fig.
Step3: type of flip-flop and the excitation table: T flip-flops are selected and the excitation table
of the mod-6 gray code counter using T-flip-flops is written as shown in fig.
B.Pranalini, Asst. Professor, Dept of IT, GVPCOE(A) 31
required
PS NS excitations
Q3 Q2 Q1 Q3 Q2 Q1 T3 T2 T1
0 0 0 0 0 1 0 0 1
0 0 1 0 1 1 0 1 0
0 1 1 0 1 0 0 0 1
0 1 0 1 1 0 1 0 0
1 1 0 1 1 1 0 0 1
1 1 1 0 0 0 1 1 1
Step4: The minimal expressions: the K-maps for excitations of FFs T3,T2,and T1 in terms of
outputs of FFs Q3,Q2, and Q1, their minimization and the minimal expressions for excitations
obtained from them are shown if fig
Step5: the logic diagram: the logic diagram based on those minimal expressions is drawn as
shown in fig.
Step1: the number of flip-flops: a BCD counter is a mod-10 counter has 10 states (0000 through
1001) and so it requires n=4FFs(N≤2n,, i.e., 10≤24). 4 FFS can have 16 states. So out of 16 states,
six states (1010 through 1111) are invalid. For selecting up and down mode, a control or mode
signal M is required. , it counts up when M=1 and counts down when M=0. The clock signal is
applied to all FFs.
Step2: the state diagram: The state diagram of the mod-10 up-down counter is drawn as shown
in fig.
Step3: types of flip-flops and excitation table: T flip-flops are selected and the excitation table of
the modulo-10 up down counter using T flip-flops is drawn as shown in fig.
PS NS
Step5: the logic diagram: the logic diagram based on the above equation is shown in fig.
State diagram: the state diagram or state graph is a pictorial representation of the relationships
between the present state, the input, the next state, and the output of a sequential circuit. The
state diagram is a pictorial representation of the behavior of a sequential circuit.
The state represented by a circle also called the node or vertex and the transition between
states is indicated by directed lines connecting circle. a directed line connecting a circle with
itself indicates that the next state is the same as the present state. The binary number inside each
circle identifies the state represented by the circle. The direct lines are labeled with two binary
numbers separated by a symbol. The input value is applied during the present state is labeled
after the symbol.
Ring counter: this is the simplest shift register counter. The basic ring counter using D flip-
flops is shown in fig. the realization of this counter using JK FFs. The Q output of each stage is
connected to the D flip-flop connected back to the ring counter.
Timing diagram:
This counter is obtained from a serial-in, serial-out shift register by providing feedback
from the inverted output of the last FF to the D input of the first FF. the Q output of each is
connected to the D input of the next stage, but the Q‘ output of the last stage is connected to the
D input of the first stage, therefore, the name twisted ring counter. This feedback arrangement
produces a unique sequence of states.
The logic diagram of a 4-bit Johnson counter using D FF is shown in fig. the realization
of the same using J-K FFs is shown in fig.. The state diagram and the sequence table are shown
in figure. The timing diagram of a Johnson counter is shown in figure.
Let initially all the FFs be reset, i.e., the state of the counter be 0000. After each clock
pulse, the level of Q1 is shifted to Q2, the level of Q2to Q3, Q3 to Q4 and the level of Q4‘to Q1
and the sequences given in fig.
1. Moore circuit: in this model, the output depends only on the present state of the flip-
flops
2. Meelay circuit: in this model, the output depends on both present state of the flip-
flop. And the inputs.
Sequential circuits are also called finite state machines (FSMs). This name is due to the fast that the functional
behavior of these circuits can be represented using a finite number of states
NS,O/P
INPUT X
PS X=0 X=1
a a,0 b,0
b b,1 c,0
c d,0 c,1
d d,0 a,1
In case of moore circuit ,the directed lines are labeled with only one binary number representing
the input that causes the state transition. The output is indicated with in the circle below the
present state, because the output depends only on the present state and not on the input.
Step1: word statement of the problem: the block diagram of a serial binary adder is shown in
fig. it is a synchronous circuit with two input terminals designated X1and X2 which carry the
two binary numbers to be added and one output terminal Z which represents the sum. The inputs
and outputs consist of fixed-length sequences 0s and 1s.the output of the serial Zi at time tiis a
function of the inputs X1(ti) and X2(ti) at that time ti-1 and of carry which had been generated at ti-
1. The carry which represent the past history of the serial adder may be a 0 or 1. The circuit has
two states. If one state indicates that carry from the previous addition is a 0, the other state
indicates that the carry from the previous addition is a 1
Step2 and 3: state diagram and state table: let a designate the state of the serial adder at ti if a
carry 0 was generated at ti-1, and let b designate the state of the serial adder at ti if carry 1 was
generated at ti-1 .the state of the adder at that time when the present inputs are applied is referred
to as the present state(PS) and the state to which the adder goes as a result of the new carry value
is referred to as next state(NS).
The behavior of serial adder may be described by the state diagram and state table.
PS NS ,O/P
X1 X2
0 0 1 1
0 1 0 1
A A,0 B,0 B,1 B,0
B A,1 B,0 B,0 B,1
Setp4: reduced standard from state table: the machine is already in this form. So no need to
do anything
0 0 0 0 1 0 1 1 1
1 0 1 1 1 1 0 0 1
STEP6: choose type of FF and excitation table: to write table, select the memory element the
excitation table is as shown in fig.
PS I/P NS I/P-FF O/P
y x1 x2 Y D Z
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 0 1
0 1 1 1 1 0
1 0 0 0 0 1
1 0 1 1 1 0
1 1 0 1 1 0
1 1 1 1 1 1
PS NS,Z
X=0 X=1
A A,0 B,0
B C,0 B,0
C A,0 D,0
D C,1 B,0
NS(Y1Y2) O/P(z)
PS(y1y2 X=0 X=1 X=0 X=1
A= 0 0 0 0 0 1 0 0
B=0 1 1 0 0 1 0 0
C=1 0 0 0 1 1 0 0
D=1 1 1 1 01 1 0
Step6: choose type of flip-flops and form the excitation table: select the D flip-flops as memory
elements and draw the excitation table.
INPUTS -
PS I/P NS FFS O/P
y1 Y2 X Y1 Y2 D1 D2 Z
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0
0 1 0 1 0 1 0 0
0 1 1 0 1 0 1 0
1 0 0 0 0 0 0 0
1 0 1 1 1 1 1 0
1 1 0 1 0 1 0 1
1 1 1 0 1 0 1 0
Step7: K-maps and minimal functions: based on the contents of the excitation table , draw the k-
map and simplify them to obtain the minimal expressions for D1 and D2 in terms of y1, y2 and x
as shown in fig. The expression for z (z=y1,y2) can be obtained directly from table