It comes from the way modern computers internally treat numbers.
The computers we use today treat all information as a series of on/off states, which we usually write down as a 1s and 0s.
They don’t have endlessly many of these, but they come in groups of 8.
8 binary digits that can either be 1s or 0s like fro example the number one hundred would be represented as:
0110 0100
Just like our normal system of using ten different digits we ran into problems when we run out of room. For example an old mechanical odometer in a car that only had 6 digits to display would be able to count up to 999,999 miles traveled and then roll over to 000,000.
The same goes with the way computers count in binary. once they reach 1111 1111 the byte is full and if you added one more you would reach 0000 0000 again.
In Binary eight ones in a row 1111 1111 is 255 in our normal writing system.
So if you only had one byte of space to count with you could only count up to 255.
Of course computers can count beyond 255, but you need to be sure from the beginning that you want to use more than one byte for counting.
Two bytes let you count up to 65,535 and 3 bytes up to 16,777,216 and four bytes up to 4,294,967,296
These numbers (often rounded down) may be familiar to you. You may have heard for example that a technology allowed for up to 16 million colors. (16,777,216 to be exact). Why that number? because they used three bytes to number all the colors and that is how far you can count with three bytes.
Another thing is that sometimes you want to include negative numbers. At that point half the possible numbers get sued for negative numbers and you can for example only count up to 127 with a single byte and is you add one more you roll over into -128.
These limits crop up all the time with computers and electronics. Once you realize that these numbers are special you will find them all over the place.
Latest Answers