Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialaanya bhasin
54 Pointswhat number is represented by the byte 00000111
please fill in the correct answers in the blank provided
2 Answers
Alexander Davison
65,469 Points0000001 => 1
This is equal 1 because 2 to the 0th power is one, and there's nothing to add to that.
0000011 => 3
You might think this should be 2, but don't get mixed up! This is the same as saying: "2 to the first power plus 2 to the 0th power"
Or, in math, you could represent it as:
2^1 + 2^0
This makes it three. Two to the first power is 2, and you are adding that to 2 to the 0th power which is 1.
0000111 => 7
Wow, this is getting a little confusing...
Anyway, this is basically saying:
2^2 + 2^1 + 2^0
Which is the same as:
4 + 2 + 1
Which, of course is 7. Just remember binary has a base of 2 and the exponent always depends on where the 1 is. If the last number is a 1, that means the exponent is 0. If the second-last number is 1, then that means the exponent is 1. And so on...
I hope this helps
Good luck! ~Alex
Don't worry; I don't think you will have to deal with binary for the rest of your career after this Lol