Академический Документы
Профессиональный Документы
Культура Документы
ENEL3DEH2
SEMESTER 2 2010
SR Latch
D Latch D Flip Flop SR Flip Flop JK Flip Flop
T Flip Flop
ENEL3DEH2
SEMESTER 2 2010
COMBINATIONAL LOGIC CIRCUIT The output values depend only on the current values of the signals applied to the inputs.
Output is a pure function of the present input only. Mostly implemented by Boolean circuits.
x1 xn
Combinational logic
z1 zn
x1 x2
z1
Examples
TV channel selector with no up and down buttons
ENEL3DEH2
SEMESTER 2 2010
Z0 Zm-1
Going to external
external
point
world
State
bits of seq. ckt.
Next
State
The STATE of a sequential circuit is a collection of state variables whose value at any time contain all the information about the past necessary to account for the circuits future behavior.
A circuit with k binary state variables has 2k possible state, which is called FINITE STATE MACHINE. m outputs only depend on k PS bits - Moore Machine m outputs depend on k PS bits AND n inputs - Mealy Machine
ENEL3DEH2 SEMESTER 2 2010
x1 xn
I/p from external point
x0 xn-1 yk-1
Combinational logic
z1 zn
Z0
Going to
external world
Zm-1
State
bits of seq. ckt.
y0
Current
State
ENEL3DEH2
Memory Unit
Next State
SEMESTER 2 2010
No flip-flops, only combinational gates No feedback Output for a given set of Inputs is independent of order in which these inputs were changed, after the output stabilizes.
Flip-flops may be used. Combinational gates may be used Feedback is allowed The order of input change is quite important and may produce significant differences in the output.
ENEL3DEH2
SEMESTER 2 2010
THE CLOCK
The state changes of most sequential circuits occur at times specified by a clock signal.
A clock signal is active high if state changes occur at the clocks rising edge or when the clock is HIGH. Otherwise, it is active low.
Clock circuits are triggered as level or edge triggered.
ENEL3DEH2
SEMESTER 2 2010
TYPES OF SEQUENTIAL CIRCUITS 1. Feedback sequential circuits Use ordinary gates and feedback loops to obtain memory elements (latches and flip-flops). In the circuit, the next stage is triggered by the completion of the previous stage without reference to a clock pulse.
2. Clocked synchronous state machines Use latches and flip-flops to create circuits that are regulated by a controlling clock signal. In the circuit, changes in output do not occur immediately when there is a change in input, but the next time there is a clock pulse.
ENEL3DEH2 SEMESTER 2 2010
Other Classification Two main types based on the times at which their inputs are observed and their internal state changes. Synchronous the behavior can be defined from the knowledge of its signals at discrete instants of time e.g. latches. Asynchronous the behavior depends on the inputs at any instant of time and the order in continuous time in which the inputs change.
More complex asynchronous sequential circuits are very difficulty to design their behavior depends highly on the propagation delay of the gates and the timing of the input changes.
Almost all digital design done today is synchronous sequential design.
ENEL3DEH2 SEMESTER 2 2010
BISTABLE ELEMENTS
ENEL3DEH2
SEMESTER 2 2010
BISTABLE
ENEL3DEH2
SEMESTER 2 2010
ENEL3DEH2
SEMESTER 2 2010
LATCHES AND FLIPFLOPS Latches and flips-flops are the basic building blocks of most sequential circuits. A flip-flop is a sequential device that samples its inputs and changes its outputs only at times determined by a clocking signal. A latch is a sequential device that watches all of its inputs continuously and changes its outputs at any time.
Level sensitive devices are often referred to as latches, while edge triggered devices are called flipflops.
ENEL3DEH2
SEMESTER 2 2010
LATCHES A latch is a memory element whose excitation input signals control the state of the device. Excitation inputs: those inputs are used to excite or drive the circuit into a desired state.
If a latch has an excitation input signal that forces the output of the device to 1, it is called a set latch.
If a latch has an excitation input signal that forces the output of the device to 0, it is called a reset latch. If the device has both set and reset excitation signals, it is called a set-reset latch.
ENEL3DEH2
SEMESTER 2 2010
S 0 0
Q Q0
Q0
Previous
0
1 1
1
0 1
0
1 0
1
0 0
Reset
Set Undesirable
Either S or R may be asserted to force the feedback loop to a desired state. Case 4: S= R=1, Q t+1= 0 , the case will be not allowed because it results metastable if S and R negative ENEL3DEH2 simulataneously..
B) Functional Table
SEMESTER 2 2010
t1 1 R 0 1 S 0 1 Q 0 1 Q
t2
t3
t4
t5
t6
t7
t8
t9
t10
0
Time
After S or R is negated, the latch remains in the state that it was forced into.
ENEL3DEH2 SEMESTER 2 2010
S-R METASTABLE BEHAVIOR The SR latch with NOR gates can enter metastable state if S and R negative simulataneously.
simulataneously S Forcing Q and Q to be 0 R Gate delay results in metastable
Q is 1 if the delay of Gate 1 is less than gate 2. Q is 0 if the delay of Gate 1 is greater than gate 2.
2 (a) Circuit
ENEL3DEH2
SEMESTER 2 2010
THE S - R LATCH
We will sometimes use S-R for ease of notation An S-R latch can be built with NAND gates. Case 1: S =1, R=1, Qt+1 = Qt the state does not change. ;
R R
(a) Logic diagram
S S
Case 2: S=0, R=1, Qt+1= 1, Set operation, Q output to 1. Case 3: S=1, R=0, Qt+1= 0, Reset operation, Q output to 0 Either S or R may be asserted to force the feedback loop to a desired state.
S 0 R 0 1
Q 1
Undesirable
0
1 1
1
0 1
1
0 Q0
0
1 Q0
Set
Reset Previous
b) Functional Table
ENEL3DEH2
SEMESTER 2 2010
S S
S R
Q Q
R
t1 1 R 0 1 S 0 1 Q 0 1 Q
R
t2 t3 t4 t5 t6
Q
t7 t8 t9 t10
Logic symbol
Forcing Q and Q to be 1
S
?
R
Gate delay results in metastable
Time
ENEL3DEH2
SEMESTER 2 2010
S-R LATCH WITH ENABLE An S-R latch is sensitive to its inputs at all times. It may be modified to be sensitive to these inputs only when an enabling input C is asserted. The circuit behaves like an S-R latch when C=1. It retains its state when C=0.
ENEL3DEH2
SEMESTER 2 2010
C 0 1 1 1 1 S x 0 0 1 1 R x 0 1 0 1 t (+ 1) Q(t) (no change) Q(t) (no change) 0 1 x
1 C 0 1 R 0 1 S 0 1 Q 0 Q 1 0 Time ? ?
ENEL3DEH2
SEMESTER 2 2010
D LATCHES Latches are needed to store bits of information. A D latch can be used for that purpose. The D latch can be built from an S-R latch.
This latch eliminates the troublesome situation in S-R latches, where S and R may be asserted simultaneously.
When C = 1, the latch is open and the Q output follows the D input. When C=0, the latch is closed. Input value D is passed to output Q when C is high Input value D is ignored when C is low
ENEL3DEH2
SEMESTER 2 2010
Y
D 0 1 X
ENEL3DEH2
1 1 0
Q 0 1 Q0
Q 1 0 Q0
X Y 0 0 1 1 X 0 1 0 1 X
1 1 1 1 0
D Latch x
E
D C
D (Data)
S
Q
Clk Q
D 0 1 X
1 1 0
Q 0 1 Q0
Q 1 0 Q0
(a) Circuit
t1
Clk D Q
Initial state
ENEL3DEH2
Time
SEMESTER 2 2010
SUMMARY OF LATCHES
S-R latches operate like cross-coupled inverters with control inputs (S = set, R = reset)
With additional gates, an S-R latch can be converted to a D latch (D stands for data) D latch is simple to understand conceptually When C = 1, data input D stored in latch and output as Q When C = 0, data input D ignored and previous latch value output at Q
ENEL3DEH2 SEMESTER 2 2010
FLIP FLOPS Latches respond to trigger levels on control inputs Difficult to precisely time when to store data with latches A latch is transparent its input value can be seen from the outputs. Due to the feedback in a sequential circuit the state may keep changing. Flip flips store data on a rising or falling trigger edge. They are edge triggered. Latches are level sensitive
Example: control input transitions from 0 -> 1, data input appears at output Data remains stable in the flip flop until next rising edge.
In a flip-flop before an output can change, the path from its input to output is broken. A flip-flop cannot see the change of its output.
ENEL3DEH2 SEMESTER 2 2010
D LATCH + CLOCKING = D FF
D C Q
S S
R R When C is high, D passes from input to output (Q) Clocking- output only changed on a C transition Positive edge triggered
D C Q Q
D 0 1 X
1 1 0
Q 0 1 Q0
Q 1 0 Q0
D C Q 0 0 1 1 X 0 Q0
Lo-Hi edge
Q 1 0 Q0
ENEL3DEH2
Hi-Lo edge
SEMESTER 2 2010
ENEL3DEH2
SEMESTER 2 2010
Qm
Qs
Q Q
Q Q
Clk Q
Clk Q
(a) Circuit
Clock
D Q
CLK
D
Qm Q = Qs
0 1
0 1
Initial
ENEL3DEH2
gate d
hol d
gate d
Pulse triggered
SEMESTER 2 2010
From the external observers point of view, the master-slave circuit changes its state at the negative-going edge of the clock. The negative edge is the edge where the clock signal change from 1 to 0.
Regardless of the number of changes in the D input to the master stage during one clock cycle (clock is 1), the observer of the Qs signal will see only the change that corresponds to the D input at the negative edge of the clock.
D Q Q
Q = D and (Clock )
ENEL3DEH2
SEMESTER 2 2010
Clocked D Flip-Flop D gets latched to Q on the rising edge of the clock. Input changes at other times have no effect on output
ENEL3DEH2
SEMESTER 2 2010
Positive and Negative Edge D Flip-Flop D flops can be triggered on positive or negative edge
Lo-Hi edge
ENEL3DEH2
Hi-Lo edge
SEMESTER 2 2010
ENEL3DEH2
SEMESTER 2 2010
ENEL3DEH2
SEMESTER 2 2010
J K CLK Q 0 0 1 1 0 1 0 1
K resets
J=K=1 -> invert output
ENEL3DEH2
Q0 Q0 0 1 1 0
TOGGLE
SEMESTER 2 2010
Characteristic Table
ENEL3DEH2
SEMESTER 2 2010
T FLIP FLOP
ENEL3DEH2
SEMESTER 2 2010
T FF
ENEL3DEH2
SEMESTER 2 2010
K resets
T=1 -> invert current
ENEL3DEH2
T C 0 1
Q0 Q0
TOGGLE
SEMESTER 2 2010
Asynchronous Inputs J, K are synchronous inputs o Effects on the output are synchronized with the CLK input. Asynchronous inputs operate independently of the synchronous inputs and clock o Set the FF to 1/0 states at any time.
ENEL3DEH2
SEMESTER 2 2010
Asynchronous Inputs
ENEL3DEH2
SEMESTER 2 2010
Asynchronous Inputs
ENEL3DEH2
SEMESTER 2 2010
Parallel Data Transfer Flip flops store outputs from combinational logic
ENEL3DEH2
SEMESTER 2 2010
Type
unclocked latch
clock high
positive edge FF
negative edge FF
master/slave FF
ENEL3DEH2
SEMESTER 2 2010
A characteristic table defines the logical properties of a flip-flop by describing its operation in tabular form.
48
ENEL3DEH2
SEMESTER 2 2010
Summary Flip flops are powerful storage elements They can be constructed from gates and latches! D flip flop is simplest and most widely used. Most FPGA families only have DFFs DFF is fastest, simplest (fewest transistors) of FFs. Other FF types (T, JK) can be built from DFFs Asynchronous inputs allow for clearing and presetting the flip flop output
Multiple flops allow for data storage The basis of computer memory!
Applications of FF: Data storage, Frequency division, Counting, etc
ENEL3DEH2
SEMESTER 2 2010