进制转换二进制转八进制
Prerequisite: Number systems
先决条件: 数字系统
To convert binary numbers into octal numbers, we first have to understand the relationship between binary and octal numbers.
要将二进制数转换为八进制数 ,我们首先必须了解二进制和八进制数之间的关系。
Octal Number | Binary Number |
---|---|
0 | 000 |
1 | 001 |
2 | 010 |
3 | 011 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
八进制数 | 二进制数 |
---|---|
0 | 000 |
1个 | 001 |
2 | 010 |
3 | 011 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
In octal number system, we have eight digits ranging from 0 to 7 which can be represented using three-bit binary numbers in 23 = 8 ways, so starting from the least significant bit of the binary number, we group three successive bits of the binary number to get its equivalent octal number as seen from the table above.
在八进制系统中,我们有8个数字,范围从0到7 ,可以使用2 3 = 8方式使用三位二进制数表示,因此从二进制数的最低有效位开始,我们将二进制数的三个连续位分组从上表中可以看到二进制数以获得等效的八进制数。
In an integral part, the grouping of three bits is done from the right side to the left side whereas in the fractional part the grouping of three bits is done from left to right and then convert it to its equivalent octal symbol.
在整数部分中 ,三个位的分组从右侧到左侧完成,而在分数部分中,三个位的分组从左侧到右侧完成,然后将其转换为等效的八进制符号。
In the process of grouping three bits, one or two bits can be added to the left of the MSB in an integral part and/or to the right of the LSB bit of the fractional part of the binary number.
在对三个位进行分组的过程中,可以将一位或两位添加到二进制数小数部分的整数部分的MSB左侧和/或LSB位的右侧。
Example 1: Convert (110011.011)2 to ( ? )8
示例1:将(110011.011) 2转换为(?) 8
Therefore, (110011.011)2 = (63.3)8
因此, (110011.011) 2 =(63.3) 8
Example 2: Convert (110011011110.1011)2 to ( ? )8
示例2:将(110011011110.1011) 2转换为(?) 8
Therefore, (110011011110.1011)2 = (14676.54)8
因此, (110011011110.1011) 2 =(14676.54) 8
Note: In the Example 2, to make a group of three bits, we have added two additional bits to the left of MSB in an integral part and two additional bits to the right of LSB in the fractional part.
注意:在示例2中,要组成一组三位,我们在整数部分的MSB左侧添加了两个附加位,在小数部分的LSB右侧添加了两个附加位。
翻译自: https://www.includehelp.com/basics/conversion-of-binary-number-system-into-octal-number-system.aspx
进制转换二进制转八进制