Professional Documents
Culture Documents
Ch.8 Flip-Flops and Related Devices
Ch.8 Flip-Flops and Related Devices
8 Flip-Flops and
Related Devices
Latch
Edge-Triggered and Master-Slave Flip-Flops
Flip-Flop Operating Characteristics
Flip-Flop Applications
One-Shots and the 555 Timer
Troubleshooting
Programmable Logic: Registered Operation
Latches and Flip-Flops Using VHDL
Introduction 2
Digital Logic
(1) Combinational Logic Circuit, (2) Sequential Logic Circuit
Latches, Flip-flops
RAM, etc.
X f Y=f(X,S)
n m
g
K
S
Storage Device Status S+=g(X,S)
Q : ‘1’ or ‘0’ Q
Latch / One-
flip-flop Q’ shot Q’ Clock
( 걸쇄 , 빗장 )
Input Output
Comments
S’ R’ Q Q’
0 0 1 1 Not allowed
0 1 1 0 Set
1 0 0 1 Reset
1 1 Q Q’ No change
S’: 1 1 1 1 • • • 1 0 1 0 0 • • •
No change R’: 0 1 0 1 • • • 1 1 1 1 1 • • •
+ T-flip-flop
Input Output
Comments
S R Q Q’
0 0 Q Q’ No change
0 1 1 0 Set
1 0 0 1 Reset
1 1 ? ? Not allowed
• A method of Edge-Triggering
Input Output
Comments
D Clk Q Q’
0 0 1 Reset
1 1 0 Set
Figure 8-20 A simplified logic diagram for a positive edge-triggered J-K flip-flop.
toggle
Figure 8-21 Transitions illustrating the toggle operation when J=1 and K=1.
Input Output
Comments
J K Clk Q Q’
0 0 Q Q’ No change
0 1 0 1 Reset
1 0 1 0 Set
1 1 Q’ Q Toggle
Ex 8-7)
Input Output
Comments JK
J K Q(t) Q(t+1)
Q(t) 00 01 11 10
0 0 0 0 No change
0 1 1
0 0 1 1 No change
11 1
0 1 0 0 Reset
0 1 1 0 Reset
1 0 0 1 Set
1 1 1 0 Toggle
Ex 8-6)
Ex 8-8)
toggle
master slave
Figure 8-28 Basic logic diagram for a master-slave J-K flip-flop.
Input Output
Comments
J K Clk Q Q’
0 0 Q Q’ No change
0 1 0 1 Reset
1 0 1 0 Set
1 1 Q’ Q Toggle
Figure 8-32 Propagation delays, preset input to output and clear input to output.
CMOS TTL
Parameter
74HC74A 74AHC74 74LS74A 74F74
tPHL(Clk to Q) 17 ns 4.6 ns 40 ns 6.8 ns
tPLH(Clk to Q) 17 ns 4.6 ns 25 ns 8.0 ns
tPHL(Clr’ to Q) 18 ns 4.8 ns 40 ns 9.0 ns
tPLH(Pre’ to Q) 18 ns 4.8 ns 25 ns 6.1 ns
ts(set-up time) 14 ns 5.0 ns 20 ns 2.0 ns
th(hold time) 3.0 ns 0.5 ns 5 ns 1.0 ns
tW(Clk HIGH) 10 ns 5.0 ns 25 ns 4.0 ns
tW(Clk LOW) 10 ns 5.0 ns 25 ns 5.0 ns
tW(Clr’/Pre’) 10 ns 5.0 ns 25 ns 4.0 ns
fmax 35 MHz 170 MHz 25 MHz 100 MHz
Power, quiescent 0.012 mW 1.1 mW
Power, 50% duty 44 mW 88 mW
Application Examples
1. Parallel Data Storage(register stores a word)
0
1
1
0
Figure 8-35 Example of
flip-flops used in a basic
register for parallel
data storage.
fin/2
fin/8
fin/4
Sol)
8KHz
4KHz
2KHz
1KHz
Sol)
Application Example
Monostable(one-shot) Operation
tW=1.1R1C1
f= 1.44/((R1+2R2)C1)
R2>R1, tH = 0.7(R2 + R1)C1 , tL = 0.7R2C1
T = tH + tL = 0.7(R1 + 2R2)C1
Duty cycle = tH/T = tH/(tH+tL) = (R1+R2)/(R1+2R2)100%
tH tH
tL tLt tL
L
Figure 8-53 Frequency of
oscillation as a function of C1
and R1 + 2R2. The sloped lines
are values of R1 + 2R2.
Sol) f= 1.44/((R1+2R2)C1)
= 1.44/((2.2k+2x4.7k)0.022F)
= 5.64 kHz
Duty cycle= (R1+R2)/(R1+2R2)100%
=(2.2k + 4.7k)/(2.2k +2X4.7k)100% = 59.5%
library ieee;
use ieee.std_logic-1164.all;
entity SRlatch is
port( S, R: in std_logic; Q, Qnot: inout
std_logic);
end entity Srlatch;
architecture Latch_Operation of SRlatch is
begin
process(S,R) is
begin
Q <= Qnot nor S;
Qnot <= Q nor R;
end process;
end architecture Latch_Operation;
Information Security Lab.
S-R latch to S-R Flip-flop 63
library ieee;
use ieee.std_logic-1164.all;
entity SRFlipFlop is
port(S, R, Clock: in std_logic; Q, QNot: inout std_logic);
end entity SRFlipFlop;
architecture FlipFlopBehavior of SRFlipFlop is
begin
process(S,R,Clock) is
begin
wait until rising_edge(Clock);
if S=‘1’ and R=‘0’ then Q<=‘1’;
elsif S=‘0’ and R=‘1’ then Q<=‘0’;
else Q<=Q;
end if
QNot<= not Q;
end process;
end architecture FlipFlopBehavior;
library ieee;
use ieee.std_logic-1164.all;
entity DFlipFlop is
port(D, Clock: in std_logic; Q, QNot: inout std_logic);
end entity SRFlipFlop;
library ieee;
use ieee.std_logic-1164.all;
package SRPackage is
procedure ActiveLowSRlatch(SNot, RNot: in std_logic;
Q, QNot: inout std_logic);
end SRPackage;
package body SRPackage is
procedure ActiveLowSRlatch(SNot, RNot: in std_logic;
Q, QNot: inout std_logic) is
begin
if SNot=‘1’ and RNot=‘0’ then Q:=‘0’; QNot:=‘1’;
elsif SNot=‘0’ and RNot=‘1’ then Q:=‘1’; QNot:=‘0’;
elsif SNot=‘0’ and RNot=‘0’ then Q:=QNot; QNot:= not Q;
end if -- not included “11: no changed” condition
end ActiveLowSRlatch;
Toggle replaces
end SRPackage; invalid S’-R’ condition
library ieee;
use ieee.std_logic-1164.all;
use work.SRPackage.all;
entity ActiveLowJK is
port(JNot, Knot, Clock: in std_logic; X, Y: inout std_logic);
end entity ActiveLowJK;
architecture JKBehavior of ActiveLowJK is J’ S’ Q X
V1
begin F/F
process(JNot, KNot)
variable V1, V2: std_logic; K’ R’ Q’ Y
begin V2
wait until rising_edge(Clock);
FF1: ActiveLowSRlatch(SNot=>JNot, RNot=>Knot, Q=>V1, QNot=>V2);
X<= V1;
Y<= V2;
end process; Procedure
end JKBehavior; call
buffer
library ieee;
use ieee.std_logic-1164.all;
entity Timer is
port(Enable, Clock: in std_logic; SetCount: in integer; Qout : buffer
std_logic);
end entity Timer;
architecture TimerCounter of Timer is
begin
process(Enable, Clock)
variable Cnt: integer;
begin
if(Clock’Event and Clock=‘1’) then
if Enable=‘0’ then
Cnt:=0; Qout<=‘1’;
elsif Cnt=SetCount-1 then Enable
Qout<=‘0’; SetCount Qout
else Clock
Cnt:=Cnt+1;
end if;
end if;
end process;
end architecture TimerCounter;
D flip-flop T flip-flops
Input Output Q(t+1) = D Input Output Q(t+1) = T’Q(t)
D Q(t) Q(t+1) T Q(t) Q(t+1) +TQ(t)’ = TQ(t)
0 0 0 0 0 0
0 1 0 0 1 1
1 0 1 1 0 1
1 1 1 1 1 0
Input Output
Comments JK
J K Q(t) Q(t+1)
Q(t) 00 01 11 10
0 0 0 0 No change
0 1 1
0 0 1 1 No change
11 1
0 1 0 0 Reset
0 1 1 0 Reset
1 0 0 1 Set
State Equation(J-K flip-flop)
1 0 1 1 Set
Q(t+1) = JQ(t)’ + K’Q(t)
1 1 0 1 Toggle
1 1 1 0 Toggle
How is it for S-R flip-flop?
+ T type
• Multivibrators
– Bistable(latches and flip-flops): two stable states
– Monostable Multivibrator(one-shot or single-shot): one
stable state, time Ext R and Ext C
– Astable Multivibrator(clock or oscillator): no stable state,
time Ext R and Ext C
• Latches: normally depends on asynchronous inputs
• Edge-triggered flip-flops
• Pulse-triggered master-slave flip-flops
• Asynchronous inputs for preset or clear the flip-
flops
• VHDL
– inout(a bidirectional port), wait until rising_edge(clock),
wait until falling_edge(clock), buffer(a port read and
updated)
• State equations and Excitation tables for flip-
flops(*)
Information Security Lab.
End of Chapter 8