Professional Documents
Culture Documents
JK Master-Slave Flip-Flop
A Flip-Flop is defined as two latches connected serially and activated with opposite
phase clocks
First latch is the Master; Second latch is the Slave
Eliminates transparency, i.e. a change occurring in the primary inputs is never reflected directly
to the outputs, since opposite phase clocks are used to activate the M and S latches.
Timing diagram:
In order to guarantee adequate time to get correct
data at the first inverter input before the input
switch opens, the data must be valid for a given
time (Tsetup) prior to the CLK going low.
In order to guarantee adequate time to set the latch
with correct data, the data must remain valid for a
time (Thold) after the CLK goes low.
Violations of Tsetup and Thold can cause metastability
problems and chaotic transient behavior.
Clock skew problems can be solved onchip by using buffering in clock nets
Inverter buffers to generate neg clk
Transmission gate buffers for true clk
D register timing:
Output Q valid at Tq (clock-to-Q) delay
after clock edge
Data must be valid Ts (setup time) prior
to clock edge and Th (hold time) after
clock edge
Shown below is a D Flip-Flop, constructed by cascading two D-Latch circuits from the
previous chart
Master latch is positive level sensitive (receives data when CLK is high)
Slave latch is negative level sensitive (receives data Qm when CLK is low)
R. W. Knepper
SC571, page 5-42
CVSL is a differential type of logic circuit whereby both true and complement inputs are
required
For example, true inputs are applied to left pull-down leg below and complement inputs are
applied to right leg
VLSI systems universally make use of storage elements and states, with clock(s) to
control the sequencing
(a) shows a Finite State Machine
at positive clock edge, the next state bits get stored as the current state bits and the current state
bits combined with inputs generate new next state bits
(b) shows a pipelined system indicative of todays microprocessors and logic systems
Tc = Tq + Td + Ts
Tq is the clock-to-Q output delay of Register A
Td is the total worst case delay through the combinational logic
Ts is the set-up delay time of Register B
Example:
Register M1 is set by the clock at Tc1,
providing data inputs to the combinational
logic and then to register M2
Register M2 is supposed to latch in old data
at the same clock edge
But, if the delay to Tc2 > Tc1 + Tq1 + logic
delay, M2 will incorrectly store the new
data rather than the previous data.
Latch Metastability
Consider the problem of setting a latch when the data is late and/or has a very long
rise/fall time and is still changing during the clock transition
if data change is delayed and overlaps clock edge (below), latch may set with new data
rather than valid prior data
Data delay = 2.2 ns latch sets correctly at Q=1
Data delay = 2.3 ns latch hangs momentarily at metastable point, but then sets correctly at Q=1
Data delay = 2.4 ns latch hangs momentarily and sets incorrectly at Q=0
Metastable point: non stable point in a latch where Vleft = Vright (neither 0 or 1)
thermal noise will cause latch to move off metastable point and set at a 0 or a 1
How to fix?
speedup the data (register-based synchronizer)
delay the clock (introduce an intentional clock delay ---- risky!!)
Why is the NAND-based D Flip-Flop shown at left edge-triggered and not level
sensitive?
There is no master latch
The two NAND gate pairs are clocked with opposite phase clocks, and therefore act similar to
the transmission gates in the TG-based D flip-flop
The 1st NAND pair is clocked with CLK
The 2nd NAND pair is clocked with CLK = CLK
Result:
Q changes on the positive-going CLK edge
NAND #1 pair locks in the valid data at the negative CLK edge
The master latch is essentially dynamic, holding the state as charge at the inputs of the two
inverters
Transistor Sizes:
W/L)M1 = 1
W/L)M2 = 0.5
W/L)M3 = 10
W/L)M4 = 1
T (Toggle) Register is shown below (note error in Weste & Eshraghian text)
Operation:
When clk goes up, output Q is complemented (and master latch is set)
When clk goes down, slave latch is set. No change occurs to Q
When clear goes high, QM is set to a 1 (Q to a 0)
Operation
Clock = 0:
Master latch is connected to input to receive new D data
Slave latch is holding previous data on output and is isolated from input
Clock = 1:
Master latch stops sampling input, latches up the D data at the positive clock edge, and sends it
through to the output Q
Examples:
(a) or (b) show simple transmission gate latch concept
(c ) tri-state inverter dynamic latch holds data on gate when clk is high
(d) and (e) dynamic D register