Skip to content
BetterDL

Self-loop

Also called: self-transition, self loop arrow, hold transition

An arrow in a state diagram that leaves a state and comes straight back to it: on that input, the machine stays in the same state.

A self-loop is a state transition whose start and end are the same state. It means "on this input, stay here".

Self-loops are easy to forget, because nothing visibly happens. But the machine still has to do something on every input, and a complete state diagram needs one arrow for each. Leaving the loop out makes the diagram incomplete: nobody can tell from the drawing what the circuit does.

They show up all the time:

  • a counter with count enable = 0 holds, so every state has a self-loop on E = 0;
  • a sequence detector for 110 stays in "seen 11" on another 1, because 111 still ends in 11;
  • a machine waiting for a button press loops in its idle state until the press arrives.

When tracing, a self-loop still counts as a step: the clock ticked, one input was used, the state just didn't change. In a mealy machine a self-loop can even produce an output of 1.

start01010101S00S10S20S31

Worked example

Example

Finding the self-loops

Look at the Moore 110 detector in the diagram (S0 = nothing, S1 = seen 1, S2 = seen 11, S3 = seen 110).

  1. 1.

    S0 on 0: a 0 doesn't start 110, so stay in S0. Self-loop.

  2. 2.

    S2 on 1: the last bits are 111, which still end in 11. Stay in S2. Self-loop.

  3. 3.

    S1 and S3 have no self-loops: every input moves them somewhere else.

  4. 4.

    Trace 1, 1, 1, 1: S0 → S1 → S2 → S2 → S2. Two of the four steps are self-loops.

Common mistakes

  • Leaving self-loops out of the diagram because "nothing happens".

  • Skipping a self-loop while tracing, which shifts every later state one input early.

Practice Self-loop

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

Learn it step by step

Self-loop is taught in Finite State Machines.