 Welcome to this session of the course computer programming. Today, we shall introduce ourselves to a special character called Mr. Budhuram Dumbo. First, let us look at what we discussed last time. We had seen that a computer can handle numerical values. More importantly, it can collect values as input. It can do some computations to produce new result values and it can give us the desired results as output values. It can operate only when a program is given to it. The program consists of a series of instructions. We also noted that a computer will first read and understand the entire program. Recall the technical word that we use, compilation or translation. So, this is a phase in which the computer reads and understand the entire program and then it executes the instructions of the program in specified order. We have invented a character and in this lecture, we are going to visit that character. His name is Mr. Budhuram Dumbo. Budhuram is a Hindi word which actually rhymes with Mr. Dumbo in English. It is a simpleton character. Not very intelligent, cannot think on his own. However, he can diligently perform the actions that he is capable of performing provided we give him instructions for doing each and everything. In short, Mr. Budhuram Dumbo does not do anything on his own. In order to carry out computations, Mr. Dumbo will require certain tools. We shall see what those tools are. More importantly, since Mr. Dumbo like a computer can execute a computer program, we must learn how to instruct Mr. Dumbo. In short, we will learn how to write a program for Dumbo. More specifically, we shall see the input, output and assignment instructions and finally, a declarative instruction which shall permit us to tell Mr. Dumbo that we are going to use such and such names in our program. This is Mr. Budhuram Dumbo. He is a line caricature of Mr. Dumbo. Here is a more solid form. He looks like a robo, but he is not a robo. He is a human caricature. So, let us see what Mr. Dumbo can do and what Mr. Dumbo cannot do. First and foremost, Mr. Dumbo has poor memory. So, even if we give him a number, Mr. Dumbo cannot remember that number in his head. He is perpetually confused. He does not carry any information inside his head. He is capable of doing things which he sees. He is capable of executing instructions which we give, but poor fellow cannot remember anything at all in his head. Now, Dumbo has to store numbers that we give him. He also has to store the numbers which he calculates. So, he will need some device to work as memory. We have given Mr. Dumbo a cupboard full of drawers. These drawers serve as memory locations for Mr. Dumbo. We will stipulate that each drawer can contain one value. Notice that these drawers have names A, B, C, D. These are arbitrary names by the way. They need not be alphabetical names like this. In fact, these are not the names which Dumbo chooses. These are the names which we shall choose to use in our programs. And Dumbo will merely affix those names to the drawers so that he can identify a particular drawer whenever we use a name in our instructions. Here is some kind of a caricature drawn in an animation mode. So, this is Mr. Dumbo. This Mr. Budhuram uses a set of drawers as I mentioned. So, notice these are the drawers. These do not have any names, but as in when we decide to use certain names in our program, Mr. Dumbo is capable of pasting those names as labels on these drawers. For example, A, Role, Height, F, Beta. Please note again that these names are of our choice and not of Mr. Dumbo's making. Dumbo has to collect input from us and provide output to us. In order to carry values which will be stored inside these drawers to us and to carry values from us to be stored inside these drawers, Dumbo uses a card. It is much like a luggage card except that Mr. Dumbo uses this to carry values which we give or which he has to give it to us. Here is a workbench that Mr. Dumbo has much like a scratch pad. You will notice register, register, register. These are not actually registers the conventional sense. These are like small piece of paper on which Dumbo can write values and Dumbo can do calculations using this workbench. So, this is more like the arithmetic or numerical capability of Mr. Dumbo. Obviously, in order to do any computations Dumbo must get numbers on to these registers from somewhere and if at all he calculates a result, Dumbo must be able to put that result back somewhere. That somewhere happens to be the memory which means that Dumbo is capable of picking out a number from the memory location designated by us on to these registers, do some calculations and put the result back into another designated memory location. Let us see an animation which shows Dumbo's tools. Here is Mr. Dumbo. He looks like a robo, but as I said he is a poor Dum human being who cannot think on it is own. He has to be instructed to do anything that we wish to do. He has a set of drawers which he uses as memory locations. These drawers can have names that we decide to give. Dumbo can examine a value inside a location. Dumbo can actually put a value inside a location or take a value out. Here is an example where Dumbo is bringing his cart with an input value. Here is his workbench which he uses to do some computations. These then are the tools that Dumbo has. Here is the cart to carry input and output values. Here is the covered with drawers, some of which will have names as we have decided them in our instructions. He can examine the values inside these drawers. He can put a new value inside and he can do computations using his workbench. Having seen Mr. Dumbo's tools, it is now necessary for us to understand how can we instruct Mr. Dumbo to use these tools to perform the desired computation. We will now design some instructions to be written for Mr. Dumbo. We know that we will have to give an input. So, let us say if we want to give an input value which we want Dumbo to keep in a name location x, we will write the following instruction input x. This means take a value from us and put it in the location for x. To give us an output value from a name location say y, we will write the instruction output y. In this case, Dumbo will examine the location y, will copy the value that the location contains and gives it to us. The most important operation that Dumbo is capable of carrying out is a computational operation. Let us say we want to perform a computation a minus b and whatever is the result value, we want to assign that value to another named location say r, which means we want to compute the value of a minus b and put the resulting value in the location for r. We decide that we will write this instruction as r is equal to a minus b. It is important to understand that this juncture that this is not a conventional equation, but rather an instruction to do some computations indicated by this a minus b formula, calculate a single result value and put it in the location for r. Let us examine this in some more details. This instruction actually is called an assignment instruction. r equal to a minus b is an instruction which performs two distinct sub tasks. One of the sub tasks deals with the calculations being carried out. What are the calculations in this assignment instruction? We want to find the difference between a and b. Well, these calculations are written on the right hand side of this equal to symbol. The other sub task is to put the calculated value in the desired location. So, these two sub tasks are written on two sides of the equal to symbol. Consider this equal to symbol here. There is a right hand side and there is a left hand side. The computational expression is written on the right hand side and the name of the destination location is written on the left hand side. So, this instruction is said to perform an assignment operation. It calculates the value a minus b and resulting value is assigned as a new value to location r. We will also need to tell Mr. Dumbo what kind of names and symbols we are going to use. We will use several names in our instructions a, b, r, etcetera. Now, Dumbo has to associate these names with specific drawers. It is important to tell Dumbo about all the names that we will use in our program. So, we now design a declaration instruction. A declaration instruction will, for example, say, use locations a, b and r. What the Dumbo will do while compiling our program is that it will figure out that we are using three names. It will choose any three drawers from his memory, put the label a on one drawer, put the label b on another drawer and put the label r on the third drawer. Once this labeling is done, Dumbo is now free to execute the actual instructions which it has to carry out. So, please note the difference between a declarative instruction and instructions such as input, output and assignment. A declarative instruction is looked at by Mr. Dumbo only while reading the entire program and understanding it. Whereas, the other instructions are actually executed when we ask Dumbo to carry out our program. Here is a program for Mr. Dumbo. Use locations a, b, sum, semicolon, input a, semicolon, input b, semicolon. Sum is equal to a plus b, semicolon, output sum, semicolon. Why do I write semicolon here? I could have written a full stop. I need not have written anything. The reason I have chosen a semicolon is to distinguish between one instruction and another. Two instructions which are written consecutively should be separated out by some symbol. Most programming languages in these days use a semicolon and that is the reason why we have decided that Dumbo should also be instructed using instructions which are separated by a semicolon. Notice that the first instruction is actually a declaration instruction which tells Dumbo that we are going to use three names in our program a, b and sum. The next two instructions are the executable instructions through which Dumbo will get a value for a and a value for b. The third instruction is an assignment instruction where the right hand side a plus b is calculated first by Dumbo and the single resultant value is assigned now to the location for sum. Finally, output sum instruction gives us the value of sum which was calculated here. Notice that this is a complete program and it will result in Dumbo finding out the sum of two numbers that we give him and we will get the result. In summary then we have introduced Mr. Budhuram Dumbo who has a set of drawers serving as memory locations, who has a card to carry input and output values and a work bench to perform computations. This looks like a simple model but very curiously you will find that this model is very close to the actual computer when we see the computer and its programs. We notice we have also defined how to write a program for Mr. Dumbo. Our program will consist of instructions. There are instructions that we have designed for Mr. Dumbo to collect an input value from us to give us an output value and more importantly to also do some computations and determine a new result value which Dumbo can assign to the named location. Finally, we have seen that we can give an instruction to Mr. Dumbo which is a declarative instruction which merely tells Mr. Dumbo that in our program we are going to use such and such names to represent different values. Thank you.