Hello everyone, welcome to this course, "Computer Sciences and its Foundations" This course will be divided in 4 sections: first, we'll talk about binary coding, then algorithmic, programming, and finally computer architecture and networks. So first, the binary coding section. In this section, we will have 4 parts. The first part will be about studying how information is represented as bits. But first of all, why code information? There are lots of information around us, it can be pictures, sounds, noises, temperature, how much money is in our wallet, our age, dates, etc., lots of different things. Very different things, more or less structured, that will be received either by our human senses, or by tools. The question is, how can that information be represented so that they can be stored in a computer? To do that, it will be digitalized, digitally coded, that means translating it in numbers that will then be given to the computer. At electronics level, what actually happens inside computers, is that there is an electrical current that can either pass, or not pass. So there are wires that can either contain power, or not. That strategy was used to code binarily saying "if the current passes, it will be a 0, if the current does pass, it will be a 1", binary coding, that's where the word "bit" comes from, for "Binary Digit", so a bit is either a 0 or a 1 according to whether the current passes or not. Modern computers are based on electronics, so everything I just told you about is based on electronics. Maybe it will get to change with the coming of photonics or quantics, but for now we'll study electronics, so bits equaling 0 or 1. With those bits, operations can be done. The simplest operation will be using what is called a transistor. This is one of the basic components in electronics. The transistor is like a tap that will either let the current pass, or not let it pass, and in order to give orders to that tap, there is a third terminal towards which power will be driven. When there is power, the tap will let the current pass, and when there is no power, the tap will close the current. There are various types of transistors, actually, the transistor drawn here is a customary transistor, but much smaller ones will be found in microprocessors, we will talk about it later. A lot of things can be done with transistors, particularly intervening on the bits by using what is called logic gating. Logic gating is various incoming electrical currents combined to calculate an output depending on the input. Different kinds of logic gatings can be made, such as "and", "or", "no", etc. So for example, an "or" gate, such as the one drawn here, will receive 2 inputs containing an electrical current, or not, and it will generate an output containing an electrical current if one of the 2 outputs has an electrical current or if both inputs contain an electrical current. So we actually proceed with a logical "or" between these 2 inputs, so that's an intervention on the bits, and they were combined with an "or" operation. Other interventions can be done with this, "and" gates can be made, which are only going to allow the current to pass if both inputs are activated, and other things as well. Even more complex things can be done, such as bit adders that will allow to add two values, 0 or 1, in order to calculate the result. So that allows bits manipulation, but bits are quite limited, since there are only 2 values: 0 or 1. Technically speaking, we have to handle larger figures. To do that, we are going to patch bits together in order to code larger figures. For example, a byte is actually made of 8 bits, so each bit can have a 0 or 1 value, so there are 256 possible values, that's 2 power 8, because each of these bits has 2 possible values. With that kind of assembly, a lot of things can be coded. For example, if you want to code an age, you can say "an age is roughly between 0 and 127", that can actually be coded with 7 bits. if you want to code a temperature, that's a bit more complicated, because temperature values can have much more variations than just 0 and 127, it can even get below zero actually, or even become a coma number. Take human temperature for example, if you look at it when you are ill, it can be 37.6. So the numbers that a computer can handle need to be extended, we can't simply rely on bytes limited to 256 different values, but we need a much broader range of values. later, we will see there are various great kinds of figures a computer can handle, which will be integers varying in size, eventually numbers called "floating", which are decimals that can be below zero, etc., and the computer will be able to handle those figures straight away, it was programed to do this. So technically, the computer doesn't really know what it is handling. It knows there are numbers, but it doesn't know what they mean at all. For example, the programmer will have to feed it the numbers the right way. If you want to ask the computer to calculate for example, to add 2 distances and then divide by the time laps in order to calculate speed, the programmer or the user will have to take care of giving the right distances in the right unit, the time in the right unit, so that the computer may calculate and get consistent results. If it is given kilometers and hours as input units, you have to understand that the computer will produce results using kilometers per hour. That's the big problem, the computer is dumb, it can't guess what is expected of him, it needs to be asked in a very precise way and the result given at the end needs to be interpreted very precisely. We quickly saw how to code numbers, now we are going to look at other things, like coding text, for example. Here's a letter represented by displaying points on the screen. There are various ways to store a letter. We could say, "If I want my letter stored here, I have white boxes, and black boxes". So I am going to use a bit for each box. If the bit equals 0, it will be considered to be black, if it equals 1, it will be white. That allows me to represent the display of the letter A by describing avery points on the screen. The problem is that it is not enough, because when I get the bits list indicating whether the boxes are black or white, I will need to know if there are 5 columns and 6 lines, or there is only one column with 30 lines, for example. So we need to add more information in order to clarify what my letter actually looks like. Then if we start blending colors in, it's going to get even more complicated, because only one bit per box is not going to be sufficient anymore. In fact, lots of problems arise as soon as we start talking about display, so we'll get into that a bit later. So technically, we won't be using that kind of storage. We will rather allocate a number to each letter, and use that number to represent the letters, regardless of the fact that for displaying on the screen, we need to use various points, whites or blacks, etc. Actually, there's something called the ASCII code, which was defined a very long time ago, and that will allow to give a number to each letter, so lowercase, capital letters, numbers, punctuation. So by and large, there are approximately 100 possible characters. The ASCII code is coded on 8 bits, so 8 bits, 2 power 8, which gives us 256 possible values. So the ASCII code will enable us to code all the alphabet letters easily, so we will do series of the various ASCII characters to store the information contained in a text, with every letter or punctuation marks in a row. Well, for asian letters, 256 possible letters is not enough, so nowadays we will use other systems, such as Unicode for example, but the idea stays the same, there's a number for each possible character that we want to handle in the text. So the picture, the letter's display on the screen, is only important when we really want to display it, but when all that is needed is the text's data storage, we simply use one number per letter, in order to say "my text is made of this and that letter in a row", but we don't need to know how it is all going to be displayed on the screen, until we decide to either display it or store it. Those are two different things, handled separately. So what do you need to remember from this first session? First, the electrical current in today's computers is used to code bits with values equaling 0 or 1, and we are going to assemble those bits to create larger figures, by using a byte made of 8 bits for example, enabling to create numbers up to 255. Then, even larger figures can be created by adding even more bits, or code other things such as letters. Technically, electronic circuit can perform calculations with those numbers, because schedulers were created to do so. But they don't know what they are manipulating, thay know they are adding numbers, but they don't know that those numbers correspond to a speed an age, or anything else.