转换器工具
Enter a decimal number. Choose between unsigned and signed (two's complement) interpretation. The bit size affects how negative numbers are represented.
Bits:
0
Type:
Unsigned
二进制表示:
十六进制表示:
关于数字系统
十进制
十进制是一种以 10 为基数的编号系统,它使用十个不同的符号:0、1、2、3、4、5、6、7、8 和 9。它是日常生活中最常用的数字系统。
八进制
The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Octal numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right).
十进制到八进制转换表
| Decimal | Octal | Decimal | Octal |
|---|---|---|---|
| 0 | 0 | 8 | 10 |
| 1 | 1 | 9 | 11 |
| 2 | 2 | 10 | 12 |
| 3 | 3 | 11 | 13 |
| 4 | 4 | 12 | 14 |
| 5 | 5 | 13 | 15 |
| 6 | 6 | 14 | 16 |
| 7 | 7 | 15 | 17 |
2 的补码
2 的补码是一种数学运算,用于在二进制系统中表示负数。它被广泛用于计算,因为它简化了加法和减法等算术运算。
转换正数 to 它在 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)
范围:
-128 (1000 0000) to 127 (0111 1111)