freeCodeCamp/guide/chinese/mathematics/converting-directly-from-bi.../index.md

32 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Converting Directly from Binary to Hexadecimal
localeTitle: 直接从二进制转换为十六进制
---
## 直接从二进制转换为十六进制
您可以拆分二进制数以将其转换为十六进制数。
### 一般方法
1. 从右侧开始,将您的二进制数字串切成四个一组。
2. 如果不是四位数,请在第一个数字的前面添加额外的零。
3. 一次转换一个4位数组。
您可以使用此转换表:
冒号可用于对齐列。
|二进制|十六进制| | ------ | ----------| | 0000 | 0 | | 0001 | 1 | | 0010 | 2 | | 0011 | 3 | | 0100 | 4 | | 0101 | 5 | | 0110 | 6 | | 0111 | 7 | | 1000 | 8 | | 1001 | 9 | | 1010 | A | | 1011 | B | | 1100 | C | | 1101 | D | | 1110 | E | | 1111 | F |
### 例
将二进制数01101000000001转换为十六进制。
```
1. 01101000000001 => 01|1010|0000|0001
2. 01|1010|0000|0001 => 0001|1010|0000|0001
3. 0001|1010|0000|0001 => 1A01
```
#### 更多信息:
有关插图的更多信息,请[点击此处](https://www.wikihow.com/Convert-Binary-to-Hexadecimal#Converting_Long_Binary_Strings_sub)