Page 23 - DCAP608_REAL TIME SYSTEMS
P. 23

Real Time Systems




                    Notes          a channel. A uniformly-clocked signal x is implemented by the synchronous stream x. Streams
                                   are thus equivalent to signals:
                                   x(n) = x(n)

                                   y ( )n  y ( )n
                                   Unlike a signal, a stream has not one but two clocks. The write clock x, w , is the sequence of
                                                                                               x
                                   times at which stream values  become defined, in other words, the times at  which they are
                                   written to the stream’s channel. The read clock of x, r , is the sequence of times at which stream
                                                                             x
                                   values are consume, that is, read from the channel. Read and write clocks are in general non-
                                   uniformly spaced: they represent actual times at which certain events (reading from or writing
                                   to a stream) occur, not idealised times at which signal values occur.



                                     Did u know? While signal clocks are understood by the program, read and write clocks are
                                     solely for our own use in analysing and describing programs.

                                   Assume that the action of writing a value to or reading a value from a channel consumes an
                                   infinitesimally small amount of time. The read clock of a stream x must therefore be later than
                                   its write clock:
                                   r  > w
                                   x   x
                                   The relation between a signal’s clock and its stream’s clocks depend on whether the signal is
                                   internal or external. Consider an input signal x. Because its stream, x, is produced by the external
                                   environment, the signal clock is equal to the stream’s write clock:

                                   w  > t
                                    x  x
                                   For an output signal y, the stream’s read clock is equal to the signal clock:
                                   r  > t
                                   y   y
                                   Correct real-time operation hinges on the program responding appropriately to external signals.
                                   From equations, we have, for input stream x and output stream y,
                                   r  > t
                                   x   x
                                   and:
                                   w  > t
                                    y  y
                                   In other words, the program cannot attempt to read from an input stream too early, and must
                                   write to an output stream sufficiently early. The non- zero time difference between the read or
                                   write clock and the signal clock can be attributed to the time taken by the program to transfer a
                                   value between a signal and a stream (for example, the interrupt response time and the time to
                                   copy a value from a real-time input-output port into the channel).

                                   2.3.3 Functions and Systems

                                   A signal processing system with one input signal x and one output signal y is a function from x
                                   to y:

                                   y = f(x)
                                   A system is composed of functions, each with its own input and output signals. For example, the
                                   system consisting of two series-connected functions f and g is:

                                   y= f(g(x))



          18                                LOVELY PROFESSIONAL UNIVERSITY
   18   19   20   21   22   23   24   25   26   27   28