The purpose of "Scratch VHDL" is to make reprogrammable logic design into child's play. Sounds ambitious.
These come in two variations, the standard junction and the Pelican Crossing. An integer is used as the state variable again, but the state machine now uses inputs to intervene in (or control) the linear sequence. The next state to move to is now specified manually rather than by a counter.
We’re now getting much closer to a classical Finite State Machine.
Create the correct pattern of lights for starting and stopping, each operated by a push button.
Reference: Highway Code [PDF]
Similar to the above, but implement the flashing amber light sequence. Again with start
and stop
buttons.
Reference: Flashing amber traffic lights (www.passmefast.co.uk)
Both of these are implemented with a finite state machine (FSM) like the Knight Rider demonstration. This time the start
input moves away from the red stop light to the green proceed light, and the stop
input moves away from the green to the red. So this FSM makes use of input buttons to control the progress of the state transitions. The incr
is included in all transitions and is internally generated.
Output decoding based solely on the state variable’s value.
state | leds(3:0) |
Comment |
---|---|---|
0 | “0001” | |
1 | “0011” | |
2 | “0100” | |
3 | “0010” | |
4 | “1001” | Includes the lane filter light |
5 | “0011” | |
6 | “0100” | |
7 | “0010” |