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 trialchuma Meribe
1,833 PointsWhat number is represented by the byte 00001000
What number is represented by the byte 00001000
3 Answers
Steven Parker
231,271 PointsHere's one way to decode binary numbers. Make a column for each digit, and starting from the right, put a "1" and then as you move left put double the value of the column next to it. Remember, right-to-left ( THIS WAY ). You'll get something like this, which is a horizontal version of the helper table shown in the quiz:
128 64 32 16 8 4 2 1 <-- 8 columns for 8 digits
Then, put your binary number on the next line, spread into the columns. Now below that, multiply each top number by the binary digit and put the result below. It's easy, since binary digits are either 1 or 0, so you either put the number on top again or zero.
Then finally, add up all the numbers on the bottom row and that's your answer. Like this:
128 64 32 16 8 4 2 1 <-- starting columns
0 0 0 0 1 0 0 0 <-- multiply by your binary digits
--- --- --- --- --- --- --- ---
0 0 0 0 8 0 0 0 <-- add these up: 8 + 0 + 0 + 0 = 8
Also, since zeros in front don't count you can skip them. So in this case we really only needed 4 columns.
Sam Smith
1,328 Pointsits 32
Steven Parker
231,271 PointsNo, it's really 8. See the answer posted back in 2017 explaining the process.
Sam Smith
1,328 Pointsi figured it out already befor u replied and its 8 i was just testing u to make sure u werent guessing or a phoney
Steven Parker
231,271 PointsI'm surprised that such a detailed explanation could seem like "guessing"!