Latches & Flip-Flops: EE 2730 Fall 2010
Latches & Flip-Flops: EE 2730 Fall 2010
Latches & Flip-Flops: EE 2730 Fall 2010
Combinational-Sequential
No memory Present o/p depends on present i/p Telephone dialer TV remote channel no. Money changer
Remembers the past Present o/p depends on present and past i/p Telephone redial TV remote channel up/dn Vending machine
A Simple Memory
0 1 0
Stable Configuration
feedback
1 0 1
d Data TG1
q Output
TG2
d Data TG1
q Output
TG2
d Data TG1
d Output
TG2
Activated sensor sets alarm on Even when sensor ceases to be activated, alarm is on Need to reset alarm to turn it off Alarm remembers that sensor was triggered after it was last reset
EE 2730 - Fall 2010
Qa
Qb
S R 0 0 1 0 1 0 1
Qb
0 q q 0
q
Qa
S R 0 0 0 1 0 1
q
Qb
1 1
q
Qa
q
Qb
0
Qa
S R 0 0 0 1 0 1
1
Qb
1 1
0
Qa
S R 0 0 1 0 1 0 1
0 0
1 1 1 0
Qb
Qa
0 0 1
Qb
0
Qa
S R 0 0 1 0 1 0 1
0
0
S Qb
R
0 1 S 0 S R 0 0 1 1 0 1 0 1 Qa Qb 0/1 0 1 0 1/0 1 0 0 no change reset set ? 1 Qa 0 1 Qb 0 Time ? ?
Qa
1 0 0
1 ns
0
t1 1 t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
1
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
1 0 0
1 ns
0
t1 1
no change
t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
1
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
1 0 1 0
1 ns
0
t1 1 t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
0 1
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 0 1
1 ns
0 1
t1 1
set
t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
0
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 1 1 0
1 ns
1
t1 1
no change
t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
0
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 1 0
1 ns
1 0
t1 1 t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
0
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 0 0
1 ns
0
t1 1
reset
t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
0 1
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
1 0 0 1
1 ns
0
t1 1 t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
1 0
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 0 1
1 ns
0
t1 1 t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
0
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
1 0 0
1 ns
0
t1 1 t2 t3 t4 t5 t6 t7 t8 t9 t 10
Qb
1
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 0 0 1
1 ns
0 1
t 10 1
Qb
0 1
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
1 0 0 1 0
1 ns
1 0
t 10 1
Qb
1 0
R
0
1
S R 0 0 1 1 0 1 0 1 Qa Qb 0/1 0 1 0 1/0 1 0 0 no change reset set ?
1 S 0 1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 0
0
t 10 1
0 1
1 ns
Qb
0
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Qa
0 0
0
t 10 1
0 1
1 ns
Qb
0
R
0 1 S 0
S R 0 0 1 1 0 1 0 1
1 Qa 0 1 Qb 0
1 ns
Time
Not in text
EE 2730 - Fall 2010
Timing Diagram
Gated SR Latch
S R 0 0 1 1 0 1 0 1
S, R Bad notation
Gated SR Latch
S R Latch
S
Q
S R 0 0 0 1 1 0 1 1
Q(t+1) 1 0 Q(t) Q(t+1) 1 0 Q(t) undefined mode set reset no change undefined mode set reset no change
S
Q
Clk
0 0 0 1 1 0 1 1 S R 1 1 0 0 1 0 1 0
Q
R
Gated D Latch
S R
Q(t+1)
1 1 0 0
1 0 1 0
1 0 Q(t)
Minimum times around falling edge of clock when D should be stable Figure does not show propagation delay
EE 2730 - Fall 2010
Edge Triggering
clk
Level triggering
Edge triggering
clk
Master-Slave D Flip-Flop
Master D Clock D Q Qm Slave D Q Qs Q Q Clk Q Clk Q
One way to implement an edge-triggered flip-flop Uses level triggered device (latch)
EE 2730 - Fall 2010
Master-Slave D Flip-Flop
Master D Clock D Q Qm Slave D Q Qs Q Q Clk Q Clk Q
Clock
Master-Slave D Flip-Flop
Master D Clock D Q Qm Slave D Q Qs Q Q Clk Q Clk Q
Clock
D
Qm
Master-Slave D Flip-Flop
Master D Clock D Q Qm Slave D Q Qs Q Q Clk Q Clk Q
Clock
D
Qm Q = Qs
Master-Slave D Flip-Flop
Master D Clock D Q Qm Slave D Q Qs Q Q D D Q Q Q Q Clk Q Clk Q
Clock
D
Qm Q = Qs
Edge-Triggered D Flip-Flop
Recall the S-R latch
S
Q
S R 0 0 0 1 1 0 1 1
Edge-Triggered D Flip-Flop
1 P3
D
P1 5 Q
Clock
Clock P2 6 Q
P4
Output changes to value of D when clock changes from 0 to 1 No change in output at any other time Positive edge triggered D Flip-Flop
Edge-Triggered D Flip-Flop
1 P3
D
P1 5 Q
Clock
Clock
D
3 P2 6 Q 0 1
Q (t + 1 ) 0 1
Characteristic Table
D 4 P4
P1
1 0
Clock
no change
1
3
P2
no change
d
D
Setup time : time needed to get values at P3 and P4 = sum of delays of gates 4 and 1
4 P4
d
EE 2730 - Fall 2010
P1
1 0
Clock
d
d
3 P2 6 Q
d
D
P4
d
EE 2730 - Fall 2010
1 0
Clock
d
d
3 P2 6 Q
d d d
D 4 P4
d 1
EE 2730 - Fall 2010
d x
P1
d 1
no change d
1 0
Clock
1 d
3
1 d
P2
no d change
d x or d
D
P4
d or 1 x
EE 2730 - Fall 2010
Level/Edge Positive/Negative
Clock D Q Qc D Q Qc D Q Qb Clk Q Qa D Q Qa
Q Qb
Clock D Qa Qb Qc
EE 2730 - Fall 2010
Level/Edge Positive/Negative
Clock D Q Qc D Q Qc D Q Qb Clk Q Qa D Q Qa
Q Qb
Clock D Qa Qb Qc
EE 2730 - Fall 2010
Level/Edge Positive/Negative
Clock
Q Qc
D Q Qc
Q Qb
D Q Qb
Clk
what if ?
D Q Qa
Q Qa
Clock D Qa
Q1 Q 0 Q0 Q 1
Asynchonous causes change at any time (regardless of the triggering edge of the clock) Synchronoues causes change only at the triggering edge of the clock
EE 2730 - Fall 2010
Clear
When (Preset) = 0, show that Q = 1 and Q = 0 When (Clear) = 0, show that Q = 0 and Q = 1 When (Preset) = (Clear) = 1, show that there is no effect of these inputs
EE 2730 - Fall 2010
1
D Clock
1
Q
Preset D
Q
Q
Clear
Clear
When (Preset) = 0, show that Q = 1 and Q = 0 When (Clear) = 0, show that Q = 0 and Q = 1 When (Preset) = (Clear) = 1, show that there is no effect of these inputs
EE 2730 - Fall 2010
Preset
1
Q D Q
1
Clear
When (Preset) = 0, show that Q = 1 and Q = 0 When (Clear) = 0, show that Q = 0 and Q = 1 When (Preset) = (Clear) = 1, show that there is no effect of these inputs
EE 2730 - Fall 2010
Synchronous clear
Clear
D Clock D Q Q
Not respecting set-up and hold times can cause metastability Propagation time has max and min
EE 2730 - Fall 2010
T-Flip-Flop
T D T Q Q Q Q Q Q
Clock
T 0 1
Clock
no change toggle
T Q
T-Flip-Flop
T D T Q Q Q Q Q Q
Clock
T 0 1
no change toggle
Characteristic Table
JK Flip-Flop
J D Q Q Q Q J Q
K
Clock
J K Q ( t + 1) 0 0 1 1 0 1 0 1
Q (t) 0 1 Q (t )