首页 新闻 会员 周边

怎么读一个2进制位的位数?

0
悬赏园豆:10 [已关闭问题] 关闭于 2013-02-21 23:18

比如说

1(0000 0001) 为1

2(0000 0010) 为2

4(0000 0100) 为3

8(0000 1000) 为4

16                       5

·

·

·

2048                   11

依次往下

侠梦千年的主页 侠梦千年 | 初学一级 | 园豆:6
提问于:2013-02-03 10:34
< >
分享
所有回答(3)
0

Ok just I am telling you the short trick to find out the binery number of any degit

 

lets start from the heigher amount you have:

suppose it you want to find out the binery of 165

 

128 64 32 16 8 4 2 1

write the above series as I have written in decreasing order, it will be continue untill you don't find your binery,

start counting now how.......

 1    0   1   0  0 1 0 1   

128 64 32 16 8 4 2 1 

 

now add the the number below the degit one

128+32+4+1=165 (10100101)

 

The remaining number will be called the (0)

 

Hope you understand it.

 

Thanks

 

http://www.html5andcss3.org

swapnil raja | 园豆:202 (菜鸟二级) | 2013-02-03 11:52
0

如果仅是1、2、4、8、16、32这种2的幂级数的话。可以按下面的公式来算:

其中,n就是你输入的数。

依旧淡然 | 园豆:209 (菜鸟二级) | 2013-02-03 13:11
0

是把二进制的字符串转换成数字吗?Convert类里面就有专门的函数干这个的,如下就是一个例子。 

  Convert.ToInt32("00001000", 2);
天方 | 园豆:5407 (大侠五级) | 2013-02-03 13:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册