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

913 views

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

In: 2

12 Answers

Anonymous 0 Comments

It is not the max number in computers. It is the maximum number in one specific case 8 bit unsigned integer.

If you have 8 bits there is 2^8 = 265 combination and if you start at 0 the highest number you can get is 255. So 8 bit signed integer is 0 to 255. If you have a 8 bit signed integer you ger -128 to 127

One byte is today defined as 8 bits and that is the max number you can store in one byte but you can use multiples. The 1 byte = 8 bit become the common standard because you could get 1 character with a reasonable character set if you use 8 bits. You can fit most if not all letters used in different Latin scripts in 8 bits.

Use 2 and you get 16 bit with a max of 2^16 -1 =65535. Use 4 byrs =32 bits and we get 2^32 -1 = 4 294 967 295 use 8 bytes = 64 bits and you get 18 446 744 073 709 551 615

This is just for integers there is floating point numbers where you can have a lot larger numbers but with lower precision.

Most computers today have inductions that can do calculations of 64 bits integers, the can for certain do that with 32 bit numbers. This is excluding special instruction that can handle larger numbers or using multiple instruction.

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