The British government is concerned about the speed of cars using motorways. In the future,…
The British government is concerned about the speed of cars using motorways. In the future, beacons will be set up at regular intervals along all motorways; they will continuously transmit the current speed limit. New cars will contain computers which will monitor the current speed limit and inform the driver when he or she exceeds the limit. One car currently being designed (the York mobile) already has the necessary hardware interfaces. They are as follows.
0 Each car has a ‘speed control’ 16-bit computer which has memory-mapped 1/0, with all I/O registers 16 bits in length.
0 A register located at octal location 177760 interfaces to a device which monitors the roadside beacons. The register always contains the value of the last speed limit received from the roadside beacons.
o A pair of registers interface to an intelligent speedometer device which checks the speed of the car against a set limit. If the speed limit is broken, the device generates an interrupt through octal location 60. The priority of the interrupt is 5. This interrupt is repeated every 5 seconds until the car is no longer speeding.
o The register pair consists of a CSR, and a data buffer register (DBR). The structure of the CSR register is shown in Table 14.2. The CSR register may be both read from and written to, and resides at address octal 177762. The DBR register simply contains an integer value representing the car’s speed limit to be set. If this value falls outside the range 0 — 70 then an illegal limit has been specified, and the device continues with the current limit. The address of the DBR register is octal 177764. 9 A flashing light (on the car dashboard) can be turned on by setting the register, located at octal address 177750, to l. The light will flash for 5 seconds only. A zero value turns the light off.
Design an Ada and Real—Time Java device driver which will implement the following speed control algorithm. Every 60 seconds the current speed limit should be read from the roadside beacon by the speed control computer. This value is passed unchecked to the speedometer device which interrupts if the car exceeds the set speed limit or if the speed limit is illegal. If the car exceeds the limit then the dashboard light should be flashed until the car returns to the current limit.