Main content
Course: Unlisted resources area > Unit 1
Lesson 1: Unlisted videos- A message from Sal on school closures and distance learning with Khan Academy
- Video tour: Teaching programming in the classroom
- Video tour: Khan Academy AP®︎ Computer Science Principles
- Adding two 16-bit binary numbers
- Editing a webpage in an online editor
- Editing webpages in a desktop editor
- Editing a webpage from a command line editor
- Using inspect element for HTML
- Using inspect element for CSS styles
- A Tour of Programming on Khan Academy
- John Resig: Building jQuery
- Genesis effect
- Online Python Tutor (1-minute demo)
- Tetrilingo
- LXJS 2013 - Bill Mills and Angelina Fabbro - JavaScript for Science
- AP CSP example: Traffic simulation
- Scientific simulations: IllustrisTNG Single Galaxy Formation
- Memoized Fibonacci visualization
- Memoized factorial visualization
- Bottom-up Fibonacci visualization
- Recursive Fibonacci Calls (Diagrammed)
- Memoized Recursive Fibonacci Calls (Diagrammed)
- A message from Sal on school closures and Khan Academy remote learning.
© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice
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.
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.