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 trial

Digital Literacy Computer Basics Computer Basics Binary

Tejas Agrawal
Tejas Agrawal
441 Points

What number is represented by the byte 00000111

please tell me the answer fast because i am in a test

Zachary Fine
Zachary Fine
10,110 Points

Im 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)

Decimal 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
cynnimon
4,001 Points

Here'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
Ahmed Nagaty
746 Points

Thank you for this easy way :)

It's the best answer! thank you!

It is a easy way to understand, thank you

Thank You! :)

Thank you, this is easier to understand for me!

Such a GREAT example you got here, you nailed it... ^_^

This is so helpful, thank you!

Such a great way to learn, simple and clear method. It helped me a lot, thanks!