Prerequisite: Number systems
先决条件: 数字系统
1)将十六进制数制转换为二进制数制 (1) Conversion of Hexadecimal Number System to Binary Number System)
To convert hexadecimal numbers into binary numbers, we can use the relationship between hexadecimal and binary numbers.
要将十六进制数转换为二进制数,我们可以使用十六进制和二进制数之间的关系。
Decimal | Hexadecimal | Binary |
---|---|---|
0 | 0 | 0000 |
1 | 1 | 0001 |
2 | 2 | 0010 |
3 | 3 | 0011 |
4 | 4 | 0100 |
5 | 5 | 0101 |
6 | 6 | 0110 |
7 | 7 | 0111 |
8 | 8 | 1000 |
9 | 9 | 1001 |
10 | A | 1010 |
11 | B | 1011 |
12 | C | 1100 |
13 | D | 1101 |
14 | E | 1110 |
15 | F | 1111 |
小数 | 十六进制 | 二元 |
---|---|---|
0 | 0 | 0000 |
1个 | 1个 | 0001 |
2 | 2 | 0010 |
3 | 3 | 0011 |
4 | 4 | 0100 |
5 | 5 | 0101 |
6 | 6 | 0110 |
7 | 7 | 0111 |
8 | 8 | 1000 |
9 | 9 | 1001 |
10 | 一个 | 1010 |
11 | 乙 | 1011 |
12 | C | 1100 |
13 | d | 1101 |
14 | Ë | 1110 |
15 | F | 1111 |
Example 1: Convert (7A.2C)16 into ( ? )2
示例1:将(7A.2C) 16转换为(?) 2
Solution:
解:
Using the table provided above, we can replace hexadecimal numbers with their equivalent binary digits.
使用上面提供的表,我们可以将十六进制数字替换为它们的等效二进制数字。
Therefore, (7A.2C)16 = (0111 1010.0010 1100)2
因此, (7A.2C) 16 =(0111 1010.0010 1100) 2
Example 2: Convert (D2A.2B7)16 into ( ? )2
示例2:将(D2A.2B7) 16转换为(?) 2
Solution:
解:
Using the table provided above, we can replace hexadecimal numbers with their equivalent binary digits.
使用上面提供的表,我们可以将十六进制数字替换为它们的等效二进制数字。
Therefore, (D2A.2B7)16 = (1101 0010 1010.0010 1011 0111)2
因此, (D2A.2B7) 16 =(1101 0010 1010.0010 1011 0111) 2
Example 3: Convert (FF18.5E5)16 into ( ? )2
示例3:将(FF18.5E5) 16转换为(?) 2
Solution:
解:
Using the table provided above, we can replace hexadecimal numbers with their equivalent binary digits.
使用上面提供的表,我们可以将十六进制数字替换为它们的等效二进制数字。
Therefore, (FF18.5E5)16 = (1111 1111 0001 1000. 0101 1110 0101)2
因此, (FF18.5E5) 16 =(1111 1111 0001 1000. 0101 1110 0101) 2
2)将十六进制数制转换为八进制数制 (2) Conversion of Hexadecimal Number System into Octal Number System)
Conversion of the hexadecimal number to octal number can be done using a certain definite path. We first have to convert hexadecimal numbers to a binary number and then convert a binary number into octal number i.e., Hexadecimal Number → Binary Number → Octal Number
可以使用某个确定的路径将十六进制数转换为八进制数。 我们首先必须将十六进制数转换为二进制数,然后将二进制数转换为八进制数,即十六进制数→二进制数→八进制数
Example 1: Convert (1D.E)16 into ( ? )8
示例1:将(1D.E) 16转换为(?) 8
Solution:
解:
Step 1: Converting the first hexadecimal number into a binary number. Thus, (1D.E)16 = (0001 1101.1110)2
步骤1:将第一个十六进制数转换为二进制数。 因此, (1D.E) 16 =(0001 1101.1110) 2
Step 2: Now, converting the binary number into an octal number which gives (00011101.1110)2 = (35.7)8
步骤2:现在,将二进制数转换为八进制数,得出(00011101.1110) 2 =(35.7) 8
Therefore, (1D. E)16 = (35.7)8
因此(1D.E) 16 =(35.7) 8
Note: To know how to convert binary number into octal number? Read: conversion of Binary number system to octal number system.
注意:要知道如何将二进制数转换为八进制数? 阅读: 将二进制数制转换为八进制数制 。
Example 2: Convert (3B.4)16 into ( ? )8
示例2:将(3B.4) 16转换为(?) 8
Solution:
解:
Step 1: Converting the first hexadecimal number into a binary number. Thus, (3B.4)16 = (0011 1011.0100)2
步骤1:将第一个十六进制数转换为二进制数。 因此, (3B.4) 16 =(0011 1011.0100) 2
Step 2: Now, converting the binary number into an octal number which gives (0011 1011.0100)2 = (73.20)8
步骤2:现在,将二进制数转换为八进制数,得出(0011 1011.0100) 2 =(73.20) 8
Therefore, (3B.4)16 = (73.20)8
因此, (3B.4) 16 =(73.20) 8
3)将十六进制数系统转换为十进制数系统 (3) Conversion of Hexadecimal Number System to Decimal Number System)
Conversion of hexadecimal number into a decimal number can be done using the positional weights by multiplying the positional weights with the corresponding bit and add them all together to obtain the decimal number.
可以使用位置权重将十六进制数转换为十进制数,方法是将位置权重乘以相应的位,然后将它们全部加在一起以获得十进制数。
In an integral part of the hexadecimal number, the weights follow the pattern as 160, 161, 162, 163, 164, 165 and so on from right to left.
在十六进制数的一个组成部分,权重按照图案16 0,16 1,16 2,16 3,16 4,16 5等从右到左。
In the fractional part of the hexadecimal number, the weights follow the pattern as 16-1, 16-2, 16-3, 16-4, 16-5 and so on from left to right.
在十六进制数的小数部分,权重按照图案16 -1,16 -2,16 -3,16 -4,16 -5等从左到右。
Only thing to be kept in mind is A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
唯一要记住的是A = 10 , B = 11 , C = 12 , D = 13 , E = 14 , F = 15 。
Example 1: Convert (75.3)16 into ( ? )10
示例1:将(75.3) 16转换为(?) 10
Solution:
解:
(75.3)16 = 7 * 161 + 5 * 160 + 3 * 16-1
= 112 + 5 + 0.1875 = (117.1875)10
We multiply each bit with the corresponding positional weight and then add them together to get the result.
我们将每个位乘以相应的位置权重,然后将它们加在一起以获得结果。
Therefore, (75.3)16 = (117.1875)10
因此, (75.3) 16 =(117.1875) 10
Example 2: Convert (CD3.B70A)16 into ( ? )10
示例2:将(CD3.B70A) 16转换为(?) 10
Solution:
解:
(CD3.B70A)16 = C*162 + D*161 + 3*160 + B*16-1 + 7*16-2 + 0*16-3 + A*16-4
= 12*256 + 13*16 + 3*1 + 11/16 + 7/256 + 0 + 10/65536
= 3072+ 208 + 3 + 0.6875 + 0.0273 + 0.0001
= (3283.7149)10
We multiply each bit with the corresponding positional weight and then add them together to get the result.
我们将每个位乘以相应的位置权重,然后将它们加在一起以获得结果。
Therefore, (CD3.B70A)16 = (3283.7149)10
因此, (CD3.B70A) 16 =(3283.7149) 10