If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Converting larger number from decimal to binary

To convert a number from decimal to binary, we need to figure out which combination of 0s and 1s will represent the number. Start by finding the largest power of 2 that fits into the number, write down a "1" to represent that power of 2, and subtract it from the number. We keep going until we reach the smallest power of 2, which is 1.

Want to join the conversation?

Video transcript

- [Voiceover] Let's now see if we can convert a larger decimal representation to binary. So let's say that we have the number 114 and this is its decimal representation. See if you can pause the video and rewrite this in its binary representation. So I'm assuming you have at least tried. Now we can work on this together. So as always, we just want to decompose this into the sum of powers of two. You can always decompose this and any number into a sum of powers of two. We can once again just remind ourselves the powers of two. Two to the zero is one, two to the first power is two, two to the third power is eight, two to the fourth power is 16, two to the fifth power is 32, two to the sixth power is 64, two to the seventh power is 128, and that gets us large enough. We've already gotten larger than the number here. So let's see, 114 can be rewritten as, the largest power of two that is less than or equal to that is 64. So we can rewrite it as 64 plus, what's going to be left over, 64 plus 50, now we're going to have to rewrite 50 as the sum of the powers of two. And let's see, 50 can be rewritten as the largest power of two that is less than or equal to 50 is 32. So we can rewrite it as 32 plus, 32 plus 18 and now we have to rewrite 18 as the sum of some powers of two. Well 18, the largest power of two that is less than or equal to 18 is 16. So this is going to be 16 and then 16 plus, 16 plus two, and lucky for us, two, well I guess not that lucky, we had to do this a good bit, two is a power of two, so we can rewrite this, 114 is equal to, lemme give myself enough real estate here, is equal to 64 plus 32 plus 16 plus 2. I've just written 114 as the sum of powers of two. And once again we can read this as one 64 plus one 32 plus one 16 plus one two. Now we're ready to really rewrite this in binary. Let's just write the different place values. So remember, this is the ones, this right over here is the one's place value or the one's place, I should say. Lemme just do this in a different color. So this is going to be the ones, then we're gonna have the twos, then we're gonna have the fours, the four's place, then we're gonna have the eight's place, then we're gonna have the 16's place, tells you how many 16s are in this number. Then we're gonna have the 32's place, how many 32s are in this number. And then you're going to have the 64's place. So how many ones do we have here? We have zero ones. How many twos do we have? Well, we have one two, you're going to have one of something or zero, there's only two digits if you're thinking in binary. Now we have no fours, no fours here, and no eights, no eights. We have a 16, we have a 32 and we have a 64. So in binary the number 114 in decimal? Would be in binary, would be written as one, one, one, zero, zero, one, zero.