Hardware Reference
In-Depth Information
Figure 8.12
Circuit that feeds a blinking light (an LED, in this case). (a) Circuit ports. (b) Commercial LEDs
and typical usage. (c) Moore-type solution.
8.11.1 Blinking Light
This example is simple enough and yet very illustrative of the general behavior of
timed FSMs. It concerns a circuit that must turn a light on and off, remaining on
during
T
1
clock periods and off during
T
2
clock periods. An important desired feature
is that when the circuit is enabled it must start from a state with the light on (to
prevent the user from thinking that the circuit is not working when large transition
times are involved).
The circuit ports are depicted in i gure 8.12a. The input comes from a switch called
ena
, which enables the circuit when asserted. The output is a port called
light
that
feeds a light-emitting diode (LED).
Figure 8.12b shows examples of commercial LEDs and their typical usage. An LED
consists of a PN junction fabricated, for example, with gallium arsenide (GaAs). It
emits light when forward biased, as shown on the right of i gure 8.12b, which also
shows a current-limiting resistor,
R
. The emitted radiation can be in the infrared spec-
trum (used, for example, in remote controls) or in the visible spectrum (used, for
example, in alphanumeric displays and as signaling lamps in all sorts of equipment).
To radiate in the visible spectrum, other materials must be added to GaAs, such as
aluminum, in AlGaAs (red light), or phosphorus, in GaAsP (red or yellow light). Other
materials are used to obtain radiations at higher frequencies, such as zinc selenide
(ZnSe) for blue LEDs.
A Moore-type solution is presented in i gure 8.12c. It has three states, called
stop
(not blinking, with light off),
on
(circuit enabled, with light on), and
off
(circuit
enabled, with light off). Note that while the switch is closed (
ena
= '1') the circuit l ips
back and forth between states
on
and
off
, staying
T
1
clock periods in the former and
T
2
clock periods in the latter. Note also that when
ena
is asserted the machine moves
immediately (at the next positive clock edge) from state
stop
to state
on
; likewise, when
enable is turned off, the machine moves immediately to state
stop
.
This machine falls in the situation depicted in i gure 8.4b, so it can be implemented
with either timer control strategy (#1, section 8.5.2, or #2, section 8.5.3).
An interesting aspect of this machine is that it might not need a reset signal at all,
depending on the chosen encoding scheme (for example, sequential or Gray) and on