Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
binary numbers basic are?
i have been asked what the basic binary numbers are and couldn't not remember them
Dane ParchmentTreehouse Moderator 11,024 Points
Okay I'm going to copy an answer I gave to a very similar question a few years ago. It is very long and I recommend taking your time to read it, but when you're done you should be very comfortable with binary numbers after some practice. (Source: Computer Science Graduate Student :D)
This is going to be a long winded response so sit back, sip some tea and take this slow!
Normally when humans count we do so through the use of numbers represented like so: 19, 8, 345, 10. These numbers are what we call base 10 numbers. We call them base 10 because we formulate the values of these numbers by counting out how many 10s are in the value. We accomplish this by summing the values as they are multiplied by powers of 10, whose powers are represented by the values position. The position starts at 0, and is increases from right to left. Let's use
345 as an example of how to calculate a base 10 number.
We start off by figuring out the positions of each number:
- 5 is in the lowest position, position 0
- 4 is in the 2nd position, position 1
- 3 is in the highest position (in this given number), position 2
So now we calculate each position like I specified above, by multiplying the values by a power of 10 whose power is influenced by that values position!
Tip: When you see me say 10 to the power of something I will write it as so:
10 ^ something this basically means that we are multiplying 10 by itself something amount of times. So for example. lets pretend I say 10 to the 3rd power, I am really saying:
10 ^ 3 = 10 x 10 x 10 = 1000
- 5 :
5 x 10 ^ 0 = 5 x 1 = 5
4 x 10 ^ 1 = 4 x 10 = 40
3 x 10 ^ 2 = 3 x 100 = 300
Now we add all the values up and we get
300 + 40 + 5 = 345. That is how humans count. Now that you are familiar with that let's use the same concept to solve for your answer.
Computer do not count like humans they don't use base 10, instead they use base 2, because of this the only values a computer can use to represent a number is: 0 and 1 (which is 2 values when we start counting at 0). So when you see the binary number:
101101 you know that you need to find out what is value is by computing the 0s and 1s, like we did with base 10. The only difference here, is that we will be using
2 ^ something since we are in base 2!
So let's find out the positions of that number starting from the right:
- 1 is in the lowest position, position 0
- 0 is in the 2nd position, position 1
- 1 is in the 3rd position, position 2
- 1 is in the 4th position, position 3
- 0 is in the 5th position, position 4
- 1 is in the highest position (at least for this number), position, 5
Now let's calculate them in the same order:
1 x 2 ^ 0 = 1 * 1 = 1
0 x 2 ^ 1 = 0 * 2 = 0
1 x 2 ^ 2 = 1 * 4 = 4
1 x 2 ^ 3 = 1 * 8 = 8
0 x 2 ^ 4 = 0 * 16 = 0
1 x 2 ^ 5 = 1 * 32 = 32
Now we add them up:
32 + 0 + 8 + 4 + 0 + 1 = 45
So the binary number
101101 is the binary representation of the number:
Using this same logic do you think you can solve:
If you can't the answer is equal to: 5 + 2
Hi Dane, thank you for your help. The langunes are new so receive a bit of time to get used to them.
00000001 = 1 x 0 = 0 2x0 = 0 3x0 =0 4x0 = 0 5 x 0= 0 6 x 0 =0 7 x 0 = 0 answer 0