转换器工具
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 的补码中将正数转换为负数:
- 将数字转换为二进制。
- Invert all the bits (change 0 to 1 and 1 to 0).
- 将 1 添加到反转的结果中。
要将负 2 的补码数转换回十进制:
- 反转所有位。
- 将 1 添加到反转的结果中。
- 将结果转换为 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)