4: Develop a state machine diagram for a traffic light controller that works as follows: A timing signal T is the input to the controller. T defines the yellow light interval, as well as the changes of the red and green lights. The outputs tothe signals are defined by the following:GN Green Light, North/South SignalYN Yellow Light, North/South Signal RN Red Light, North/South SignalGE Green Light, East/West SignalYE Yellow Light, East/West SignalRE Red Light, East/West SignalWhile T 0 the green light is on for one signal and the red light for the other. With T 1, the yellow light is on for the signal that was previously green, and the signal that was previously red remains red. When T becomes0, the signal that was previously yellow becomes red, and the signal that was previously red becomes green. This pattern of alternating changes in color continues. Assume that the controller is synchronous with a clock that changes much more frequently than input T 5: Develop a C++ program that demonstrates the behavior of the circuit in question 4. The code should be submitted as a CPP file or a link to the online IDE.