The SR Flip-Flop – Practical Introduction

This post is used for discussion in class.

In class demonstration

Teacher draws a SR latch using NOR gates  with top gate as g1 and bottom gate as g2.

R-S: animated SR latch (R-S flip-flop) made from two cross-coupled NOR gates, with inputs R and S and outputs Q and Q’

Teacher draws a truth table for quick reference:

ABA NOR B
001
010
100
110

  • Scenario, Circuit Startup S=0, R=0 , Q=0  (Q’ is irrelevant and can be proven in a later scenario)
    • Input G2 becomes 0,
    • Q’ becomes 1
    •  Input G1 becomes 1
    • Q stays at 0 , circuit is stable in a consistent state.

  • Scenario: circuit in previous state, S becomes 1, r stays at 0, Q was 0 and Q’ is 1



  • Scenario: Same as previous state,  however S returns to 0.
    (Memory is Achieved)

  • Same as previous State, but R is set to 1


  • Same as previous state but R returns to 0

  • CHAOS!!! S and R set to 1.

Interactive: step through the SR latch

Now it is your turn to be the teacher! Below is a live version of the NOR latch above. Flip S and R, use Step by step mode to follow the signal through G1 and G2, take the guided tour through the same scenarios as the list above, and then read the timing diagram that your own switch presses draw.

Play with the SR latch

This is the same latch as in the diagram above: two NOR gates, with the top gate (G1) making Q and the bottom gate (G2) making Q’. Each output is fed back into the other gate. Flip S (Set) and R (Reset) and watch what happens.

Key: wire = 1 (high)   wire = 0 (low)   unknown (?)

SR latch made from two cross-coupled NOR gates G1NOR G2NOR R S 0 1 0 0 R Q’ Q S Q = 0 Q’ = 1 Q Q’ Feedback: Q goes back into G2, Q’ goes back into G1
Mode:
NOR gate reference
ABA NOR BUsed by
001
010
100
110

G1: A = R, B = Q’
G2: A = S, B = Q

What the signals are doing:
    Current state

    Hold

    SR latch truth table (NOR version)
    SRQ (next)Q’ (next)State
    00Q (no change)Q’ (no change)Hold (memory)
    0101Reset
    1010Set
    1100Invalid (forbidden)

    The highlighted row matches the switches right now.

    Guided tour: the class scenarios

    Tip: switch to Step by step mode first, then press Next to watch each gate work in turn.

    Timing diagram

    Every time the switches change, a new time slot is added. Drag the slider (or tap a slot) to move the cursor: the circuit above jumps to that moment.

    How to read a timing diagram
    • Time runs left to right. Each column (t0, t1, t2…) is one moment, one after the other.
    • High means 1, low means 0. When a line is at the top of its row the signal is 1; at the bottom it is 0.
    • Read straight down. Pick one column (or use the cursor) and read down the S, R, Q and Q’ rows to see every signal at that same moment.
    • Edges are changes. A vertical jump in a line is an edge: going up is a 0 → 1 change (rising edge), going down is 1 → 0 (falling edge).
    • Q only changes when S or R tells it to. Look for an S pulse (Q goes high) or an R pulse (Q goes low). When S and R are both 0, Q stays flat: that flat line is the latch’s memory.
    • Normally Q’ is the mirror image of Q. Wherever the two lines are NOT opposites, something is wrong.
    • Spot the invalid region. The red-shaded slot is where S = 1 and R = 1: Q and Q’ are both 0. The amber slot after it is the race when both are released together: the result is unpredictable.
    The SR latch characteristic table

    A NOR gate’s truth table only needs its two inputs. A latch is different: it is a memory element, so what happens next depends on the inputs and on what it is already storing. A characteristic table shows this. It lists S, R and the present state Q(t) (the value of Q before the change) and gives the next state Q+ (the value of Q after the latch settles).

    SRQ(t)Q+ (t+1)Action
    0000Hold
    0011Hold
    0100Reset
    0110Reset
    1001Set
    1011Set
    110XInvalid
    111XInvalid

    • How to read a row: pick the S and R values, then the value Q had before. The Q+ column tells you what Q will be next. For example, the row S = 0, R = 1, Q(t) = 1 says: “Q was 1, we pressed Reset, so Q becomes 0.” The highlighted row follows the switches above (and the timing cursor).
    • Why S = 0, R = 0 gives Q+ = Q: with no Set or Reset signal, each gate is kept where it is by the output fed back from the other gate. So Q+ simply copies Q(t): if it was 1 it stays 1, if it was 0 it stays 0. That is the latch’s memory (Hold).
    • Why S = 1, R = 1 is marked X: both NOR gates are forced to 0, so Q = Q’ = 0, which breaks the rule that Q’ is the opposite of Q. And when both inputs are released together the gates race, so the next Q cannot be predicted. We mark it X (forbidden) and never use it.
    • Where the equation comes from: look at the rows where Q+ = 1. Either S = 1 (Set), or S = 0, R = 0 and Q(t) = 1 (Hold a 1). Ignoring the forbidden rows, Q+ is 1 when “S is 1, OR R is 0 AND Q is 1”. Written in Boolean algebra that is Q+ = S + R’Q, with the rule SR = 0 (S and R are never both 1).

    Q+ = S + R’Q (with SR = 0)

    Quick check

    Try it

    Use the switches above. Before each press, predict what Q will be, then check! The ticks fill in by themselves.

    • ✓Set the latch (Q = 1), then turn S back to 0 and show that Q remembers 1.
    • ✓Reset the latch (Q = 0), then turn R back to 0 and show that Q remembers 0.
    • ✓Go into the forbidden state (S = 1, R = 1), then press Release S and R together and watch the race. Try it a few times: is Q always the same?

    Challenge question: looking at your timing diagram, can you find a time slot where S = 0 and R = 0 but Q = 1? Explain why that can happen.

    Attributions to media used in this post:

    • R-S.gif – No machine-readable author provided. Arturo Urquizo assumed (based on copyright claims) – CC BY 3.0 (via Wikimedia Commons)

    Updates

    2026/10/21

    - Added an interactive SR latch step-through and timing diagram with a how-to-read guide.

    © 2021 islandclass.org

    Leave a Reply