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

Adding two 16-bit binary numbers

Adding binary numbers is similar to adding decimal numbers except everything is in powers of 2 instead of powers of 10. Let's add up two numbers to see how it works. Created by Pamela Fox.

Want to join the conversation?

No posts yet.

Video transcript

- [Instructor] Let's see how we would add these two 16-bit binary numbers. It's a lot like adding numbers in decimal, the only difference is that we're dealing with powers of two instead of powers of 10. So we'll start on the right side, just like we do for adding decimal numbers. One plus one is two. We know that, but what does that look like in binary? Let's do it up here. One plus one equals one, zero. That's a one in the twos place and a zero in the ones place, which gives us the decimal, two. So now, down here, we can say one plus one is zero, and carry the one. And we have one plus one plus zero, that's two again, so we put the zero, we carry the one. One plus one plus zero is two again. We put the zero, we carry the one. One plus one plus zero is two again. We put the zero, we carry the one. Finally, we have something different. One plus zero plus zero is just one. We have nothing to carry. One plus one is two, we put the zero, carry the one. And now something else, one plus one plus one. Well, that's three, let's just look at that in binary. One plus one plus one equals one, one. That's a one in the twos place, and a one in the ones place, which gives us three. So now, we need to put a one here, and then carry a one as well, all right? So then we have one plus zero plus zero is one. Zero plus zero is zero. Zero and zero is zero. Zero plus one is one. One plus one is two, so we put the zero, carry the one. One plus zero plus zero is one. Zero plus one is one. One plus one is two again, we put the zero, carry the one. And then one plus zero plus zero is one. So there we have it, this number is the answer to adding these two 16-bit binary numbers together.