转换器工具

0 characters

Enter a hexadecimal number (0-9, A-F). The '0x' prefix is optional. Choose between unsigned and signed (two's complement) interpretation.

Bits:

0

Type:

Unsigned

二进制表示:

关于数字系统

十六进制系统

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.

十六进制到

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

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