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 trialSimbarashe Chikaura
8,979 PointsByte - what exactly is it?
I thought a byte was a value that contained 8 binary digits, e.g., 100111001 Why then are we saying a byte can take values from 0 - 255. I'm a bit confused.
2 Answers
Steven Parker
231,248 PointsThe "0 - 255" spec is the decimal equivalent of the binary values. For unsigned values, 00000000
is the smallest binary byte value, which is 0 in decimal; and 11111111
is the largest, which is 255 in decimal.
Simbarashe Chikaura
8,979 PointsThis was a lot of help. Thank you.
Simbarashe Chikaura
8,979 PointsSimbarashe Chikaura
8,979 PointsOk. So in other words, a byte has about 256 permutations of bit numbers?
Steven Parker
231,248 PointsSteven Parker
231,248 PointsThere are exactly 256 (2^8) permutations of 8 binary digits.