[MUSIC] So what is this class about? Well, this class is about the hardware, software interface. But to understand that, first let's see what's hardware. Well, hardware is the part of the computer made of atoms, it's the physical part of your, computing device. Okay. In software, it's this thing made of bits which is the program that runs on top of your hardware. Okay. But for that to happen effectively there are many many layers of abstractions between the hardware and the software, okay? And this will be called the hardware software interface. And the reason we want you to understand what the hardware software interface is is that it's going to help you understand better how computers work. It's going to make you a more effective programmer, it's going to make you better at writing efficient codes. And it's just going to make you a better computer science, scientist. So, let's look at these three pieces of code here. So, here we have a simple statement that does a conditional and performs an assignment. And this is written in, you know, a language like C or Java, okay? Now, this piece of code here is also a, well it's also a program. And this is written in what we call the assembly language, okay? The assembly language is just a much lower level language that's pretty to close to hardware. And it just happens to be an abstraction, a simple way of looking at machine code. Okay, so the machine code is just a sequence of 0's and 1's. Processors only understand 0's and 1's it interprets them in different ways. Now, so what's in common between these three pieces of codes? Well all of them we're exactly the same thing their equivalent but you'd rather write in this language here because it's much easier. it's much more natural for humans to write, okay, so it's much more human friendly. But as I said before the hardware likes bit strings. So 0s and 1s. So a digital computer likes 0s and 1s because it's very easy to represent with electronic sequence because 0s is a low voltage and 1 can, can be represented as a high voltage, okay? So and the, the, the machine machine structure is actually much shorter than the number of bits we would need to represent the characters in the assembly language. It's a, much, it's a much more dense encoding of the assembly language, the assembly instructions that we see here. Okay? There's a very direct correspondence between these, simple assembly instructions, and some of the bits in machine code. Now let's look at a hard or soft interface from a historical perspective. So at first the hardware, the hard or soft interface was very, very simple because in because hardware was simple. Hardware was very, very primitive when computers started. Okay. So humans was were able to write code directly to hardware without any abstraction at all. But then people got [INAUDIBLE] and that means that software was very primitive. Because the the soft improvements reflected the hardware pretty closely. But then people got really excited about computers. It's like hey,computers can do all these things. So they decided, they end up writing more and more complex pieces of code. That meant that humans could no longer, you know keep up with the complexity of writing machine code directly. So, uh,the assembly language was invented. The assembly language, as I said before is a very very simple computer programming language. That's pretty close what a hardware can do in terms of it's primitives and one assembly instruction translates to one machine instruction. Okay? So but the big difference is that the assembly language is much easier for humans to read because they have, first of all, they have characters strings as opposed to just bits. Okay so humans can understand much, much easier so it's much easier to read and write. And you can also use symbolic names for values. And you can use thing like writes their names, a, b and so on, okay. So now there's a piece of code here called Assembler. That takes a program written in Assembly and generates zeros and ones Machine code, which is what the hardware likes. But even then that, that wasn't enough because you know, programs were getting more and more complex. We needed yet another level of abstraction that's much higher level. Okay? So this is thing so these languages such as languages like C and java they're much, much higher level. You can write statements like you know, a equals b plus c for example. Okay? And one statement in, this high level language can translate to many, many, assembly language instructions. Okay? So, but now, we have yet another, another component in our path from the user to the hardware here, which is a C compiler. Okay. The C Compiler takes C code and generates assembly code. [UNKNOWN] this is assembly. Okay. So and that's much high lever that means you must have much more productive at writing code for that. So now, let's look at the entire lifetime of a computer program. And computer program has three basic steps in it's life time. There's coding time which is the time that humans spent writing the program high level language like C. Compile time is the time it takes to get your C program, and generates machine code executed by the hardware. Okay? And when the hardware's executing the code, we call that run time. Okay? So, now compare time is something that happens just once, and if you execute Your program many, many, many times. That means that it can advertise a cost of compilation a lot, because, you know, if you spend some time compiling the program you're going to execute so many times. It doesn't matter if you spend a little bit more time doing compilation, okay? And in fact, during this process here. During the compilation process, the compiler can spend a little bit more time generating the code. In order to do optimizations that are going to make. You program faster without having the programmer improve the code itself. Although if you do want to generate really fast codes, you do want to regenerate, you do want to start with good algorithms first. Okay? So a big thing in this class then is how to hardware software interface, okay? So just, so that includes how to hardware, you know, with 0s and 1s and processor executing instruction. Relates to software In other words your, your for example your Java program. And the other big, the other part of this thing is that computer's about abstractions. Computer systems are complex. In order for humans to understand and design effective computer systems, we need abstractions. Okay. So, computer's a lot about abstractions but, we can't really forget reality. Well, the goal of an abstraction is to abstract reality and make it simpler to think about. But we don't to completely ignore reality because that leads to inefficiencies and leads to other problems. Okay. So, what, we also going to talk about what are the abstractions that, that we use and what do you need to know about them, okay. So well, you know when they break down and you have to peek under the hood. You also want to know because it will help [INAUDIBLE] bacause it helps with what kind of bugs can they cause and how you find them and so on. But knowing the hardware and software interface ultimately is going to make you better programmers. It's going to help you begin to understand important concepts that have evolved er, in building ever more complex computer systems.