十進位到二進位
毫不費力地將十進位數轉換為二進位代碼
轉換器工具
Enter a decimal number (positive or negative). The result will be displayed in the selected bit format.
Bits:
8
Sign:
Positive
關於此工具
A decimal to binary converter is a tool that transforms decimal numbers into their binary equivalents. Each decimal number is represented as a series of binary digits (bits), which can be displayed in various bit formats (e.g., 8-bit, 16-bit, 32-bit).
如何運作
- 將驗證輸入的十進位數以確保它是有效的數位。
- 所選位大小確定用於表示二進位數的位數。
- 對於正數,使用標準的 2 除法將十進位值轉換為二進位。
- 對於負數,將絕對值轉換為二進位,然後應用 2 的補碼方法以獲得負表示。
- 生成的二進位字串用前導零填充以匹配所選的位大小。
常見用途
- 電腦科學教育:瞭解數位在二進位級別如何存儲在計算機中。
- 數位電子學:在硬體設計中使用數位的二進位表示形式。
- Programming:將十進位數轉換為二進位,用於按位運算或低級程式設計。
- 資料傳輸:準備數字數據,以便通過需要二進位數據的網路進行傳輸。
- Cryptography:將數字鍵或值轉換為二進位以進行加密演算法。
二進位系統基礎
二進位系統僅使用兩位數位 0 和 1 來表示數位。二進位數中的每個數字稱為一個位。二進位數可用於使用不同的方法表示正數和負數,例如負數的 2 補碼。
十進位到二進位的轉換範例
Decimal | 8 位二進位 | 16 位二進位 |
---|---|---|
0 | 00000000 | 00000000 00000000 |
1 | 00000001 | 00000000 00000001 |
10 | 00001010 | 00000000 00001010 |
-1 | 11111111 | 11111111 11111111 |
-10 | 11110110 | 11111111 11110110 |
127 | 01111111 | 00000000 01111111 |