1 / 7

二进制数转换成十进制数

信息学奥林匹克竞赛计算机基础知识. 二进制数转换成十进制数. 主讲:王秀萍 单位:赣榆县城头小学. 二进制数转换成十进制数. ( 1 )整数部分的转换. 设二进制整数共有 n 位,转换的方法是:. 将它的最高位乘以 2 n-1 ,次高位乘以 2 n-2 , …… ,最后一位乘以 2 0 ,这些乘积相加的和就是所求的十进制数。. 二进制数转换成十进制数. 例:将二进制数 1010101 转换成十进制数。. 2 5. 2 6. 2 4. 2 3. 2 2. 2 1. 2 0. (1 0 1 0 1 0 1) 2.

Télécharger la présentation

二进制数转换成十进制数

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 信息学奥林匹克竞赛计算机基础知识 二进制数转换成十进制数 主讲:王秀萍 单位:赣榆县城头小学

  2. 二进制数转换成十进制数 (1)整数部分的转换 设二进制整数共有n位,转换的方法是: 将它的最高位乘以2n-1,次高位乘以2n-2,……,最后一位乘以20,这些乘积相加的和就是所求的十进制数。

  3. 二进制数转换成十进制数 例:将二进制数1010101转换成十进制数。 25 26 24 23 22 21 20 (1 0 1 0 1 0 1)2 =1x26+0x25+1x24+0x23+1x22+0x21+1x20 =64+0+16+0+4+4+1 =(85)10

  4. 二进制数转换成十进制数 (1)小数部分的转换 设二进制小数共有n位,转换的方法是: 将它的最高小数位乘以2-1,次高位乘以2-2, ……, 最后一位乘以2-n,将所有的乘积加到一起,其和就是所求的十进制小数。

  5. 二进制数转换成十进制数 例:将二进制数0.101转换成十进制数。 2-1 2-2 2-3 ( 0 . 1 0 1 )2 =1x2-1 +0x2-2 +1x2-3 =0.5+0+0.125 =(0.625)10

  6. 二进制数转换成十进制数 对于同时含有整数和小数部分的二进制数,可以按照下例的方法进行转换。 例:将(11001.1101)2转换成十进制数。 24 23 22 21 20 2-1 2-2 2-3 2-4 ( 1 1 0 0 1 . 1 1 0 1)2 =1x24+1x23+0x22+0x21+1x20+1x2-1+1x2-2+0x2-3+1x2-4 =16+8+1+0.5+0.25+0.0625 =(25.8125)10

  7. 问题:有没有更简洁的方法? 20=1 21=2 22=4 23=8 24=16 25=32 26=64 …… 2-1=0.5 2-2 =0.25 2-3 =0.125 2-4 =0.0625 2-5 =0.0125 …… 24 23 22 21 20 2-1 0.25 2-2 2-3 2-4 0.125 16 8 4 1 0.5 0.0625 2 (1 1 0 0 1 . 1 1 0 1)2 =16+8+1+0.5+0.25+0.0625 =(25.8125)10

More Related