Question: ( a ) Design a timed process with the following behavior: 1 . Within any 1 0 second interval, the process must receive 2 events

(a) Design a timed process with the following behavior:
1. Within any 10 second interval, the process must receive 2 events of type
A. Receiving a second A exactly 10 seconds after the first A is okay, but
receiving it after 10 seconds is bad. If it does not receive two As within
10 seconds, it goes to an error state and stays there forever.
2. Within any 20 second interval, it must receive 3 events of type B, otherwise
it goes to an error state. If any two B events are more than 10 seconds
apart, it goes to an error state. If it goes to an error state, it stays there
forever.
3. Let n be a positive integer. At each 20n seconds, the machine remembers
the number of As and Bs received in the interval [20(n 1),20n].
4. For all n, at some time in [20n+1,20n+2] the process outputs the number
of As and Bs received in the interval [20(n 1),20n] on the output OUT.
(b) Consider an execution where the process never goes to an error
state and the process receives an A exactly when it starts. Let t denote the
time when it receives the second A, u1 denote the time when it receives the first
B and u3 the time when it receives the third B. What are the minimum and
maximum values for u1 t and u3 t?
(c) Suppose the user promises that at most one A event is input in
any 5 second window and that any two B events will be separated by at least
1 second. What is the largest number of A and B events that may be reported
on OUT?
(d) Design a timed process that ensures the users promise in (c). In
other words, this process must produce at most one A event is output in any 5
second window, and it must ensure that two B events are separated by at least
1 second.
(e) How would you change the timed process in (d) so that the
composition of the two timed process guarantees that the timed process in (a)
never reaches an error state?
(f) Can you build the process in (e) such that the
composition of the two timed process has the largest number of executions that
do not hit the error state?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!