Latches and flip flops

Set-reset (SR) latch


SR latch using NAND gates

NAND SR latch

SR latch using NOR gates

NAND SR latch

Clocked SR latch (using NAND gates)

Clocked SR latch
Truth table
ClkSRQ
100No change
010
101
11Invalid
0No change

Chatterless switch

Chatterless switch

JK flip flop


Basic JK FF

(Jack Kilby) JK flip flop
Truth table
ClkJKQQ New
100No change
0100 (NC)
0110 (Q'→1)
1001 (Q→1)
1011 (NC)
1110 (Q'→1)
1101 (Q→1)
0No change

Master-slave JK FF

(Jack Kilby) JK flip flop
Truth table
ClkJKQQ New
0Master: NC; MLat → SLat
1Slave: NC
1 → 000MLat → SLat
010 (S=0, R=1)
101 (S=1, R=0)
111 0 (S=0, R=1)
110 1 (S=1, R=0)
Active clock edge: 1 → 0 (falling)

D FF with asynchronous preset and clear

JK MS FF with async present and clear

D FF with synchronous preset and clear

JK MS FF with sync present and clear

Residual problem with above DFF
  1. Let the gate delay be Δ
  2. Let D=0, Clk=1
  3. Let D=1 and just before Δ time, Clk=0
  4. Master latch has the invalid input combination of 00
  5. Before valid inputs could appear at the steering gates of the master latch, Clk=0
  6. Now, invalid input combination of 11 is presented to the slave steering gates, with Clock'=1
  7. Slave latch has the invalid input combination of 00
  8. Output of DFF is indeterminate
Problem may be avoided if D remains steady when Clk=1, allowed to change only when Clk=0

T FF with preset and clear

Similar to DFF, but J and K terminals tied (J=K=1)

JK MS TFF with sync present and clear

Huffman model


Schematic diagram

Huffman model

Setup and hold times

Setup time
It is defined as the minimum amount of time before the active clock edge by which the data must be stable for it to be latched correctly; any violation in this required time causes incorrect data to be captured and is known as a setup violation
Setup path diagram
Time available for data at D2 to reach D1 after active clock edge
Tclk + Tskew - Tsetup
Time needed for date to reach D1 from D2 after active clock edge
Tc2q + Tcomb
Resulting constraint
Tc2q + Tcomb Tclk + Tskew - Tsetup

Tc2q + Tcomb + TsetupTclk + Tskew

Hold time
It is defined as the minimum amount of time after the active clock edge by which the data must be stable for it to be latched correctly; any violation in this required time causes incorrect data to be captured and is known as a hold violation
Minimum time for data at D2 to reach D1 after active clock edge
Tc2q + Tcomb
Time for data to remain steady at D1 after active clock edge
Tskeq + Thold
Resulting constraint
Tc2q + TcombTskeq + Thold

Example for setup and hold times

Setup path diagram

Positive clock edge triggered DFF

Positive clock edge triggered DFF
Transition table
CDRS RΔSΔQΔ
011Q
1011010
111101
01010
10101
00101

Types of sequential m/cs

Moore m/c
Outputs depend only on the present state
Mealy m/c
Outputs depend on the present state and also on the inputs (transducer)

Both are computationally equivalent


Shift register

Shift register

Barrel shift/rotate

Shift register

Synchronous up/down counter

Sync up/down counter

Up counting

Sync up/down counter -- counting up

Down counting

Sync up/down counter -- counting down