[MUSIC] The goal of this first lesson is to understand what we call a digital system. As a first step, we will try to define the more general concept of physical system. It's not easy, it's even impossible to give a general definition of what a physical system is. Nevertheless we can underline some of their important characteristics. We could say that physical systems are sets of interconnected objects, or elements, that realize some function and are characterized by a set of input signals, a set of output signals, and obviously some type of relation between input and output signals. Furthermore, every signal is characterized by its type. It could be a voltage, or a force, a temperature, and so on, and it is characterized by a range of values. In the case of a voltage, all the voltages between some minimum and some maximum value. Let us see a first example. It is a system that controls the working of a boiler used to heat a room. There are two input signals: The signal "pos" is the position of a selector that allows to define the desired temperature. The other input signal is "temp"; it is the value of the temperature, as measured by a sensor. There is an output signal "onoff" with only two possible values: on (gets started the boiler), and off (stop the boiler). In this example, the relation between inputs and outputs is defined by the following piece of program. It is a continuously executed loop, and it's easy to understand the control algorithm. First rule: if the temperature measured by the sensor is smaller than the temperature defined by the position of the selector minus some margin, let us say half a degree, then, the boiler must get started, and the "onoff" output signal must be equal to "on". A second rule: if the temperature is reater than the temperature defined by the position of the selector plus the same margin, then the boiler must get stopped, and the output signal must be equal to "off". If the temperature were between the position minus the margin and the position plus the margin, then the boiler state doesn't change. By the boiler state I mean: "running" or "not running". After that, wait for 10 seconds, and that's all. So that, with this control algorithm, the room temperature will be equal to the reference temperature with a precision of about one degree and with a response time maximum not much longer than 10 seconds. Which are the type and the range of the input and output signals? The signal "position" represents the selected position between two extreme values, for example between 10 and 30 Celsius degrees, so that its range of values is this one: any value between 10 and 30. Signal "temp" represents the ambient temperature, measured by the sensor. Assuming that the sensor is able to measure any temperature between 0 and 50 degrees, its value belong to this range of values. Finally, the "onoff" output signal has only two possible values: ON and OFF. Signals such as "position" and "temperature", that can take aany value within a continuous, and thus infinite, set of values, are called Analog Signals. Signals such as ONOFF, whose values belong to a finite set of values, in this case a 2-element set, are called Digital, or also Discrete Signals. Let us see a second example. The second example is the time computation component of a chronometer. It has four input signals. Three of them are generated by push buttons. Those signals are "reset", "start" and "stop". The fourth one is generated by an oscillator. It's a clock reference "ref", and it is a square wave, that is an electrical signal, with two values, for example, 0 volt and 1 volt, and with a period equal to 0.1 second. There are four output signals that control the chronometer display. Those signals are "h" that corresponds to the display of hours, "m" corresponding to the minutes, "s" corresponding to the seconds, and "t" corresponding to the tenths of seconds. In this example, the relation between inputs and outputs is defined in natural language. First rule: when the reset is pushed down, then the output signals, "h", "m", "s" and "t" must be equal to 0. Second rule: when "start" is pushed down, the chronometer starts counting, adding 0.1 second at every positive edge on the reference signal. By positive edge I mean: this is the reference signal; those are the positive edges. And the third rule: when "stop" is pushed down, the chronometer stops counting. So that, the signals "h", "m", "s" and "t" represent the latest elapsed time expressed in tenths of seconds. What about the types and ranges of this second example? In this case, all input and output signals are digital signal. Actually, "reset", "start" and "stop" are generated by push down buttons, so that their values are ON or OFF. The clock reference signal has only two values, 0 and 1 volt; "h"" has 24 values from 0 to 24; "m" and "s" have 60 values from 0 to 59, and "t"" has 10 values from 0 to 9. Systems of this type, I mean systems whose all input and output signals are digital signals, are called Digital Systems. We propose you an exercise. Try to describe the working of the chronometer in a more formal way. That is with a piece of program using instructions similar to those used to describe the boiler controller. For example: instructions such as "if some condition then do some operation, else do another operation", or "while some condition holds true loop and then a sequence of operations", or simply, a continuously executed loop. Furthermore, you could use a variable "ref_postive_edge" equal to "true" when there is a positive edge (I mean a 0 to 1 transition) on the signal "ref" (the clock reference), and equal to "false" in the contrary case, and you could also assume that a procedure "update", with parameters "h", "m", "s", and "t", that adds a tenth of second to the current elapsed time, has been previously defined. Here is an example of solution. It's a continuously executed loop. Then, first rule: if signal "reset" is on, then "h", "m", "s", and "t" must be equal to 0. If "reset" is not on, but "start" is on, then, here we have another kind of loop that says that while (as long as) stop is off, then if there is a positive edge on the reference signal, then update the chronometer state, and nothing else. Summary of this first lesson: we have seen the definition of Digital Signal and of Digital System. For that, systems are considered as black boxes with their inputs and output signals and with some type of relation between inputs and outputs that define their behavior. Two examples of input-output specification have been shown using pieces of program, also called pseudo-instructions.