CS 3SD3. Sample solutions to the assignment 1.
Total of this assignment is 150 pts. Each assignment is worth 11% of total.
If you think your solution has been marked wrongly, write a short memo stating where marking in
...
CS 3SD3. Sample solutions to the assignment 1.
Total of this assignment is 150 pts. Each assignment is worth 11% of total.
If you think your solution has been marked wrongly, write a short memo stating where marking in
wrong and what you think is right, and resubmit to me during class, office hours, or just slip under
the door to my office. The deadline for a complaint is 2 weeks after the assignment is marked and
returned
1.[10] For each one of the following three processes, give the Finite State Processes (FSP)
description of the labelled transition graph.
Solution:
a.[2] PERSON = (weekday -> sleep -> work -> PERSON
|weekend -> sleep -> (shop -> PERSON | play -> PERSON)
).
1b.[4] A = (a -> B | b -> C)
B = (a -> B | b -> D)
C = (a -> E | b -> C)
D = (a -> B | b -> D)
E = (a -> E | b -> C)
c.[4] A = (d -> B)
B = (a -> A | b -> C | c -> A)
C = (a -> A | c -> A)
2.[20] A miniature portable FM radio has three controls. An on/off switch turns the device on
and off. Tuning is controlled by two buttons scan and reset which operates as follows.
When the radio is turned on or reset is pressed, the radio is tuned to the top frequency of
the FM band (108 MHz). When scan is pressed, the radio scans towards the bottom of the
band (88 MHz). It stop scanning when it locks onto a station or it reaches the bottom
(end). If the radio is currently tuned to a station and scan is pressed then it start to scan
from the frequency of that station towards the bottom. Similarly, when reset is pressed the
receiver tunes to the top. Model the radio as a FSP process RADIO. Also provide an
appropriate labelled transition system.
Hint: The alphabet of RADIO is {on, off, scan, reset, lock, end}.
[Show More]