Chapter 5 Sequential Logic Systems
Chapter 5 Sequential Logic Systems
University of Gondar
Institute of Technology
Department of Electrical Engineering
Digital Logic Design:
Chapter 5: Sequential Logic Systems
By:
Habtamu Maru
Outline
Part I:
I Latch
I Flip Flop
synchronous Asynchronous
Latches and FFs are sequential circuits that can store information.
One latch or FF can store one bit of information.
The main difference between latches and FFs is
latches, their outputs are constantly affected by their inputs as
long as the enable signal is asserted i.e. when they are enabled,
their content changes immediately when their inputs change.
FFs, 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 FF content remains
constant even if the input changes.
Storage element that operate with signal level (rather than signal
transition) are referred to as Latches, those controlled by a clock
transition are FFs.
Latches are said to be level sensitive device; FF are edge sensitive
devices.
The major differences in these FF 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.
There are basically four main types of latches & FFs: SR, D, JK, & T.
only at the single instant and duration of the pulse and can
data can not be changed until send or receive the data when
Using the signal Q as the state variable to describe the state of the circuit,
we can say that the circuit has two stable states: Q =0, and Q = 1; hence
the name bistable.
Habtamu M. Digital Logic Design April 10, 2023 11 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
It shows two outputs, labeled Q and Q that are the inverse of each
other
The Q output is called the normal FF output,and Q is the inverted
FF output.
For example, if we say that a FF is in the HIGH (1) state, we mean
that Q=1, if we say that a FF is in the LOW (0) state, we mean that
Q=0. Of course, Q the state will always be the inverse of Q.
I Note that the HIGH (1) state (Q=1/ Q=0)is also referred to as the
SET state.
I In a similar way, the LOW (1) state (Q=0/ Q=1) is also referred to as
the CLEAR or RESET state.
S-R Latch
how to control bistable circuit?
Bistable circuit can’t change the information bit that is stored in it.
In order to change the information bit, we need to add an inputs
to the circuit.
The simplest way to add inputs is to replace the two inverters with
two NAND gates or two NOR gates. This circuit is called a SR latch.
In addition to the two outputs Q and Q, there are two inputs S and
R for SET and RESET respectively.
Following the convention, the prime in S and R denotes that these
inputs are active low.
The SR latch can be in one of two states: a SET state when Q = 1,
or a RESET state when Q = 0.
Habtamu M. Digital Logic Design April 10, 2023 14 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Latch
The NAND gate version, called a NAND gate latch or simply a latch.
The two NAND gates are cross-coupled so that the output of NAND1 is
connected to one of the inputs of NAND2 , and vice versa. The gate out-
puts, labeled Q and Q respectively, are the latch outputs.
Under normal conditions, these outputs will always be the inverse of each
other.
There are two latch inputs: the SET input is the input that sets Q to the 1
state; the RESET input is the input that RESET Q to the 0 state.
The SET and RESET inputs are both normally resting in the HIGH state and
one of them will be pulsed LOW whenever we want to change the latch
outputs. We begin our analysis by showing that there are two equally
likely output states when SET= RESET= 1.
The second possibility is shown in the above Fig. (b), where Q=1 & Q=0
The 1 from NAND1 produces a 0 at the NAND2 output, which, in turn,
keeps the NAND1 output 1.
Thus, there are two possible output states when SET=RESET=1 as we shall
soon see, the one that actually exists will depend on what has occurred
previously at the inputs.
SETing the Latch
Now let’s investigate what happens when the SET input is momentarily
pulsed 0 while RESET is kept 1. When Q=0 prior to the occurrence of the
pulse.
As SET is pulsed 0 at time t0 , Q will go 1, and this 1 will force Q to go 0
so that NAND1 now has two 0 inputs. Thus, when SET returns to the 1
state at t1 , the NAND1 output remains 1, which, in turn, keeps the NAND2
output 0.
Habtamu M. Digital Logic Design April 10, 2023 17 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Latch
From the above two figures the second one shows that, when Q=1 and Q
=0 prior to the application of the SET pulse. Since Q =0 is already keeping
the NAND1 output 1, the 0 pulse at SET will not change anything.
Thus, when SET returns 1, the latch outputs are still in the Q=1 , Q=0 state.
We can summarize the above fig. by stating that a 0 pulse on the SET input
will always cause the latch to end up in the Q=1 state. This operation is
called setting the latch or FF.
Habtamu M. Digital Logic Design April 10, 2023 18 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Latch
Summarized by stating that a LOW (0) pulse on the RESET input will
always cause the latch to end up in the Q=0 state. This operation
is called clearing or resetting the latch.
Habtamu M. Digital Logic Design April 10, 2023 20 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Latch
Figure: (a) NOR gate latch; (b) Function table; (c) Simplified block symbol.
The analysis of the operation of the NOR latch can be performed in ex-
actly the same manner as for the NAND latch. The results are given in the
function table in above Figure (b) and are summarized as follows:
I S=R=0. This is the normal resting state for the NOR latch, and it has
no effect on the output state. Q and Q will remain in whatever state
they were in prior to the occurrence of this input condition.
I S=1, R= 0. This will always SET Q= 1, where it will remain even after
S returns to 0.
I S= 0, R= 1. This will always RESET Q= 0, where it will remain even
after R returns to 0.
I S= 1, R= 1. This condition tries to SET and RESET the latch at the
same time, and it produces Q=Q =0. If the inputs are returned to
0 simultaneously, the resulting output state is unpredictable. This
input condition should not be used.
The NOR gate latch operates exactly like the NAND latch except that the
S and R inputs are active- HIGH rather than active-LOW, and the normal
resting state is S = R= 0. Q will be set 1 by a HIGH pulse on the S input,
and it will be RESETed LOW by a HIGH pulse on the R input.
The Gated S-R Latch
A gated latch requires an enable EN input.
The S and R inputs determine the output when EN is HIGH.
The output does not change when LOW is applied to EN.
Invalid state: when S and R are simultaneously HIGH.
The clock signal is distributed to all parts of the system, and most (if not
all) of the system outputs can change state only when the clock makes a
transition.
When the clock changes from 0 to 1, this is called the positive-going tran-
sition (PGT); when the clock goes from 1 to 0, this is the negative going
transition (NGT).
The speed at which a synchronous digital system operates is dependent
on how often the clock cycles occur.
A clock cycle is measured from one PGT to the next PGT or from one NGT
to the next NGT. The time it takes to complete one cycle (seconds/cycle)
is called the period (T), as shown in Figure.
The speed of a digital system is normally referred to by the number of
clock cycles that happen in 1 s (cycles/second), which is known as the
frequency (F) of the clock.
Habtamu M. Digital Logic Design April 10, 2023 30 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Flip Flops
Clocked Flip-Flops
Clocked FFs have a clock input that is typically labeled CLK, CK, or C.
In most clocked FFs, the CLK input is edge-triggered, which means that it
is activated by a signal transition; this is indicated by the presence of a
small triangle on the CLK input.
This contrasts with the latches, which are level-triggered.
Clocked FFs have a clock input (CLK) that is active on either (a) the PGT or
(b) the NGT. The control inputs determine the effect of the active clock.
Clocked FFs also have one or more control inputs that can have various
names, depending on their operation.
The control inputs will have no effect on Q until the active clock transition
occurs. In other words, their effect is synchronized with the signal applied
to CLK. For this reason they are called synchronous control inputs.
In summary, we can say that the control inputs get the FF outputs ready
to change, while the active transition at the CLK input actually triggers the
change.
The control inputs control the WHAT (i.e., what state the output will go
to); the CLK input determines the WHEN.
All the above FF have the triggering input called clock (CLK/C).
Habtamu M. Digital Logic Design April 10, 2023 33 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Flip Flops
(a) Clocked S-R FF that responds only to the PG edge of a clock pulse; (b)
Function table; (c) Typical wave forms.
The S=R=1 condition should not be used because it results in an
ambiguous condition.
Habtamu M. Digital Logic Design April 10, 2023 35 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Flip Flops
It should be noted from these wave forms that the FF is not af-
fected by the NGTs of the clock pulses.
Also, note that the S and R levels have no effect on the FF, except
upon the occurrence of a PGT of the clock signal.
The S and R inputs are synchronous control inputs; they control
which state the FF will go to when the clock pulse occurs.
The CLK input is the trigger input that causes the FF to change
states according to what the S and R inputs are when the active
clock transition occurs.
A clocked S-R flip-flop that triggers on the NGT at its CLK input.
The small circle and triangle on the CLK input indicates that this
FF will trigger only when the CLK input goes from 1 to 0.
This FF operates in the same manner as the positive-edge FF ex-
cept that the output can change states only on the falling edge of
the clock pulses (points b, d, f, h, and j in the above Figure).
Both P-edge and N-edge triggering FFs are used in digital systems.
The J & K inputs control the state of the FF in the same ways as the S & R
inputs do for the clocked S-R FF except for one major difference: the
J=K=1 condition does not result in an ambiguous output.
For this 1, 1 condition, the FF will always go to its opposite state upon
the positive transition of the clock signal. This is called the toggle mode
of operation.
In this mode, if both J and K are left HIGH, the FF will change states
(toggle) for each PGT of the clock.
Clocked J-K FF that responds only to the positive edge of the clock; with
functional truth table and wave forms.
Note from these wave forms that the FF is not affected by the NG edge
of the clock pulses.
Also, the J & K input levels have no effect except upon the occurrence
of the PGT of the clock signal. The J and K inputs by themselves cannot
cause the FF to change states.
Habtamu M. Digital Logic Design April 10, 2023 40 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Flip Flops
The J-K FF is much more versatile than the S-R FF because it has no am-
biguous states.
The J=K=1 condition, which produces the toggling operation, finds exten-
sive use in all types of binary counters.
Clocked D Flip-Flop
A clocked D FF that triggers on a PGT. Unlike the S-R and J-K FFs, this FF
has only one synchronous control input, D, which stands for data.
The operation of the D FF is very simple: Q will go to the same state that
is present on the D input when a PGT occurs at CLK.
In other words, the level present at D will be stored in the FF at the instant
the PGT occurs.
Even though the D input level changes between points ’a’ and ’b’, it has
no effect on Q; Q is storing the 0 that was on D at point ’a’.
When the PGT at ’b’ occurs, Q goes 1 b/c D is 1 at that time. Q stores this
1 until the PGT at point ’c’ causes Q to go 0 b/c D is 0 at that time.
Q is goes to 1 at ’d’ b/c D is 1. Note that Q stays 1 at point e b/c D is still 1.
Q can change only when a PGT occurs, the D input has no effect b/n PGTs.
A negative-edge-triggered D FF operates in the same way just described
except that Q will take on the value of D when a NGT occurs at CLK.
Habtamu M. Digital Logic Design April 10, 2023 43 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Flip Flops
T Flip Flop
When T=0, the FF does hold. i.e. Q is kept the same as it was before the
clock edge.
When T=1, the FF does toggle. i.e. the output Q is negated after the clock
edge, compared to the value before the clock edge.
Asynchronous Inputs
For the clocked FFs that we have been studying, the SR, JK, and D inputs
have been referred to as control inputs.These inputs are also called syn-
chronous inputs.
Most clocked FFs also have one or more asynchronous inputs that oper-
ate independently of the synchronous inputs and clock input.
These asynchronous inputs can be used to set the FF to the 1 state or
clear (reset) the FF to the 0 state at any time, regardless of the conditions
at the other inputs.
Stated in another way, the asynchronous inputs are override inputs, which
can be used to override all the other inputs in order to place the FF in one
state or the other.
A JK FF with two asynchronous inputs designated as PRESET and CLEAR.
These are active-LOW inputs, as indicated by the bubbles on the FF sym-
bol.
Habtamu M. Digital Logic Design April 10, 2023 45 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Flip Flops
PRE= CLR=1. The asynchronous inputs are inactive & the FF is free to
respond to the JK, & CLK inputs; i.e. the clocked operation can take place.
PRE=0; CLR=1. The PRE is activated and Q is immediately set to 1 no
matter what conditions are present at the JK, and CLK inputs.
PRE=1; CLR=0. The CLR is activated and Q is immediately cleared to 0
independent of the conditions on the JK, or CLK inputs.
PRE = CLR=0. This condition should not be used because it can result in
an ambiguous response.
Habtamu M. Digital Logic Design April 10, 2023 46 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
counters
Part II:
I Counters
F Asynchronous counter
F Synchronous counter
I Shift Register
F Serial in/serial out (SISO)
F Serial in/parallel out (SIPO)
F Parallel in/serial out (PISO)
F Parallel in/parallel out (PIPO)
I Shift Register counter
F Ring Counter
F Johnson Counter
Counters
Counter is a digital device used to count the number of pulses and it can
also used as a frequency divider.
A sequential circuit that goes through a prescribed sequence of states
upon the application of input pulses is called a counter.
The input pulses may be clock pulses, or they may originate from some
external source and may occur at a fixed interval of time or at random.
FF can be connected together to perform counting operation. Such a
group of FF is a counter.
The number of FF used & the way in which they are connected determines
the number of states (called the modulus) & also the specific sequence
of states that the counter goes through during each complete cycle.
The sequence of states may follow the binary number sequence or any
other sequence of states.
Habtamu M. Digital Logic Design April 10, 2023 48 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
counters
An n-bit binary counter consists of ”n” FFs and can count in binary from
0 through 2n - 1
Asynchronous/Ripple Counter
The term Asynchronous refers to events that do not have a fixed time
relation ship with each other, & generally don’t occur at the same time.
So the effect of an input clock pulse “ripples” through the counter, taking
some time, due to propagation delays, to reach the last FF.
The transition of the input CLK pulse & output Q0 can never occur at ex-
actly the same time.
Eg: As shown; there is some small delay between the CLK, Q0 and Q1
transitions.
Habtamu M. Digital Logic Design April 10, 2023 51 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
counters
Cascaded Counters
Cascading means that the last stage output of one counter drives the
input of the next counter.
A two bit and three bit counters can be cascaded as shown with logic high
condition of all inputs.
MOD number is generally equal to the number of states that the counter
goes through in each complete cycle before it recycles back to its starting
state. The MOD number can be increased simply by adding more FFs to
the counter. That is, MOD number =2N ; where N is the number of FFs
connected in the arrangement.
The final output of the modulus 8 counter Q4 occurs once for every 32
input clock pulses. The over all modulus of the cascade counters is 32.
The overall modulus of cascaded counter is equal to the product of the
individual module.
Habtamu M. Digital Logic Design April 10, 2023 62 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Shift Register
Shift Register
Registers is a group of FF capable of storing one bit of information.
Shift register are constructed using several FF, connected in such away to
store and transfer/ shift digital data.
In digital circuits a shift register is a group of FFs set up in a linear fashion
which have their inputs and output connected together in such a way that
the data are shifted down the line when the circuit is activated.
The various types of registers can be classified according to the manner
in which data can be entered into the register for storage and the manner
in which data are outputted from the register.
The various classifications are listed below:
I Serial in/serial out (SISO)
I Serial in/parallel out (SIPO)
I Parallel in/serial out (PISO)
I Parallel in/parallel out (PIPO)
Habtamu M. Digital Logic Design April 10, 2023 63 / 75
Digital Logic Design
Introduction About Flip Flop And Latch
Shift Register
data bit come in one a time and leave one at a time ,one FF for each bit
to be handled.
The Parallel In/Parallel Out Shift Registers allows the parallel entry of
data and parallel output of data.
Immediately following the simultaneous entry of all data bits, the bits
appear on the parallel output.
The Johnson counter is useful when you need a sequence that changes
by only one bit at a time.it has a limited number of states (2n , where
n=number of stages)
Johnson counter has twice as many stats as bit position. i.e. 3 bit counter
has 6 states & 4 bit has 8 active states.
8 active states of 4 bit Johnson counter is; 1000,1100,1110,1111,0111,
0011, 0001,0000. With one of the patterns as its starting state
The first 5 counter for a 4-bit Johnson counter that is initially cleared are:
!! !
OU
K Y
A N
T H
Habtamu M. Digital Logic Design April 10, 2023 75 / 75