 So in this lecture, we're going to be talking about binary conversion now Why well if we think about the computer if we strip it all the way down to the very bare essentials Everything it's only focusing in on is something like this Well, this is known as a switch. This is a little simplistic Electrical engineering 101 diagram, but what's going on here is effectively this is where we have say for example electricity there's my electricity lightning bolt and over here I have no electricity and the reason is because There is nothing touching in between here now Inside the computer we regard this as something known as a zero Basically, there's no power going to it But what happens when this switch connects and we'll say you know what happens if This connection right here has occurred well now all of a sudden that electricity that I had over here that actually gets transferred over to here as well and so what we actually consider this is a One and so now we have the very basic of a computer now that we have just one switch What happens if we start to expand on this idea? What happens if instead of just one switch? I did Two switches well, what are the possible states that I can have right now? Well, I can have my first state. I can have both of them being Disconnected zero and zero but what happens if I have one disconnected and One connected Well suddenly I have a second state I have a zero here and a one here Well, I can do the exact opposite. What happens if I have the opposite Switch connected and then the opposite switch Disconnected in this case. I have a one and a zero Kind of flipped over and then my last possible state is that I can actually have both of these connected Which in this regard gives me two electros electrical Currents, which means I get a one and a one so by having two switches By having two switches. I'm actually able to do two to the power of two possible states Four states one Two three four Well, what happens if I make eight of these so one Two Three four Five six seven Eight, well, I'm not gonna go over drawing them all out in the way too much time You guys would skip through it anyway, but what would happen is now? I have two to the 8th power possible states two to the eight if you do math that equates out to 256 possible states possible combinations of switches binary so This is where we start to get the hallmark of all of our binary Computation we start to go. All right. Well Since I have 256 possible combinations that actually starts with zero and so I can represent any number from zero to 255 I Don't do 256 because I've started at zero zero still is technically a number So how do I do the calculation? How do I do something like binary conversion, which is what you're going to be asked on your homework? Well, let's say for example. I have the binary string one zero one one zero zero zero one Lot of numbers going on here. Well my recommendation is not pull out a calculator and start trying to do this math in your head My recommendation is to draw a Rectangle just a really long rectangle and Divide this up into eight separate squares. So one two three four Five six Seven and eight once you've got this rectangle designed up Start at the far right corner and put a one That one is going to be the basis of everything that actually allows me to do odd numbers and so from this one basically every Next square double the number to the right of it. So this was a one. This is going to become a two This double two means this is going to become a four double. This becomes an eight double This becomes a sixteen double thirty-two sixty-four One twenty eight Let me make that eight a little bit more outstanding Eight now you're probably saying to yourself. What about two fifty five two fifty six two fifty five where where's that well? If I were to take all these numbers Together and just add them up by themselves. I would actually get 255 if I have none of them I don't add any of these numbers up I get zero So that should give you a kind of sneak preview idea of what we're going to be doing We're actually going to say all of a sudden that wherever we see a One that's a number. I'm going to add and anywhere. I see a zero That's a number. I don't add going from left to right on both ends. So in our case We said we do have a one right here. So we are going to add one twenty eight We skip over 64 because there's a zero there, but there is a one here. So we are going to add 32 We see that right beside it. We're going to add that 16 and now you see we're going to skip over eight Four two and we're going to add that one so Now that I've got these numbers applied up again, don't pull out the calculator You know, this is basic math. You guys should know this you're in college But I can take these and I can make it easier on myself. You know, I don't like these numbers either So I designed them up in such a way that it makes it easier for me So suddenly I take a look at this well I Don't really I call this smart math smart math in the sense that it's just How do I make this easier for myself one of the things I can do is I can try and make my numbers a little rounded out So say for example one twenty eight plus thirty two. All right. Well, what's that? before we get to one twenty and Thirty let's look at eight and two. So eight and two just by themselves That's gonna be ten and so suddenly I'm now faced with one twenty plus thirty plus ten So over here to the side one twenty thirty ten That's a little bit easier for me to do addition wise I don't have to worry about those zeros anymore. And so suddenly this becomes one sixty. Well now that that Collectively has become one sixty one sixty plus sixteen is a little easier suddenly that becomes, you know one seventy six and then one one hundred seventy seven So that's how we can do any type of binary conversion the one little tidbit I'm gonna give you guys is if you ever see a one here that last right-hand digit that means It's going to be an odd number. So if you're looking at say for example a true false question if you see that Say for example is this binary string 176 well, that's an even number I have a binary string of an odd number. I Automatically, I know it's false without having to do all this pesky math going on here So I hope that gives you a little bit of insight on binary conversion