6 Flip Flops
6 Flip Flops
sequential circuits
© Luis Entrena, Celia López,
Mario García, Enrique San Millán
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
⚫ Characteristics
• Memory: it keeps the state if inputs are not active
• Asynchronous: the state changes inmediately if R or S are
activated
http://www. dte.uc3m.es
http://www. dte.uc3m.es
C /Q
0 Q
D
C D Q /Q
1
0 X Q /Q Keep state
/Q
1 0 0 1 Assign ‘0’
C
1 1 1 0 Assign ‘1’
http://www. dte.uc3m.es
Edge D Q /Q
detector
Clk
C /Q
Clk
Bad solution due to
Clk technology. Inverter
/Clk
C
delay is not
C controllable.
http://www. dte.uc3m.es
C C
Clk
Clk
⚫ QS changes only in
D clock rising edges
QM
⚫ QS new value is D
value just before the
QE clock edge
http://www. dte.uc3m.es
Clk
http://www. dte.uc3m.es
/Q
preset
clear
clear
Clk
http://www. dte.uc3m.es
http://www. dte.uc3m.es
D flip-flop T flip-flop
⚫ Transition tables D Q Q’ T Q Q’
D flip-flop T flip-flop
D Q E D Q’ E T Q’
T Q
E 0 X Q 0 X Q E
/Q 1 0 0 1 0 Q /Q
1 1 1 1 1 /Q
T
Q Q
D 0 E
1 D Q T Q
E
/Q /Q
http://www. dte.uc3m.es
D Q
E D 0
1 Q
/S E
D Q
/R
/S
/Q
/R
http://www. dte.uc3m.es
(treset mín)
clear
(tomín,t1mín)
clk
D
(tsetup,thold)
Q
Clk
Q
(tpClk,Q)
http://www. dte.uc3m.es
D Q D Q D Q
/Q /Q /Q
Clk
Reset
http://www. dte.uc3m.es
Clk
TClk > tpClk,Q + tcritical + tsetup
TClk
fClk = 1 / TClk
tpClk,Q tcritical tsetup
Example: TClk = 1ns → fClk = 1GHz
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
d q d q
clk c
ONLY SYNCHRONOUS
DESIGN
http://www. dte.uc3m.es
http://www. dte.uc3m.es
}
PROCESS (reset, clk)
BEGIN
IF reset = ‘1’ THEN Asynchronous part
(just initialization)
q <= ‘0’;
ELSIF clk’EVENT AND clk = ‘1’ THEN
}
IF enable = ‘1’ THEN
q <= d; Synchronous part
END IF;
END IF;
END PROCESS;
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
ENTITY jk_flip_flop IS
PORT ( reset: IN STD_LOGIC;
clk: IN STD_LOGIC;
j, k: IN STD_LOGIC;
q: OUT STD_LOGIC);
END jk_flip_flop;
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es
http://www. dte.uc3m.es