二进制转换为十六进制? [英] Converting binary to hexadecimal?

查看:137
本文介绍了二进制转换为十六进制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是在想,我怎么会去二进制转换为十六进制?
我会首先要将二进制十进制转换,然后为十六进制的??

Just wondering on how I would go about converting binary to hexadecimal?? Would I first have to convert the binary to decimal and then to hexadecimal??

例如,101101001.101110101010011

For example, 101101001.101110101010011

我如何去转换一个复杂的二进制文件,如上面为十六进制?

How would I go about converting a complex binary such as the above to hexadecimal?

在此先感谢

推荐答案

二进制数重新$ P $的每4位psents十六进制数字。所以从二进制转换为十六进制的最好的办法是用前导零的二进制数,这样的位数是被4整除。

Each 4 bits of a binary number represents a hexadecimal digit. So the best way to convert from binary to hexadecimal is to pad the binary number with leading zeroes so that the number of bits is divisible by four.

然后你同时处理4位,并将其转换为一个十六进制数:

Then you process four bits at a time and convert them to a single hexadecimal digit:

0000 -> 0
0001 -> 1
0010 -> 2
....
1110 -> E
1111 -> F

这篇关于二进制转换为十六进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆