CSE 403 Homework #2

Due: Monday, April 27, in class

 

1. Consider the Petri net in Figure 5.23 on page 181 in the text (producer-consumer).

(a) Describe the marking of the net after each transition in the firing sequence: <produce, write, produce, read, consume>.

A marking can be described by listing the places containing tokens; for example, the initial marking in the net is (c1, 0, p1).

(b) Give the first five (5) transitions of another firing sequence, starting from the same initial state, that differs from the transitions of (a). Describe the marking after each transition.

2. Let two activities or processes A1 and A2 share a CPU and memory. There are two blocks of memory. A1 repeatedly executes the sequence:

Get CPU; Get 1 block of memory; Perform action A11;

Get 2nd block of memory; Perform action A12; Release CPU and memory.

A2 repeatedly executes:

Get CPU; Get 1 block of memory; Perform action A21;

Release CPU and memory.

Draw a Petri net that models this system. Show an initial marking with all of the resources available, and both activities ready to start their cycles.

3. Let Update and Read be two actions that are performed by several processes in parallel. Each action is bounded by start and end events; for example, _Update is the start event for the Update action. Update actions must be mutually exclusive with respect to each other and with respect to Read actions. Express these constraints in real time logic (RTL).

4. An alarm clock has the following behavior:

When the alarm event occurs, i.e., the clock "goes off", a bell will ring for either 30 seconds or until the stop button is pressed, whichever happens first.

Express this behavioral property in real-time logic (RTL).

Let AC, BELL, and STOP be the names of the alarm event class, bell ringing action, and stop button event, repectively.