Skip to content
BetterDL

Set and reset

Also called: set/reset, set-reset, setting and resetting

To set a storage element is to make its stored bit 1; to reset (or clear) it is to make the bit 0, whatever its previous value was.

Two words you will see on almost every storage element:

  • Set: force the stored bit to 1.
  • Reset (also clear): force it to 0.

Both are absolute: they give the same result whatever Q was before. That makes them different from hold (keep Q) and toggle (flip Q), which depend on the present value.

Where they appear:

  • SR latch: S is set, R is reset, and they act immediately.
  • JK flip-flop: J = 1, K = 0 sets and J = 0, K = 1 resets, at the clock edge.
  • Preset and clear pins: an asynchronous set and reset that act without waiting for the clock.
  • Synchronous clear in a register: a reset that waits for the next edge.

Setting a bit that is already 1 changes nothing you can see, and the same goes for resetting a 0. That is why you should look for the most recent set or reset when predicting a latch's output.

A naming note: "reset" sometimes means the whole-system reset that puts every register into a known starting state. That usually means clearing most bits and setting a few, as with a power on reset.

Worked examples

Example

Absolute versus relative rows

Two JK flip-flops, one at Q = 0 and one at Q = 1, receive the same (J, K) at an edge. For which pairs do they end up equal?

  1. 1.

    (1, 0) set: both become 1. Equal.

  2. 2.

    (0, 1) reset: both become 0. Equal.

  3. 3.

    (0, 0) hold: they stay 0 and 1. Different.

  4. 4.

    (1, 1) toggle: they become 1 and 0. Different.

  5. 5.

    Only set and reset are absolute: they ignore the starting value.

Example

Reset when already reset

A NOR SR latch holds Q = 0. R is pulsed to 1 and back while S stays 0.

  1. 1.

    R = 1 is the reset row: Q = 0.

  2. 2.

    Q was already 0, so nothing visibly changes.

  3. 3.

    Set and reset name the result, not a change.

Common mistakes

  • Thinking set means "change". Set means "make it 1", which may be no change at all.

  • Assuming every reset is asynchronous. A synchronous reset waits for the clock edge.

Practice Set and reset

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Set and reset is taught in Latches and Flip-Flops.