Skip to main content

SR flip-flop with tables, equation, timing

Short answer

An S-R flip-flop has S (set) and R (reset). S=R=0 holds; S=1,R=0 sets; S=0,R=1 resets; S=R=1 is invalid. Equation: Q+ = S + R'·Q (SR=0). Excitation: 0→0 S=0,R=x; 0→1 S=1,R=0; 1→0 S=0,R=1; 1→1 S=x,R=0.

Explain operation of S-R flip-flop with its logical diagram, characteristics table, characteristics equation, excitation table and timing diagram.

An S-R (Set-Reset) flip-flop is a clocked bistable circuit with inputs S and R. When the clock is active, S = 1 sets Q to 1 and R = 1 resets Q to 0; S = R = 0 keeps the old state; S = R = 1 is not allowed.

Logic diagram (clocked S-R using NAND gates)

          +------+  S*  +------+
 S -------| NAND |----->| NAND |-----> Q
 CLK --+--|  G1  |  Q'->|  G3  |
       |  +------+      +------+
       |  +------+  R*  +------+
       +--| NAND |----->| NAND |-----> Q'
 R -------|  G2  |  Q-->|  G4  |
          +------+      +------+
 G3 and G4 form a cross-coupled NAND latch.
      +---------+
 S ---| S     Q |--- Q
 CLK -|>        |
 R ---| R    Q' |--- Q'
      +---------+

Operation

G1 and G2 are steering gates; G3-G4 is an active-low NAND latch. (If CLK is replaced by the narrow pulse from an edge detector, this becomes the edge-triggered flip-flop shown by the symbol and used in the timing diagram below.)

  1. CLK = 0: G1 = G2 = 1, the latch holds: no change whatever S and R are.
  2. CLK = 1, S = 0, R = 0: G1 = G2 = 1, no change.
  3. CLK = 1, S = 1, R = 0: G1 = 0 makes G3 output 1: Q = 1 (set).
  4. CLK = 1, S = 0, R = 1: G2 = 0 makes G4 output 1: Q' = 1, Q = 0 (reset).
  5. CLK = 1, S = R = 1: G1 = G2 = 0, both Q and Q' become 1: invalid. When the clock goes low, the final state is unpredictable.

Characteristic table

SRQ (present)Q+ (next)Action
0000No change
0011No change
0100Reset
0110Reset
1001Set
1011Set
110?Invalid
111?Invalid

Characteristic equation

K-map for Q+ (rows Q, columns SR)
Q\SR   00  01  11  10
 0      0   0   x   1
 1      1   0   x   1
 Groups: S (columns 11,10)
         R'.Q (row 1, columns 00,10)
Qn+1=S+R‾ Qn,with S⋅R=0Q_{n+1} = S + \overline{R}\,Q_n, \qquad \text{with } S \cdot R = 0

Excitation table

QQ+SR
000x
0110
1001
11x0
  • 0 to 0: S = 0 (R may be 0 or 1).
  • 0 to 1: set, S = 1, R = 0.
  • 1 to 0: reset, S = 0, R = 1.
  • 1 to 1: R = 0 (S may be 0 or 1).

Timing diagram (positive edge triggered, Q initially 0)

       1   2   3   4   5   6
CLK   _|‾|_|‾|_|‾|_|‾|_|‾|_|‾|
S     ‾‾‾|___________|‾‾‾|____
R     _______|‾‾‾|_______|‾‾‾|
Q     _|‾‾‾‾‾‾‾|_______|‾‾‾|__

Q goes to 1 at the edge where S = 1, to 0 at the edge where R = 1, and does not change where S = R = 0.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 6 questions →