2.2 Step 2: Create a State Diagram

Once the state, inputs and outputs of the system have been determined, a state diagram can be drawn to illustrate how the system transitions between each state. Each state is represented as a circle with the name of the state inside. Each circle is connected by arrows showing how the state transitions will occur based on the inputs. The state diagram also shows the behavior of the outputs. This traffic light system is implemented as a Moore machine (Class 3 state machine), so the outputs are based solely on the state and are shown inside each circle below the name of the state. Figure 2-2 shows the completed state diagram.

Figure 2-2. Traffic Light State Diagram