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 trialTejas Agrawal
441 PointsWhat number is represented by the byte 00000111
please tell me the answer fast because i am in a test
Ryan Turnupseed
Courses Plus Student 7,728 PointsDecimal and binary number system are positional number systems. You solve this from right to left (2^0=1)+(2^1=2)+(2^2=4)=7. Your answer is 7.
3 Answers
cynnimon
4,001 PointsHere's a hand trick to convert from binary to decimal:
Starting with your right hand, going from right to left, each finger is 1, 2, 4, 8, 16... i.e. thumb = 1 = 2^0 first finger = 2 = 2^1 second finger = 4 = 2^2 third finger = 8... see the pattern? each finger is a power of 2.
Now for 00000111, the zeros will be fingers that will be down, and the ones will be fingers that will be up.
You will only have to count the fingers that are up. So, 111 here means the thumb, first, and second finger are up.
This means you just sum 1 + 2 + 4 = 7!
So if you wanted to convert something like 1001, you only have to add up 1 + 8 = 9. Simple. :)
Ahmed Nagaty
746 PointsThank you for this easy way :)
Alexander Skibinskiy
Front End Web Development Techdegree Student 1,168 PointsIt's the best answer! thank you!
shanyun hsieh
Courses Plus Student 44 PointsIt is a easy way to understandοΌ thank you
Mina Basem
Courses Plus Student 1,071 PointsThank You! :)
jornemoonen
6,616 PointsThank you, this is easier to understand for me!
Dembo Tundayag
Courses Plus Student 375 PointsSuch a GREAT example you got here, you nailed it... ^_^
Jasper Dragoo
1,502 PointsThis is so helpful, thank you!
Abdilahi Abdi Ali
889 PointsThank you soooo much :)
danon62
4,354 PointsSuch a great way to learn, simple and clear method. It helped me a lot, thanks!
Zachary Fine
10,110 PointsZachary Fine
10,110 PointsIm not going to give you the answer but I will point you in the right direction. In binary each digit represents 2^n. Thus the right most digit is 2^0, then 2^1 and so on. So here we have (1+2^0)+(1+2^1)+(1+2^2)