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 trialTariq Kabsoun
675 Pointswhat number is represented by the byte 00001000
I need help
3 Answers
Richard Lu
20,185 PointsMichael gave a great explanation of this, I just want to add this visual representation for proof which may also help:
Binary Place Binary Number Digit and binary number multiplied (Binary Digit * Binary Number)
2^7 (128) 0 0 (128 * 0)
2^6 (64) 0 0 (64 * 0)
2^5 (32) 0 0 (32 * 0)
2^4 (16) 0 0 (16 * 0)
2^3 (8) 1 8 (8 * 1) like what michael said, there is only a single 1, and that 1 is in the 8 place, so the number is 8
2^2 (4) 0 0 (4 * 0)
2^1 (2) 0 0 (2 * 0)
2^0 (1) 0 + 0 (1 * 0)
----------------
8
Cameron Vinyard
5,899 PointsThere's a 0 in the 1's, 2's, and 4's place, then a 1 in the 8's place, and 0s in the rest. adding up all of the 1s present, you get 8.
Michael Hulet
47,913 PointsThe short answer: 8
The long answer:
Naturally, humans count in base-10. That means that each place represents a number 0-9. Therefore, in each place, the highest number you can write is 9. Binary is base-2. That means the highest number you can write in each place is 1. That means each place means something different, too. To have a 1 in a place is to have the value be worth 1 more than if all the other places before it had a 1 in it, or double the space immediately before it. Here's an example:
In base-2, 1 is worth the same thing as base-10. However, 10 in base-2 is 2 in base-10. 11 is 3, 100 is 4, 101, is 5, 110 is 6, 111 is 7, and so on. You just need to know what place each 1 represents, and then add together all the places that have a 1 in them.
In this case, there is only a single 1, and that 1 is in the 8 place, so the number is 8.
Michael Hulet
47,913 PointsMichael Hulet
47,913 PointsThank you for doing this, because I was in the middle of math class when I typed my answer, and I totally didn't have the time to make one of these