CHAPTER 01.04: BINARY REPRESENTATION : Base-10 to Base-2 Conversion Method    

 

Okay, in this segment we’re going to talk about how to convert a base-10 to base-2, a number from base-10 to base-2. So I’m going to show you through example, I’m not going to give you the proof for it. It can be proven, the method which I’m going to show you, you’ll be able to show by proof why this works to convert a base-10 number to a base-2 number, but the only thing which I’m going to concentrate on in this segment is the method itself, how to convert a base-10 number to base-2 number.  So for example, I’m going to take the same number, 11.1875, which I had previously, and this is in base-10. How do I convert this number into base-2?  What is the base-2 equivalent?  So this is the question mark right here, radix point, another question mark, base-2.  If I’ve got to find out what should I fill in for this question mark, and what should I fill in for this question mark.

 

So let’s go ahead and start with the integer part, which is the part before the decimal point in this case, or what we call the radix point for any base. So let’s go ahead and see what the equivalent of 11 is.  So I’m going to draw a table here, that’s the best way to go ahead and convert these numbers in decimal notation.  So I’m going to say, hey, I’m going to put the quotient here, and I’m going to put the remainder here, and I’ll tell you what that means. So I’m going to take this number 11, and what I’m going to do is, I’m going to divide this by 2, and the reason why I’m dividing by 2 is that’s what base.  So I’m going to take the 11 number, divide it by 2, what do I get as the quotient?  I get quotient is 5, and what is the remainder? The remainder is 1.  Now I take the quotient which I just got, which was 5, that’s this number right here, I divide that by 2, and I get 2 as my quotient and again 1 as the remainder. Now I take the number 2 and I again divide it by 2, so you’re dividing by the same number here, the quotient is 1, and the remainder is 0, of course.  Now I’m left with a quotient of 1, I get 1 divided by 2.  If I do 1 divided by 2, I get a quotient of 0, and a remainder of 1.  And that’s where I stop, as soon as the quotient becomes 0, when I’m looking at the integer part, I stop the whole process.  Now, what I will have is that this one is a0, this one is a1, this one is, I call a2, and this one I call a3, so this is the remainder which I get in the first step, second step, third step, fourth step. So the equivalent of 11 in the base-2 will be equal to a3, a2, a1, and a0, so the equivalent will be 1011 base-2.  So you do need to look at it this way, that if you are not going to do it this way where you are going to signify a0, a1, a2, and a3, what you’ve got to understand is that the first number which goes here is the last number which you calculated, and the next number which should go there is the second-to-last number which you calculated, and so on and so forth, so you’re going backwards. So the equivalent of 11, this should be base-10, that’s wrong, so the equivalent of the number of 11 in the base-10 is 1, which is this 1, then 0, which is this 0, then this 1, which is this 1, and then this 1 is right here, so you go backwards to look at the equivalent number. 

      

Now if you’re going to go ahead and try to find out what the decimal equivalent, or base-10 equivalent, of this number is, you’re going to exactly get 11 from there, so I will leave that as an exercise for you to do.  Now let’s go ahead and look at the fractional part, which is 0.1875, how do we go about finding the equivalent of that?  So I’ve got 0.1875, which is in base-10, and I’ve got to find out what is it in base-2, so that’s the rest of the number here.  So in this case, what you do is, rather than dividing by 2, you multiply by 2.  So let me draw a table here, that’s the best way to do these problems when you are a beginner. So I’m going to get 0.1875, that’s the number which I have, and I will multiply by 2, and I get 0.375.  So that’s the number which I am getting, and then what I’ve got to look at is the number after the decimal point, and then I’ve got to also look at the number before the decimal point.  So when I multiply 0.1875 by 2 I get 0.375, the number after the decimal point is still 0.375, the number before the decimal point is just 0.  So that’s how I’ve got to extract it, so I’ve got to extract the integer part of this number and the fractional part of this number, so the fractional part of the number is still 0.375, and the number before the decimal point is 0.  Now I take 0.375 and I multiply by 2, I get 0.750.  So in this case again here, the number which is after the decimal point is 0.750, the number before the decimal point is still 0.  Now I go ahead and take, again, I get 0.75 now, multiply by 2, now I get 1.50. So you might have been wondering, why are those numbers 0 before the decimal point, and that’s the way it turned out to be. Now 0.75 multiplied by 2 is 1.50, so the number after the decimal point is 0.500, and the number before the decimal point is 1.  Now I’m left with 0.5, which is the number after the decimal point, those are the numbers which I have put in here, so I get 0.5 times 2, I get 1.00.  The number after the decimal point is 0.00, and the number before the decimal point is simply 1.  And that’s when I stop, when I find out that the number which is left after the decimal point is simply 0, that’s when you stop the whole process, that you don’t need to do it any further, that you have obtained what the equivalent binary number is for that. And now what I’m going to do is I’m going to call this to be a(-1), I’m going to call this to be a(-2), I’m going to call this to be a(-3), and this to be a(-4).  So the equivalent of 0.1875 base-10 is equal to a(-1), a(-2), a(-3), a(-4) base-2, which in this case would be 0, there’s a radix point right here, radix point here, 0011 base-2. So in this case, when you are writing down the equivalent of the fractional part, you start from the top, you get 0, 0, 1, 1 – 0011, as opposed to when you were doing the integer part, you started from the bottom, but here you start from the top, 0, 0, 1, 1 – 0011. So if you look at the overall number, which is 11.1875 base-10, then the whole equivalency in the binary notation will be whatever is the equivalent of 11, which turned out to be 1011, so that’s what we found on the previous part of this segment, so we got 1011 as the equivalent of 11, and for 0.1875, we just calculated is the radix point right here, 0011 base-2.  So as an exercise, what you need is go ahead and see whether you can go from here to here, and be sure that you calculate this to be equal to 11.1875 in base-10. And that’s the end of this segment.