Binary Numbers system for Programming

143 Views Asked by At

So, the maximum number 1 byte (8 bits) can have is 255, so does that mean 255 combinations of 0 & 1 in the 8 places?

2

There are 2 best solutions below

0
On

Well don't forget all zeroes. The total number of combinations is actually $2^8=256$.

0
On

8 bits can be used to represent 256 distinct values (usually 0-255).

This is a result of the following: you have 2 choices for each bit, namely 0 or 1. When considering these choices together you are left with $2*2*2*2*2*2*2*2 = 2^8$ possible combinations of 0s and 1s.