转换器工具

Enter a decimal number. Choose between unsigned and signed (two's complement) interpretation. Select the bit size to format the output correctly.

Bits:

0

Type:

Unsigned

二进制表示形式:

关于数字系统

十进制

十进制系统是一种以 10 为基数的编号系统,它使用十个不同的符号:0、1、2、3、4、5、6、7、8 和 9。它是日常生活中最常用的数字系统。

十六进制系统

The hexadecimal system is a base-16 numbering system that uses 16 distinct symbols. These symbols are 0-9 to represent values zero to nine, and A-F (or a-f) to represent values ten to fifteen.

十进制到十六进制的转换表

Decimal Hexadecimal Decimal Hexadecimal
0 0 8 8
1 1 9 9
2 2 10 A
3 3 11 B
4 4 12 C
5 5 13 D
6 6 14 E
7 7 15 F

2 的补码

2 的补码是一种数学运算,用于在二进制系统中表示负数。它被广泛用于计算,因为它简化了加法和减法等算术运算。

要在 2 的补码中将正数转换为负数:

  1. 将数字转换为二进制。
  2. Invert all the bits (change 0 to 1 and 1 to 0).
  3. 将 1 添加到反转的结果中。

要将负 2 的补码数转换回十进制:

  1. 反转所有位。
  2. 将 1 添加到反转的结果中。
  3. 将结果转换为 decimal 并在其前面加上负号。

示例:8 位 2 的补码

Positive Number (5):

0000 0101 (binary)

Negative Number (-5):

1111 1010 (inverted bits of 5)

1111 1011 (add 1 = two's complement representation of -5)

范围 对于 8 位 2 补码:

-128 (1000 0000) to 127 (0111 1111)

Related Tools