Information Technology Reference
In-Depth Information
the flow associated with the clock holds a value at the present instant of time.
Actually, any expression exp in the language has its corresponding clock clk ( exp )
which indicates whether the value of the expression at the current instant is
dierent from
.
Besides external flows (input/output flows), which determine the interface
of the
?
program with its environment, also internal flows are used and
manipulated by the program. Consider the following
Signal
Signal
program DEC:
process DEC=
( ? integer FB
! integer N
)
(| N:= FB default (ZN-1)
| ZN:= N $ init 1
| FB^=when (ZN<=1)
|)
where
integer ZN init 1 ;
end
Program DEC (standing for \decrement") has an input FB and an output N,
both declared as integer variables. Now and then, the environment provides a
new input via variable FB. Receiving a new positive input, the program starts
an internal process which outputs the sequence of values FB, FB-1,
,2,1via
output variable N. After outputting 1, the program is ready for the next input.
This program illustrates the capability of a multi-clock synchronous language to
generate a new clock (the clock of the output N) which over-samples the input
clock associated with FB. The program uses the local variable ZN to record the
previous value of N.
The body of DEC is composed of three statements which are executed con-
currently as follows. An input FB is read and copied to N. If N is greater than 1
it is successively decremented by referring to ZN, which holds the previous value
of N (using $ to denote the \previous value" operator) . No new input value for
FB is accepted until ZN becomes (or is, in case of a previous non-positive input
value for FB) less than or equal to 1. This is achieved by the statement
:::
FB^=when (ZN<=1),
whichisread\the clock of FB is on when ZN
1", and allows FB to be present
1. When the clock of FB is o, the default action of assigning
N the value of ZN -1 is activated. A possible computation of this program is:
8
:
only when ZN
9
; !
8
:
9
; !
8
:
9
; !
8
:
9
; !
8
:
9
; !
8
:
9
; !:::
FB :
?
FB : 3
N:3
ZN : 1
FB :
?
N: 2
ZN : 3
FB :
?
N: 1
ZN : 2
FB : 5
N:5
ZN : 1
FB :
?
N: 4
ZN : 5
?
ZN : 1
N:
Where
?
denotes the absence of a signal. Note, that
Signal
programs are
not expected to terminate.
Search WWH ::




Custom Search