[MUSIC] So in one of the earlier videos, we introduced a model of a finite-state machine. And we argued that there was no time associated to the machine. One way to associate time is to actually interconnect it with an ADC. Let's consider the following example, which corresponds to the implementation of a finite-state machine in a computer, where now the signal is obtained from an analog to digital converter. In that setting, one would have the finite-state machine. And the input to the finite-state machine will be connected to the, Analogue to digital converter. So here, we have the input to the converter and we have its output. And the input to the machine is v and the output is theta. Let's consider a simple machine, a machine that is without guards. And that is the terministics of the transition function, the terministic. So in this piece of the model, you will have a state, q, which takes values from a discrete set. A transition function delta, that depends potentially on the state and on the input to the machine. On the other hand, we have here the dynamics of the ADC, which we introduced in a previous video as well. So this is the input, this is the memory, And we also have a timer. The interconnection such as the following type of model, when, An event occurs, And in this case, corresponds to tau s = Ts star. Sample the input vs, store it In, ms and update, q according, To delta. In between events, Let tau s count time, And keep the other states ms and q constant. These are the two tasks that we would like to, Implement in our system. And since we know the model for this system and we know the model for this system, we already can see how the events will be essentially the conditions that will trigger the use of a difference equation. And that when those do not occur, then the variables such as tau s ms and q should not be affected, while tau s should change according to ordinary time, and ms and q should be constant according to the laws. So we can dive into the model. We can actually say from this description from what we know that the events are going to be when tau s = Ts star, where Ts star is the parameter that defines. The rate, Of conversion. So here, we're going to put difference equations for all the variables that play a role into the system. We are looking at an interconnection here. So the state ms and tau s and the state q will remain when we do interconnection. So we need to come up with a update for ms, and for tau s and for q. In a similar way when there are no events, which is when tau s belongs to this range, But would actually let the variables change continuously according to their own dynamics. Now, the change of the variable ms should correspond to a trivial differential equation ms = 0, while the variation of tau s should correspond to tau s adult = 1. Now, since q shouldn't change in between events because it's a logic variable of a finite-state machine that in principle didn't have continuous change, you should have a derivative that is equal to 0. In a similar way, whenever an event occurs, since our tasks are saying that we need to sample the input, we will have that ms is reset to vs. But we will have that since the timer expire, we need to reset the timer. And we will now reset the logic variable discrete state of the finite-state machine according to the transition function. Now, because the input has been assigned through the interconnection, To ms, Then when we evaluate, Our transition function, we cannot write v, but rather we'll write ms, Okay? This will correspond to the system model. So this is my whole system now. Its input is equal to the input to the converter, so vs. And the output here, we can say that this theta as well even though we can add more output if we will. This will correspond to these full implementation of a finite-state machine with an ADC. And then you can see again that we had started with a discrete time system, which is an FSM. Once we add the sampling mechanism to provide the inputs to the machine, we are adding these continuous dynamics because of the events being triggered every so often. And that leads to a combination of differential equations with different equations with constraints. Well, in particular, this is the condition corresponding to the events triggering mechanism, in this case, for conversion and for update of the finite-state machine. One should notice that the information used to update the state of the machine is not the current information, but is the value of the input that was stored in the previous event. And that actually can be changed by pretty much removing the memory state of the system, and then putting here directly, vs in the case, that you don't have that memory. And you can use the current value of the input to trigger the machine. That model will not need again the memory state ms, and it will be without the ones that delay effect. [MUSIC]