1. Vertailesemaforienja keskeytyseston käyttöä reaaliaikaisen sulautetun järjestelmän prosessien synkronointiprimitiiveinä.
Compare semaphore and interrupt disabling as synchronisation primitives for embedded realtime systems.
2. Optimoi (asteittain) seuraavaa binäärihaku-ohjelmaa suoritusajan suhteen olettaen, että ohjelmamuistia on käytettävissä riittävästi, ja että taulukon koko on 2000.
Optimise (stepwise) the following binary search program with respect to time assuming that there is enough program space and the size of the table is 2000.
3. Kuvaa *lyhyesti*, perustellen:
a) kellojen synkronointiprotokolla Tempo (4.3 BSD; Guzella & Zatti);
b) ilotulitusalgoritmi kellojen synkronointiin,
c) minkälaisiin vikaantumisiin niissä on varauduttu?
Define *briefly* the following concepts:
a) the clock synchronization protocol Ter-npo (4.3 BSD; Guzeiia & Zatti);
b) a fireworks synchronization algorithm for clock synchronization,
c) what kind of failures have been considered in them ?
4. Analysoi ja suunnittele OCTOPUS-mentelmän mukaan juoma-automaatti, josta voi valita soodavettä (50p) tai appelsiinilimonaadia (1 mk), joka toimii SOp tai 1 mk kolikoilla, ja joka ei osaa antaa rahasta takaisin. Markan voi antaa joko yhtenä kolikkona tai kahtena 5Op kolikkona. Anna esimerkki Käyttöesimerkistä (Use-case) , Järjestelmän lohkokaaviosta (Systems Context Diagram), Laitekaaviosta (Hardware Context Diagram), Objektimallista (Object Model), Ympäristö ja sovellusluokkien kuvauksista (Class Deschptions) Funktionaalisen mallin Operaatiokuvauksista (Operation Sheets) ja Dynaamisen mallin
Tapahtumakuvauksista (Event description, Classification and Sheets).
Analyse and design a drink-dispensing vending machine according to the OCTOPUS-method. One can choose either soda water (50p) or orange lemonade (1 mk), and the payment can be made using either 50por 1 mk coins. The machine cannot return change. One mark (1 mk) can be given either as one 1 mk coin or two 5Op coins. Deliver exampies of the foiiowing design documents: Use-case, Systems Context Diagram, Hardware Context Diagram, Object Model, Class Descriptions, Operation Sheets, Event description, Classification and Sheets.
5. Esitä Statechart-malli edellisen tehtävän jouma-automaatille. Kuvaa laitteen osaa, joka luovuttaa joko soodaveden tai limonaadin omana tilakoneenaan. Kuvaa mallisi toimintaa riittävästi, jotta se on ymmärrettävä.
Present a Statechart model for the vending machine in the previous task. Model the
operation of the part of the machine actually dispensing the drink as a separate state machine.
Describe the behavior of your machine enough to make it understandable.
procedure Binary(T: real; L,U: ArrPtr;
var P: ArrPtr);
begin
if L>U then
p 0
else
if T X[trunc( (L+U)/2)1 then
p = t runc ( (L + U) /2)
else if T < X[trunc( (L+U)/2)1 then
Binary(T, L, trunc( (L+U)/2)-1, P)
else
Binary (T, t runc ( (L + U) /2) + 1, U, P)
end;
Fragment 01. Initiai implementation of binary search.
To search an N-element table with the above procedure, we make the cali
Binary(T, 1, N, Position)