How come the number 255 is the maximum number used in computers & probably even more

936 views

How come the number 255 is the maximum number used in computers & probably even more

In: 2

12 Answers

Anonymous 0 Comments

You see 255 a lot with computers because it’s a nice round number in the binary number system. Much in the same way that humans often round to ten or one hundred or whatever in our decimal number system.

Binary is a base-2 number system that only has two binary digits (“bits”) – 0 and 1 – before you have to “carry over” to the next column. Compared to our decimal base-10 number system that has ten digits (0 to 9) before carrying over. Binary is used by computers because digital electronic components are easier and cheaper to make if they only have to distinguish between high and low voltages.

255 in binary is represented as 11111111. That’s an 8-bit number. A group of 8 bits in computing is so common that in fact it has its own special name; a Byte. Bytes appear in all sorts of places – the way electrical signals are sent to a CPU to perform certain operations, the size of the CPU registers (immediate working memory), the size of addresses in RAM, the way packets are sent in computer networks etc. Most of the electronic components of a computer are designed to handle a particular number of bytes, it’s central to computer hardware.

So because 255/one byte is so important in the hardware, naturally we also see it pop up in software, like the amounts of Red, Green, Blue and Opacity when defining a colour, or when mapping binary data to alphanumeric symbols with the ASCII encoding standard, or when determining the size of an integer variable that stores the number of lives or [level number in a video game](https://www.geekwithenvy.com/2013/04/why-pac-man-stops-working-after-level-255/), and so on.

It is absolutely not the maximum size of a number used in computing though, just a popular choice when defining the size of certain integer values that don’t need to go higher than 1-2 hundred, and don’t need negatives. Numbers using 2 bytes, 4 bytes, 8 bytes are also very common. Your modern 64 bit CPU can use up to 8 bytes to address memory/RAM for example. And integer variables of arbitrary size can be used when dealing with large numbers.

You are viewing 1 out of 12 answers, click here to view all answers.