Version 2
The second version, controller2, is intended for a pedestrian crossing. There
are three lights for traffic (green, amber, and red) and also two lights for the
pedestrian (wait and walk). There are two input bits: a reset pushbutton, and
a walkRequest which is 1 when a pedestrian presses the Walk pushbutton.
Normally the outputs indicate green/wait. However, when the walkRequest
button is pressed, the traffic light changes to amber, and then the traffic light
changes to red and the pedestrian light turns to walk for three clock cycles. Then
the system displays amber/wait and then returns to its normal state green/wait.
Furthermore, the traffic engineers want to know how often the walkRequest
button is pressed. To measure this, there is a 16-bit counter walkCount. When
the Reset button is pressed, the value of WalkCount is set to 0 at the next
clock tick. When the walkRequest button is pressed, walkCount should be
incremented at the next clock tick.
To summarise, the inputs are: reset (a pushbutton) and walkRequest (a
pushbutton). The outputs are: green, amber, red, wait, walk (each is 1 bit),
and walkCount (a 16-bit binary integer).
You may notice that the specification of the problem doesn’t say what to do
in a few subtle situations. For example, what should happen if the walkRequest
button is pressed when the system is in the red/walk state? You may adopt
any reasonable policy you like for these situations. In the real world, you (the
engineer) might go back to the customer to discuss what to do. It is common
for the requirements of a project to evolve during the implementation. Actually,
that’s one of the reasons that good engineering includes making your solution
maintainable as well as correct.
The point of this exercise is to gain some experience with a simple control
circuit, and to use some of the building block circuits. The exercise as described
doesn’t account for some real world issues, which you can ignore:
• In the real world, the reset button and the walkCount display would be
hidden inside the box containing the electronics, while the walkRequest
button would be out where a pedestrian could see and press it, and the
various light outputs would control the actual light bulbs.
• In the real world the clock cycles would be too short, so each light would
be held for a larger number of clock cycles. For example, the amber phase
might last for a million cycles and green/red would be correspondingly
longer.
Work in small groups
This assessed exercise should be carried out in a small group consisting of two
to three students. Any amount of discussion and shared work within the group
is fine, and the product you hand in counts fully for each member of the group.
One member of the group should submit the exercise on Moodle. As stated
below, the submission must identify all the members of the group, not just the
one who submitted it.
To get started, talk to fellow members of the course, and organise your group.
Please email the lecturer with the names and matriculation numbers of everyone
2