Prez1 PDF
Prez1 PDF
Prez1 PDF
Introduction
• All digital systems contain memory components that can store information.
• Combinational circuits
– contains no memory elements
– the outputs depends on the inputs
• Sequential circuits, however, act as storage elements and have memory.
– to store, retain, and then retrieve information when needed at a later time.
• Block diagram of a sequential circuit:
Clock Synchronization
• The next value of the flip-flop must have reached a stable value before the
occurrence of the clock pulse, consequently, the combinational logic must
respond
p to a change
g in the state of the flip-flop
p p in time to be updated
p before the
next clock pulse arrives.
• Propagation delays of the combinational logic determines the minimum interval
between clock pulses to allow the circuit to operate correctly.
correctly
• The state of the flip-flops changes only by a clock pulse transition—for example,
when the value of the clock signals changes from 0 to 1 (positive edge).
• If the clock pulse is not active, the input and output of the flip-flop is effectively
isolated; flip-flop can be regarded as two gates controlled complementarily.
• Th
Thus, the
th ttransition
iti from
f one state
t t to
t the
th nextt occurs onlyl att predetermined
d t i d
intervals dictated by the clock pulses, that is so called synchronization.
• Storage
g elements that operate
p with signal
g levels ((rather than signal
g transitions)) are
referred to as latches; those controlled by a clock transition are flip-flops .
• Latches are said to be level sensitive devices; flip-flops are edge-sensitive ones.
• For
F ddesign
i simply
i l andd function
f i correctly,
l use flip-flops
fli fl as possible
ibl as you can.
NCNU_2013_DD_5_7
5-3 Latches
• The SR latch is a circuit with two cross-coupled NOR gates (or two cross-coupled
NAND gates) and two inputs labeled with S for set and R for reset.
• When output Q = 1 and Q Q’ = 0,
0 the latch is said to be in the set state,
state and Q = 0
and Q’ = 1, is in the reset state.
• Forbidden state:
– Inputs Q and Q’ are normally the complement of each other
– When both inputs are 1 at the same time result both outputs equal to 0
– If both
b th inputs
i t then
th change
h to
t 0 simultaneously,
i lt l the
th device
d i will
ill enter
t an
unpredictable or undefined state or a metastable state
– The next state will depend
p on the order in which S and R return to 0.
NCNU_2013_DD_5_8
• Characteristic
Ch i i equation:
i Q( 1) = D
Q(t+1)
NCNU_2013_DD_5_11
Trigger
• Trigger: a latch or flip-flop is switched by a change of the control input
– Level triggered – latches
– Edge triggered – flip-flops
• The transparent latch (level sensitive) may fail due to a race condition.
– The state of a latch changes as soon as the clock changes to 1, and the new
state
t t appears att the
th output
t t while
hil the
th clock
l k isi still
till active
ti (due
(d tto ttransparent).
t)
– This output may race through the combinational circuit to the latch input.
– If the clock is still active,
active the latch will respond to the new value again and a
new output state may occur resulting an unpredictable situation.
– To avoid such condition, the output of a latch cannot be applied directly or
through combinational logic to the input of the same or another latch when all
the latches are triggered by a common clock source.
NCNU_2013_DD_5_12
Master–slave D Flip-flop
• D flip-flop consists of two D latches and an inverter, the first latch is called the
master and the second the slave.
• Th
The two
t latches
l t h are controlled
t ll d ((enabled)
bl d) complementarily;
l t il they
th fli
flip and
d flop
fl
alternatively.
• Samples
p D and changes g Q only y at the negative
g edge
g of the clock (Clk),
( ), the
transition of the clock from 1 to 0.
• Positive edge triggered D flip-flop can also be constructed by adding an inverter
to the Clk input.
input
NCNU_2013_DD_5_13
(S R) = (0,
(S, (0 1): Q = 1
(S, R) = (1, 0): Q = 0
(S, R) = (1, 1): no operation
(S, R) = (0, 0): should be avoided
NCNU_2013_DD_5_14
Timing Parameters
• Setup time
– D input must be maintained at a constant value prior to the application of the
positive-edge
iti d off Clk pulse
l (rise)
(i )
– equal to the propagation delay through gates 4 and 1
– data to the internal latches
• Hold time
– D input must not changes after the application of the positive Clk pulse
– equal to the propagation delay of gate 3
– clock to the internal latch
Clk
setup hold
NCNU_2013_DD_5_15
Graphic Symbols
Latch
Edge-triggered D flip-flop
NCNU_2013_DD_5_16
JK Flip-Flop
• Edge-triggered D flip-flop requires the smallest number of gates, and is the most
economical and efficient flip-flop constructed in VLSI IC design.
• Other
Oth types
t off flip-flops
fli fl can be
b constructed
t t d byb D flip-flop
fli fl andd external
t l logic.
l i
• JK and T flip-flops are two other less used flip-flops.
• JK flip
flip-flop:
flop:
D = JQ’ + K’Q
T Flip-Flop
• T (toggle) flip-flop can be obtained from a JK flip-flop with J and K tied together.
• Can also be constructed with a D flip-flop and an exclusive-OR gate.
D = T ⊕ Q = TQ’ + T’Q Characteristic equation: Q(t+1) = TQ’ + T’Q
• Useful for designing binary counters.
NCNU_2013_DD_5_18
Asynchronous Inputs
• The state of the flip-flops is unknown when power is turned on.
• Asynchronous inputs are used to force the flip-flop to a known starting state
(initialization) independently of the clock.
clock
• Preset or direct set sets the flip-flop to 1.
• Clear or direct reset clears the flip
flip-flop
flop to 0.
• D flip-flop with asynchronous reset:
1
1
NCNU_2013_DD_5_19
State Equations
• Th
The behavior
b h i off a clocked
l k d sequentialti l circuit
i it can be
b described
d ib d algebraically
l b i ll by b
means of state equations; also called transition equations, specifies the next state
as a function of the present state and inputs.
• Example: 0-detector
two D flip-flops A and B
an input
i x and
d an output y
State equations:
A(t + 1) = A(t)x(t) + B(t)x(t)
B(t + 1) = A’(t)x(t)
t: Present
P t time
ti
t+1: Next time
Output:
y(t)) = [A(t)
y( [ ( ) + B(t)]x’(t)
( )] ( )
NCNU_2013_DD_5_21
State Table
• State table (also called a transition table) enumerates the time sequence of inputs,
outputs, and flip-flop states.
• The table consists of four labels: present state,
state input,
input next state,
state and output.
output
• List all possible binary combinations of present states and inputs.
State equations
S q are derived as:
A(t + 1) = Ax + Bx
B(t + 1) = A’x
Output equation:
y = (A + B)x
B)x’
similar to a K-map
p
NCNU_2013_DD_5_23
State Diagram
• Graphical representation of a state table
• Well matched with the second form of state table
• Each circle represents an assigned state
• Directed lines, indicate a state transition, are labeled with input/output
• In this example, every circle (state) has two outgoing directed lines to other circles
• A directed line connecting a circle with itself indicates that no change of state
occurs.
JA = B, KA = Bx’
JB = x’, KB = A’x + Ax’ = A⊕ x
• The above equations determine the flip-flop inputs to derive the next state
B( + 1) = x’’ B’ + (A ⊕ x)’
B(t )’ B = B’ x’’ + ABx
AB + A’ Bx’
B ’
The “Next state” can be derived from the above two equations.
• State diagram:
NCNU_2013_DD_5_28
State Assignment
• States must be assigned with unique coded binary values to implement the
physical components.
• For a circuit with m states, the assigned codes must contain n bits, where 2n ≧ m.
• Unused states (codes) are treated as don’t-care conditions during the design.
• Don’t-care conditions usually help in obtaining a simpler circuit.
• The simplest way to code states is to use binary counting code or Gray code
without
ih guaranteeing
i a better
b result.
l
• One-hot assignment, uses one flip-flop per state, ensures only one bit is equal to 1
while all others are kept at 0,
0 usually leads to simpler decoding logic for the next
state and output, results a faster machines, and the silicon area required by the
extra flip-flops can be offset by the area saved by using simpler decoding logic.
NCNU_2013_DD_5_37
Binary Assignment
• A different assignment will result in a state table with different binary values for
the states.
• Th
The binary
bi form
f off the
th state
t t table
t bl is
i usedd to
t derive
d i the
th nextt state
t t andd output
t t --
forming combinational logic part of the sequential circuit.
• The complexity
p y of the combinational circuit depends
p on the binaryy state
assignment chosen.
• Sometimes, the name transition table is used for a state table with a binary
assignment.
assignment
a
b
c
d
e
Excitation Tables
• The advantage of designing with D FFs is that the Boolean equations describing
the inputs to the flip-flops can be obtained directly from the state table, the input
equations are obtained directly from the next state.
state This is not the case for the JK
and T types of flip-flops.
• A state diagram flip
flip-flop
flop input functions
– straightforward for D flip-flops
– we need excitation tables for JK and T flip-flops
– a table that lists the required inputs for a given change of state.
+ +
NCNU_2013_DD_5_43
• Binary
y counters are constructed most efficiently
y with T flip-flops.
p p
+
• Three flip-flops A2, A1, and A0 are used.
NCNU_2013_DD_5_48
NCNU_2013_DD_5_49
Homework #5
• 5.6
• 5.8
• 5.10
• 5.12
5 12
• 5.16