Professional Documents
Culture Documents
Chapter 8 - Sequential Circuits
Chapter 8 - Sequential Circuits
Philadelphia University
Faculty of Information Technology
Department of Computer Science
Dareen Hamoudeh 1
Chapter 8
Sequential Circuits
1
28-05-2014
Sequential circuits
• Sequential circuits use current input variables and previous
input variables by storing the information and putting back
into the circuit on the next clock (activation) cycle.
• (Sequential circuit = Combinational logic + Memory Elements)
Dareen Hamoudeh 4
2
28-05-2014
Memory Element
• A Memory Element: logic device that can store a binary
information, this binary information defines the state of the circuit.
• Can remember value indefinitely, or change its value on command
from its inputs.
• Current State of a sequential Circuit: Value stored in memory
elements (value of state variables).
• State transition: A change in the stored values in memory elements
thus changing the sequential circuit from one state to another
state.
• Types of sequential circuits depending on the timing of their signals:
– Synchronous
– Asynchronous
Memory Element
states
• The output Q of the memory element represents the value
stored in the memory element. This is also called the state
variable of the memory elements.
• A memory element can be in one of two possible states:
– Q = 0 (the memory element has 0 stored), also said be in
state 0.
– Q =1 (the memory element has 1 stored), also said to be
in state 1.
• A sequential circuit that contains n memory elements could
be in one of a maximum of 2n states at any given time
depending on the stored values in the memory elements.
EECC341 - Shaaban 6
3
28-05-2014
Memory Element
commands
• The commands to the memory element formed
by its input(s) may include:
– Set: Store 1 (Q=1) in the memory element.
– Reset: Store 0 (Q=0) in the memory element.
– Flip: Change stored value from 0 to 1 or from 1 to 0.
– Hold value: Memory value does not change.
• Memory Element state transition: A change in
the stored value from 0 to 1, or from 1 to 0 such
as that caused by a flip command.
EECC341 - Shaaban 7
4
28-05-2014
Clock Signals
• A clock signal is a periodic square wave that
indefinitely switches values from 0 to 1 and 1
to 0 at fixed intervals.
EECC341 - Shaaban 9
EECC341 - Shaaban 10
5
28-05-2014
Dareen Hamoudeh 11
Flip-Flops
• Flip-flop types:
– Basic flip flop circuit (latch).
– RS flip-flop.
– D flip-flop.
– JK flip-flop.
– T flip-flop.
Dareen Hamoudeh 12
6
28-05-2014
Dareen Hamoudeh 13
7
28-05-2014
Dareen Hamoudeh 15
Logic Diagram
S R Q Qꞌ
1 0 0 1
1 1 0 1 (After S=1, R=0)
0 1 1 0 Truth Table
Dareen Hamoudeh 16
8
28-05-2014
RS flip-flop
(Clocked) RS flip-flop
Dareen Hamoudeh 17
18
Dareen Hamoudeh
9
28-05-2014
RS flip-flop
(Clocked) RS flip-flop
Function Table
With the condition:
Dareen Hamoudeh 19
D flip-flop
(gated D-latch)
• To eliminate the undesirable condition of the
indeterminate state in the RS flip-flop.
• Ensures that inputs S and R are never equal to
1 at the same time.
• Has only two inputs: D, CP.
20
Dareen Hamoudeh
10
28-05-2014
D flip-flop
(gated D-latch)
• D input goes with S input,
• D’s complement goes with R input
• If CP=0 gate 3 and 4 outputs =1.. And the
circuit does not change state.
• If CP=1 if D=1 then Q=1.. (Set state).
• If CP=1if D=0 then Q=0..(Clear state).
(The next state = D, whether Q=1 or Q=0)
Dareen Hamoudeh 21
D flip-flop
(gated D-latch)
Dareen Hamoudeh 22
11
28-05-2014
D flip-flop
• D flip-flop refers to its ability to hold data into
its internal storage.
• The CP input sometimes called G (gate)
because it enables the gated latch to make
possible data entry into the circuit.
Dareen Hamoudeh 23
JK Flip-Flop
• It is a refinement of RS flip-flop where the
indeterminate state is defined here.
• Input J is set and K is Reset.
• When J=K=1 the flip-flop switches to its
complement (last state is inverted):
– if Q=1 it switches to Q=0.
– if Q=0 it switches to Q=1.
Dareen Hamoudeh 24
12
28-05-2014
JK Flip-Flop
– When J=K=1: then CP transmitted through one AND gate only
(the one whose input is connected to flip-flop output that is
presently =1):
– If Q=1 the upper K’s AND =1 flip-flop is Cleared.
– If Qꞌ=1 the upper J’s AND =1 flip-flop is Set.
Dareen Hamoudeh 25
JK Flip-Flop
Dareen Hamoudeh 26
13
28-05-2014
JK Flip-Flop
• Problems:
– Because of the feedback connection in the JK flip-flop, CP
will still =1 while J=K=1 will cause the output to
complement again and repeat complementing until the
CP=0.
• To avoid this, CP must have shorter time duration (pulse width)
than the flip-flop delay time.
• This is a restrictive requirement.
• Solution:
• JK flip-flop is not constructed like this.
• Restriction on pulse width can be eliminated with a
Master-Slave or Edge-Triggered construction.
Dareen Hamoudeh 27
T flip-flops
• Is a single-input version of JK flip-flop.
• It is obtained from JK flip-flop when both
inputs are tied together.
• T refers to the ability of flip-flop to Toggle or
complement its state.
Dareen Hamoudeh 28
14
28-05-2014
T flip-flops
• When CP=1:
if T=1 flip-flop complements its current state.
If T=0 next state = present state (no change).
( )
Dareen Hamoudeh 29
T flip-flops
Dareen Hamoudeh 30
15
28-05-2014
Triggering of Flip-flops
Triggering of Flip-flops
Problem:
• The state of a flip-flop is changed by a momentary change in the input
signal.
• This change is called a trigger and the transition it causes is said to trigger
the flip-flop.
• The feedback path between the combinational circuit and memory
elements can produce instability if the outputs of the memory elements
(flip-flops) are changing while the outputs of the combinational circuit
that go to the flip-flop inputs are being sampled by the clock pulse.
• Two types of flip-flops that synchronizes the state changes during a clock
pulse transition :
– Master-Slave Flip-Flop
– Edge Triggered Flip-Flop
Dareen Hamoudeh 32
16
28-05-2014
Triggering of Flip-flops
Solution:
• To solve the feedback timing problem is to
make the flip-flop sensitive to the pulse
transition rather than the pulse duration.
Dareen Hamoudeh 33
Triggering of Flip-flops
• Example: The D flip-flop if level sensitive (triggered
on pulse duration)
Dareen Hamoudeh 34
17
28-05-2014
Dareen Hamoudeh 35
Positive-edge-triggered
D flip-flop
• The D flip-flop:
Graphic Symbol
Dareen Hamoudeh 36
18
28-05-2014
Positive-edge-triggered
D flip-flop
• Example: Positive-edge-triggered D flip-flop.
Dareen Hamoudeh 37
comparison
Dareen Hamoudeh 38
19
28-05-2014
Positive-edge-triggered
D flip-flop
Dareen Hamoudeh 39
Positive-edge-triggered
D flip-flop
• Cp=0 S=R=1 (steady state)
Dareen Hamoudeh 40
20
28-05-2014
Positive-edge-triggered
D flip-flop
• S=0 & R=1 Q=1 ..(set)
• S=1 & R=0 Q=0 ..(Clear)
Dareen Hamoudeh 41
Positive-edge-triggered
Negative-edge-triggered
D flip-flop
Graphic Symbol
Dareen Hamoudeh 42
21
28-05-2014
Master-Slave Flip-flops
Master-Slave Flip-flops
• It is constructed from 2 flip-flops: one serves
as master and the other as slave.
• The following is RS master-slave flip-flop:
Dareen Hamoudeh 44
22
28-05-2014
RS master-slave flip-flop
• It consists of: master flip-flop, slave flip-flop
and an inverter.
• When CP=0:
– Slave is Enabled Q = Y & Qꞌ = Yꞌ.
– Master is Disabled.
• When CP=1:
– R & S inputs transmitted to Master.
– Slave Disabled.
Dareen Hamoudeh 45
RS master-slave flip-flop
Dareen Hamoudeh 46
23
28-05-2014
RS master-slave flip-flop
Timing Relationship:
• Assume the flip-flop
Is in clear state, so Q=Y=0
• When CP=0 :
- No change.
• When CP changes from
0 to 1:
Master Set & Y=1.
Dareen Hamoudeh 47
Dareen Hamoudeh 48
24
28-05-2014
Dareen Hamoudeh 49
25
28-05-2014
Dareen Hamoudeh 51
Dareen Hamoudeh 52
26
28-05-2014
Dareen Hamoudeh 53
1- State equation
• Is an algebraic expression that specifies the
condition for a flip-flop state transition:
– Left side: denotes the next state of flip-flop.
– Right side: Boolean expression that specifies present
state & input conditions to make next state =1.
• Next state equations:
– A(t+1)= A . x + B . X
– B(t+1)= Aꞌ . x
• Present state of the output:
– Y= (A + B) xꞌ
Dareen Hamoudeh 54
27
28-05-2014
2- State Table
• Enumerates the sequence of inputs, outputs and flip-flop
states. It consists of 4 sections :
– Current state .
– Input.
– Next state (must satisfy the state equation).
– Output.
• First: we should list all possible combinations of current
states and inputs.
• Second: next-state and output values are determined from
state equations.
• Number of rows (combinations) = 2 m + n , where:
– m :number of flip-flops.
– n: number of inputs.
Dareen Hamoudeh 55
2- State Table
In the example there are:
• Two flip-flops, so m=2.
• One input (x), so n=1.
• Then we have 23 combinations
Dareen Hamoudeh 56
28
28-05-2014
2- State Table
Dareen Hamoudeh 57
3- State Diagram
• The information in the state table can be
represented graphically:
– State is represented be a circle.
– Transition between states represented by directed
lines.
Dareen Hamoudeh 58
29
28-05-2014
3- State Diagram
• Binary numbers inside
circles identifies flip-
flop states.
• Binary numbers on
lines separated by “/”:
– first number : input.
– Second number:
output.
• Directed line
connecting circle with
itself means no change.
Dareen Hamoudeh 59
4- Input Functions
• The part of the circuit that generates the
inputs to flip-flop are described algebraically
by a set of Boolean functions.
• Also called input equations.
– We use two letters:
• First is the name of the input.
• Second is the name of the flip-flop.
Dareen Hamoudeh 60
30
28-05-2014
4- Input Functions
• For the following circuit, input functions are:
JA= B Cꞌ x + Bꞌ C xꞌ
KA= B + y
Dareen Hamoudeh 61
4- Input Functions
• Example:
Write the input functions For the circuit in the
following slide.
Dareen Hamoudeh 62
31
28-05-2014
Dareen Hamoudeh 63
4- Input Functions
• Solution:
Dareen Hamoudeh 64
32
28-05-2014
Example 1
Dareen Hamoudeh 65
Example 2
Dareen Hamoudeh 66
33
28-05-2014
Example 3
Note:
Dareen Hamoudeh 67
34
28-05-2014
characteristic tables
Dareen Hamoudeh 70
35
28-05-2014
characteristic tables
Dareen Hamoudeh 71
Example
Dareen Hamoudeh 72
36
28-05-2014
1- input functions
• Flip-flop A:
– JA= B
– KA= B xꞌ
• Flip-flop B:
– JB= xꞌ
– KA= A x =(Aꞌ x + A xꞌ)
Dareen Hamoudeh 73
2- state table
Dareen Hamoudeh 74
37
28-05-2014
3- state diagram
Dareen Hamoudeh 75
Excitation table
38
28-05-2014
Excitation table
• characteristic table:
– Useful for analysis and for defining the operation of
flip-flop.
– Specifies next state when inputs and current state are
known.
• But, Some times we only know the transition
from current state to next state and want to find
the flip-flop input conditions that causes the
required transition. So we use Excitation table.
Dareen Hamoudeh 77
Excitation table
Dareen Hamoudeh 78
39