Exercises 6.




Q1. Design a traffic light controller for a set of highway traffic lights controlling a farm road. In the absence of any cars waiting on farm road the highway should re main green. If any cars detected at either entry point to the farm road stop line \`C\', we wish the highway light to cycle through yellow to red and farm road lights to turn green. The farm road lights are to remain green only while the detectors signal the presence of a car but never longer than some fraction of a minute. The farm road lights then to cycle through yellow to red and highway lights to turn green. The highway lights not to be interrupted again by the farm road traffic until some frac tion of a minute has passed.

Q2.Design a FSM that controls the tollbooth on a highway as follows: a) Initially the tollbooth is idle, with its gate lowered (and the proceed signal off, S='O'). b) When a car enters the tollbooth, a pressure sensor detects the car and passes a signal to the controller, A='1'. c) The controller then awaits the correct toll signal (correct money is inserted) when money is inserted,C=' 1' then the controller will raise the barrier and turn the light green, S= `1'. d) When the car exits the tollbooth A= `0' the controller enters the idle state.

Q3. Design an up counter to count 4 clock pulses and output `1' on the 4th clock pulse. The circuit is provided with a reset to put it in the reset state.

Q4. Design a sequence detector that detects a sequence of two consecutive `0' or two consecutive `1' on a serial input line.