1 unsigned 16-bit integer data
For unsigned integer data, all the bits in the storage unit are used as the storage number itself, but no symbols are included. Therefore, for a 16-bit integer, the range of values is as follows:
-1111 1111 1111
The corresponding decimal number is to 65535 (i.e.? - 1)。
therefore, the value range of unsigned 16-bit integer data is to 65535.
description: unsigned integer variables can only store unsigned integers, such as 123 and 4567, but not negative numbers.
2 signed 16-bit integer data
For signed integer data, the most significant bit in the memory cell represents the sign bit: is positive and 1 is negative.
a) When the highest digit is , which means a positive number, the range of values is as follows:
1 to 111 1111 1111
The corresponding decimal number is 1 to 32767 (i.e.? - 1)。
b) When the highest digit is 1, which means negative number, the range of values is as follows (expressed in the form of complement):
1 to 1111 1111 1111
The corresponding decimal number is -32768 (that is, -1).
therefore, the value range of signed 16-bit integer data is -32768 to 32767.