



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Instructions Answer any THREE questions. Note: Question 1 = 34 marks. All other questions = 33 marks. Real-Time systems Reference Booklet Available
Examiners: Dr. J. Creagh Dr. M. O Cinneide Mr. M. Donnelly
Q1. Write an ADA program to solve the following real-time problem: Sensors : Sawdust Level, Button, Temperature Actuators : DustExtractor, Saw An industrial saw is used to cut timber. It is managed by a real-time system. A tray under the saw table is used to collect saw dust. The level of saw dust is monitored by a saw dust level sensor. If the sensor indicates a level 1, then the saw and dust extractor must be turned off immediately. A dust extractor operates when the saw is turned on (by pressing the button). The dust extractor remains operating for 2 minutes after the saw is turned off (by pressing the button). A temperature sensor on the saw is used to avoid equipment overheating and also to avoid possible fire or smoke damage. If the temperature is greater than 90, then the saw and dust extractor must be turned off immediately.
The button must be monitored every 100ms with a deadline of 20ms. The saw dust level sensor indicates a reading between 0..1 and must be monitored every 300ms with a deadline of 20ms. The temperature sensor indicates a reading between 0.200 and must be monitored every 200ms with a deadline of 50ms. For actuators (saw, dust extractor) 1 = ON, 0 = OFF.
Note (1): Do not write the code for the protected object called STATUS. Assume that this object is available, and is used to store saw dust level, button and temperature values. To access/update a value, assume methods WriteSawDustLevel, ReadSawDustLevel, WriteButton, ReadButton, WriteTemperature and ReadTemperature are available (with standard parameters).
Note (2): A register called ‘CSR’ controls the hardware. Refer to the reference booklet. A second register ‘READING’ is provided for reading a value from a sensor. A third register ‘WRITING’ is provided for writing a value to an actuator. (34 marks)
Q2. (a)^ Define the terms
(b) Draw a diagram of a “generalised embedded computer system”. Referring to real-world examples, structures, software and the physical nature of the environment, justify why your diagram represents a “generalised embedded computer system”. (9 marks)
(c) Regarding testing, simulation may be required.
(d) (i) Compare the design methodologies of ROPES, HRT-HOOD and Petri-Nets. (11 marks)
(ii) In your opinion, which methodology is most suitable for developing a small real-time system. Justify your answer. (3 marks)
(c) Consider the following execution sequences:
(i) Describe the OCPP scheme. Illustrate with the aid of a time-line diagram for the above execution sequence. (6 marks) (ii) Describe the ICPP scheme. Illustrate with aid of a time-line diagram for the above execution sequence. (6 marks)
Note: E = Execution for a clock period Q = Execution with resource Q for a clock period V = Execution with resource V for a clock period
Q5. (a) Explain the CAN mechanism via an example: 4 nodes U, V, W and X each transmit a single message at the same time; however, the priorities of the messages are 13 for U, 7 for V, 4 for W and 5 for X. Briefly, describe how CAN works with reference to the above example. (8 marks)
(b) (i) For distributed systems, a global time model may be based on physical time. Describe an implementation of this scheme and give a clear example. (6 marks)
(ii) Regarding a global time model based on physical time, referring to an operating system such as OS-9, explain
Process Priority Execution Sequence Release Time P 1 4 (highest) EQQQE 5 P 2 3 EVVVE 3 P 3 2 EEE 2 P 4 1 EQQQVE 0
(c) Illustrate your understanding of the “Byzantine Generals Problem” with an example of 4 generals. General 1 (G1) decides on retreat (R). General 2 (G2) decides on attack (A). General 3 (G3) decides on retreat (R). General 4 (G4) is a traitor and indicates retreat (R) for G1, wait (W) for G2 and retreat (R) for G3 and G4. (6 marks)
(d) (i) Describe the AED algorithm, which may be used for real-time databases. Give an example with your own data. (5 marks)
(ii) Describe the elevator algorithm, which is modified for real-time databases. (4 marks)