# state machine how lights gonna controlled

Discussion in 'Homework Help' started by k31453, May 14, 2014.

1. ### k31453 Thread Starter Member

May 7, 2013
54
0
I am trying to create state machine about this specification :

For each of the following three scenarios, initially assume that the East-West traffic has had a green traffic light for a long time.

1) If a North-South car is detected then the traffic lights will cycle to green in that direction. The walk light will not be on unless a pedestrian is detected then the lights have finished cycling to Green.
2) If a North-south pedestrian is detected then the lights will cycle in a similar fashion but the appropriate walk light will be displayed for a short interval when cycling to Green.
3) If an East-West pedestrian is detected then the appropriate walk light will be displayed for a short interval before returning to East-West having a green light for traffic only.

> Once the lights have changed to green in a particular direction they:
1) Will remain green for minimum time before another change in possible,
2) Will remain green unless an input situation requires the lights to cycle i.e. the lights do not cycle between directions without cars and/or pedestrians being present.
> If a pedestrian wishing to cross with the traffic is present and a car/or pedestrian is present on the cross road then the lights will cycle before the 1st mentioned pedestrian is shown a walk light.
> The intersection is symmetrical-neither road has precedence. The description given above may be applied to the other direction with obvious substitutions being used.

Ok I am trying to do just basic intersection that involves 4 state machine as well as how light will operate. I know it is moore machine.
I attempt the table of how its gonna be done ...I am not sure if it is correct or not.

2. ### timwhite Member

Apr 10, 2014
50
7
Your state assignment table is correct. The next step will be a state transition diagram, in which you draw each state out and, as you said, format it as a moore machine, with a set output going to each next state.

Is your project asking for binary assignment values as well? If so, try to use some simplification techniques such as Quine-McCluskey algorithm to simplify your logic.