Hardware Reference
In-Depth Information
Figure 8.20
Trafi c light controller. (a) Time-related specii cations. (b) Circuit ports. (c) Corresponding (simpli-
i ed) Moore machine.
8.11.5 Traffi c Light Controller
A classical timed application is described in this example, which consists of a trafi c
light controller.
The overall specii cations, summarized in i gure 8.20a, are as follows:
a) It must have three operating modes:
regular
,
test
, and
standby
.
b) Regular mode consists of four states of operation, called
RG
(red in direction 1 and
green in direction 2 turned on),
RY
(red in direction 1 and yellow in direction 2 turned
on),
GR
(green in direction 1 and red in direction 2 turned on), and
YR
(yellow in direc-
tion 1 and red in direction 2 turned on), each with an independent time duration.
c) Test mode must allow all preprogrammed times to be overwritten (by activating
a manual switch) with a small value (1 s per state), such that the system can be easily
tested during maintenance.
d) Standby mode, if set (by a sensor accusing malfunctioning, for example, or by a
manual switch), must have the system activate the yellow lights in both directions,
remaining so while the standby signal is active.
The circuit ports are shown in i gure 8.20b. The inputs are two switches, called
stby
and
test
, plus clock and reset. The standby switch selects between the regular mode
(
stby
= '0') and the standby mode (
stby
= '1'), and the test switch forces the system
into test mode when asserted (
test
= '1'). The output consists of six signals that control
the six trafi c lights (RYG in direction 1 plus RYG in direction 2).
A corresponding Moore solution is presented in i gure 8.20c. If the system is in
standby mode, the machine remains in state YY; otherwise, it circulates through states