The 16-bit unsigned binary number represents the range from 0 to 65535 (that is, 2 to the 16th power minus 1); the 16-bit signed binary number represents the range from (2 to the 15th power minus 1) plus Positive and negative signs, but computers usually use complement representation, so the range is "-32768" to "32767".
Related recommendations: "Programming Video"
The range of integers that can be represented by 16 binary digits
If it is unsigned, it is 0 to 65535 (that is, 2 to the 16th power minus 1)
If it is signed, then the highest bit is used as the sign bit, indicating the range It is (2 to the 15th power - 1) plus a positive and negative sign, which is -32767 to 32767; however, computers usually use complement representation, so when there is a sign, the range is -32768 to 32767.
Detailed description:
All bits of unsigned binary numbers are numerical bits, so positive and negative are not considered. 16-bit binary can represent a total of 2^16 numbers, which is 65536 numbers. The minimum is 0000 0000 0000 0000 and the maximum is 1111 1111 1111 1111, which is 0~65535.
The first bit of a signed binary number is the sign bit, 0 means positive, 1 means negative, and all the remaining bits are numerical bits. The following is divided into original code, complement code and complement code for discussion:
1. In the case of original code, the minimum 16-bit binary number is 1111 1111 1111 1111, and the maximum is 0111 1111 1111 1111, that is, -32767 to 32767 .
2. In the case of inverse code, since the inverse code only inverts the numerical bits of the original code bit by bit and the sign bit remains unchanged, the actual representation range will not change.
3. In the case of two's complement code, since the complement code of 0 is unique, that is, 0000 0000 0000 0000, 1000 0000 0000 0000 does not represent 0, but -32768. Therefore, in the case of two's complement code, the minimum 16-bit binary number is 1000 0000 0000 0000, and the maximum is 0111 1111 1111 1111, which is -32768~32767.
To sum up, the 16-bit unsigned binary number represents the range from 0 to 65535, while the 16-bit signed binary number represents the range from -32768 to 32767 (in the complement case).
To read more related articles, please visit PHP Chinese website! !
The above is the detailed content of What is the range of 16-bit binary numbers?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version
Chinese version, very easy to use
