[MUSIC] In the first lesson we have defined what a digital system is. In the second lesson, we are going to present several methods of specification of the digital system. The specification of the working of the digital system can be done in a functional way, describing the relation between inputs and outputs, but without information about the internal structure. Furthermore, we will make a distinction between explicit functional description and implicit functional description based on an algorithmic description. Let us start with an example of explicit functional description. For that, consider again the boiler controller with two modifications. The desired temperature that is the value of the pos signal is assumed to be a constant equal to 20 celsius degrees. And the measured temperature has been discretized. So that the temp input signal values belong to this set from 0 to 50. Then with those modifications the working of the controller can be described in a completely explicit way by a table that for each value of the term In particular, gives the value of the on off output signal. If temp is between 0 and 19, then or on off is equal to on. If temp is between 21 and 50, on off is equal to off. And if temp is equal to 20, then the state of the boiler, running or not running doesn't change. Now the same specification could be expressed by where we've seen a piece of program. If temp is less than 20 then onoff is equal to ON. Else if is temp is greater than 20, then onoff is equal to OFF. It's a program equivalent to the previous statement and this is an example of implicit functional description by means of an algorithm. Let us see a second example. A systems that adds to 2-digit number x. And Y, a two digit number. So they belong to the set 0,1,2 and so on, up to 99. And the other computes the sum Z=X+Y. So that the output, Z belongs to the set 0, 1, 2, and so on up to 198. And the result is a 3 digit number. The simple, the classical pencil and paper algorithm works as follows. Consider an example, we add 37 and 68, then we say 7 plus 8 equals 15, I write here 5, and we carry one to the next step. After I compute 1 plus 3 plus 6 is 10, I write here 0 and then carry equal to 1. And finally I get the result 105. So we can describe the working of the circuit by means of the following algorithm. The initial carry is 0. Then I add the three number, x0, the less significant bit of x, y0, the less significant bit of y, and a carry, equal to 0. Then if the result of the sum is greater than 9, I must subtract 10 and put the carry that will be sent to the next step, equal to 1. On the contrary case s0 is the output digit corresponding to this first of the computation and carry sent to the next step is = zero. And the second part of the algorithm is the same, but with the most significant digit of X and Y and using, in this case the carry that counts from the preceding step. Finally, the third digits of the result is the carry generated during the last step of the algorithm execution. This is an example of functional description by means of an argument. The second way a digital system can be specified is by description of its internal structure based on the use of previously defined subsystems. That we will call components. Let us see an example. We are going to describe a 4-digit adder. For that we assume that a 1-digit adder has been previously defined. It is accompanied with two decimal inputs, x and y. So that x and y belong to the set 0 to 9. And y binary input carried in belonging to the set 0,1. These components compute x+y+carry in whose maximum value is 9+9+1=19. So that the result of this computation is a two digit number. And the result will be expressed with two output signals carry out equal to 0 or 1 respond to the most significant digit of the result nz. That may be any value between 0 and 9. Then with this component, we can define the structure of a 4-digit adder. Actually, the structure of the 4-digit adder corresponds to the pencil and paper addition method. Each 1-digit adder, this one for example computes the set of two decimal digits plus an incoming carry and expresses the result as an output decimal digit and an outgoing carry. Which is transmitted to the left component. Observe that the maximum value is this one, 19,998. That is to say a 5 digit number was more significant digit is equal to 0 or 1. This 1 will carry out of the last step of the addition. The previous example uses four available component, the 1-digit adders. The 1-digit component, the 1-digit adder could in turn, could be defined by its function. For example, by the following piece of program. This is an example of a 2-level hierarchical description. The first level is a structure of the circuit with four components, and the second level is the functional description of the 1-digit adder. Let us see an example of 3-level hierarchical description. Consider a system that computes the sum z of 3 four digit numbers. You can say that the maximum value is this one, so the result is a five digit number whose most significant number is 0, 1, or 2. The first hierarchical level is a circuit made up of two different components. A four-digit adder like the one we described before, and a five-digit adder. Then both the four-digit adder and a five-digit adder can be described using one-digit adders. This is a second hierarchical level. Finally, a one-digit adder, can be defined by its function. For example, the same is a program as before, and this is the third hierarchical level. To summarize, an hierarchical description is a set of interconnected blocks. Every block, in turn, can be described by its function or by a set of interconnected blocks, and so on, up to the last level. Then the final blocks must correspond to available components defined by their function. So the summary of this second lesson, we have given example description, structural description and hierarchical description.