Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What is the integer range that 16 binary bits can represent?
What is the integer range that 16 binary bits can represent?

Sixteen signed bits can indicate an integer range of -32768~32767, and sixteen unsigned bits can indicate an integer range of ~65535. Because each binary bit can only have two representations of or 1, 16 bits can have 2 16 = 65536 representations.

Therefore, if a sign is needed, it is usually divided into positive and negative parts in the programming language, so it is-32768 ~ 32767; If there is no need to sign, it is ~65535 because it starts from .

Extended information:

The development history of binary numbers:

After the appearance of electronic computers, it is too complicated to use electronic tubes to represent ten states, so there are only two basic states in all electronic computers, on and off. That is to say, the two states of the electron tube determine that the electronic computer based on the electron tube uses binary to represent numbers and data.

octal and hexadecimal are commonly used. In computer science, hexadecimal is often used, but decimal is rarely used, because hexadecimal and binary are naturally related: four binary digits can represent numbers from to 15, which is just the data that one hexadecimal digit can represent, that is to say, only every four digits are needed to convert binary to hexadecimal.

Baidu encyclopedia-integer variable

Baidu encyclopedia-binary number