二进制数如何转换成十进制数_十进制数系统到二进制数系统的转换

二进制数如何转换成十进制数

双涉水法 (Double Dabble Method)

In this method, the decimal integer number is converted to a binary integer by successive division by 2, and the decimal fraction is converted to a binary fraction by successive multiplication by 2.

在此方法中, 十进制整数通过连续除以2 转换为二进制整数 ,十进制分数通过连续乘以2 转换为二进制分数

The decimal integer number is successively divided by 2 until the quotient is 0. The last remainder is the MSB. The remainders read starting from the bottom to the top give the equivalent binary integer number.

十进制整数顺序被2除,直到商为0。最后一个余数是MSB。 从下到上读取的余数给出等效的二进制整数。

The decimal fractional number is successively multiplied by 2, till the fractional part of the product is 0. The first integer obtained is the MSB, thus the integers read from top to bottom gives the equivalent binary fraction.

十进制小数连续乘以2,直到乘积的小数部分为0。获得的第一个整数是MSB,因此从上至下读取的整数给出了等效的二进制分数。

To convert a mixed number to binary, we have to convert the integer and fractional part to binary separately and then combine them.

要将整数转换为二进制,我们必须将整数和小数部分分别转换为二进制,然后将它们组合。

Example 1:

范例1:

Convert (13.25)10 to ( ? )2

将(13.25) 10转换为(?) 2

Solution:

解:

In 13.25, we have 13 as the integral part and 0.25 as the fractional part. To get an equivalent binary number, we have to convert both to binary separately and then combine them.

在13.25中,我们将13作为整数部分,将0.25作为小数部分。 要获得等效的二进制数,我们必须将两者分别转换为二进制,然后将它们组合。

Integral Part

整体部分

DivisorQuotientRemainder
213
26 1 LSB
230
211
20 1 MSB
除数
2 13
2 6 1 LSB
2 3 0
2 1个 1个
2 0 1个MSB

All the remainders read from top to bottom, where topmost is the LSB and bottom one is the MSB.

所有其余部分从上至下读取,其中最高的是LSB,最低的是MSB。

Therefore, (13)10 = (1101)2

因此,(13) 10 =(1101) 2

Fractional Part

小数部分

    0.25 * 2 = 0.50   MSB
    0.50 * 2 = 1.00   LSB

Integer part of the product term read from top to bottom.

产品术语的整数部分从上至下读取。

Therefore, (0.25)10 = (0.01)2

因此,(0.25) 10 =(0.01) 2

Now, we can combine both the integral part and the fractional part to get the required binary equivalent i.e., (13.25)10 = (1101.01)2

现在,我们可以将整数部分和小数部分组合起来,以获得所需的二进制等效值,即(13.25) 10 =(1101.01) 2

Example 2:

范例2:

Convert (15.6)10 to ( ? )2

将(15.6) 10转换为(?) 2

Solution:

解:

Converting Integral and Fractional part separately.

分别转换积分和小数部分。

Integral Part

整体部分

DivisorQuotientRemainder
215
27 1 LSB
231
211
20 1 MSB
除数
2 15
2 7 1 LSB
2 3 1个
2 1个 1个
2 0 1个MSB

All the remainders read from top to bottom, where topmost is the LSB and bottom one is the MSB.

所有其余部分从上至下读取,其中最高的是LSB,最低的是MSB。

Therefore, (15)10 = (1111)2

因此,(15) 10 =(1111) 2

Fractional Part

小数部分

    0.6 * 2 = 1.2		MSB
    0.2 * 2 = 0.4
    0.4 * 2 = 0.8
    0.8 * 2 = 1.6
    0.6 * 2 = 1.2
    0.2 * 2 = 0.4
    0.4 * 2 = 0.8
    0.8 * 2 = 1.6		LSB

Integer part of all the product terms read from top to bottom.

所有产品术语的整数部分从上至下读取。

Therefore, (0.6)10 = (0.1001)2

因此,(0.6) 10 =(0. 1001 ) 2

Now, we can combine both the integral part and the fractional part to get the required binary equivalent i.e., (15.6)10 = (1111.1001)2

现在,我们可以将整数部分和小数部分组合起来,以获得所需的二进制等效值,即(15.6) 10 =(1111. 1001 ) 2

Note: If the numbers are non-terminating and non-repeating then, in that case, the process of multiplication is to be stopped after 4 or 5 decimal places.

注意:如果数字是不间断且不重复的,那么在这种情况下,应在小数点后4或5位后停止乘法过程。

Example 3:

范例3:

Convert (18.75)10 to ( ? )2

将(18.75) 10转换为(?) 2

Solution:

解:

In 18.75, 18 is the integral part and 0.75 is the decimal part. To convert 18.75 into binary we first have to convert integral and fractional part individually and then combine them together.

在18.75中,18是整数部分,而0.75是小数部分。 要将18.75转换为二进制,我们首先必须分别转换整数和小数部分,然后将它们组合在一起。

Integral Part

整体部分

DivisorQuotientRemainder
218
29 0 LSB
241
220
210
201 MSB
除数
2 18
2 9 0 LSB
2 4 1个
2 2 0
2 1个 0
2 0 1个MSB

All the remainders read from top to bottom, where topmost is the LSB and bottom one is the MSB.

所有其余部分从上至下读取,其中最高的是LSB,最低的是MSB。

Therefore, (18)10 = (10010)2

因此,(18) 10 =(10010) 2

Fractional Part

小数部分

    0.75 * 2 = 1.50	MSB	
    0.50 * 2 = 1.00	LSB

Integer part of all the product terms read from top to bottom.

所有产品术语的整数部分从上至下读取。

Therefore, (0.75)10 = (0.11)2

因此,(0.75) 10 =(0.11) 2

Now, we can combine both the integral part and the fractional part to get the required binary equivalent i.e., (18.75)10 = (10010.11)2

现在,我们可以将整数部分和小数部分组合起来,以获得所需的二进制当量,即(18.75) 10 =(10010.11) 2

翻译自: https://www.includehelp.com/basics/conversion-of-decimal-number-system-into-binary-number-system.aspx

二进制数如何转换成十进制数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值