Basic Synchronous Clocks

Clocks and clocked discrete-time variable values are only defined at clock tick events for an associated clock and are undefined between clock ticks.

Synchronous clock-based modeling gives additional advantages for real-time and embedded system modeling in terms of higher performance and avoidance and/or detection of certain kinds of errors.To give a very simple example, in the model below the clock variable clk is defined with an interval of 0.2 seconds. This clock is used for sampling the built-in time variable, with result put in x and defined only at clock ticks. Finally the variable y is defined also between clock ticks by the use of the hold operator.