当前位置:网站首页>Hex conversion...
Hex conversion...
2022-07-30 08:03:00 【Code Writers】
二进制
Binary is the base that is commonly used in computers,即逢二进一.例如:1010Octal Octal means every eight into one.例如:626Decimal Decimal is the base we often use in calculations,So no more examples(即逢十进一)Hexadecimal Hexadecimal is different from other bases,在10到15Expressed in English letters.The above is a brief introduction to the system,The following is an introduction to the base conversion.1.Convert binary to octal to get binary numbers10010110Examples are needed first3个二进制数各划分一个区域,If it is insufficient, it will be filled with zero.我们可以看出该二进制数为八位,我们需要补充一位,即010010110从左到右依次是:(计算方法是从右向左依次乘上2的n次幂,n从零开始,^符号表示次幂)0 1 0 0 1 0 1 1 0022+1*21+02^0=2 022+1*21+02^0=2 122+1*21+020=6然后合并得到226is the converted octal number.2.Convert binary to decimal to get binary numbers10010110For example, there is no need to divide the area here,Instead, the calculation is performed directly.(计算方法是从右向左依次乘上2的n次幂,n从零开始,符号表示次幂)127+0*26+025+1*24+023+1*22+121+0*20=1503.Convert binary to hexadecimal to get binary numbers100101100For example, binary to hexadecimal is similar to binary to octal,However, the hexadecimal division area is 4个,Insufficient is also filled with zeros0001001011000001 0010 1100023+0*22+021+1*20=1 023+0*22+121+0*20=2 123+1*22+021+0*20=12(12That is, in hexadecimalC)合并为12C4.Octal to Binary Octal to Binary is the reverse process of binary to octal conversion.(It is also filled with zeros when it is insufficient)拿八进制数226举例(需要取余数,using a flashback process)2 2 62/2=1(余数为0) 2/2=1(余数为0) 6/2=3(余数为0) 1/2=0(余数为1) 1/2=0(余数为1) 3/2=1(余数为1) 1/2=0(余数为1) So take the remainder as 10,不足三位,则补零,为010. 余数为110最后合并,The final converted binary number is 100101105.Convert octal to decimal to get an octal number226举例(由右向左依次乘以8的n次幂,n从零开始)282+2*81+68^0=1506.Octal to Hexadecimal Octal cannot be directly converted to hexadecimal.The conversion can be performed using an indirect conversion method.1.Convert octal to binary first,然后再转换为十六进制.2.先把八进制转换为十进制,然后再转换为十六进制.拿八进制数226举例,It can be seen from the above that the conversion to binary is 10010110,Then we convert it to 16进制.划分区域1001 0110123+0*22+021+1*20=9 023+1*22+121+0*20=6合并为96,所以八进制226转换为十六进制为96.The second is the same,I will not give an example here,大家可以试试看,也是一样的结果.7.Decimal to binary Decimal to binary is the reverse process of binary to decimal.同样,We also take decimal150来举例.150/2=75(余数为0)75/2=37(余数为1)37/2=18(余数为1)18/2=9(余数为0)9/2=4(余数为1)4/2=2(余数为0)2/2=1(余数为0)1/2=0(余数为1)整合为10010110即是转换的二进制.8.Decimal to Octal Decimal to Octal and Octal to Decimal are reciprocal,我们拿150来举例.150/8=18(余数为6)18/8=2(余数为2)2/8=0(余数为2)整合为226,得到八进制数.9.Decimal to Hexadecimal to Hexadecimal to Hexadecimal to Hexadecimal to Decimal are reciprocal,我们拿150来举例.150/16=9(余数为6)9/16=0(余数为9)整合为96,to get the hexadecimal number.10.Hex to Binary Hex to Binary and Binary to Hex are reciprocal,我们拿12C来举例.(Insufficient digits are filled with zeros)1 2 C(转化为12)1/2=0(余数为1) 2/2=1(余数为0) 12/2=6(余数为0) 1/2=0(余数为1) 6/2=3(余数为0) 3/2=1(余数为1) 1/2=0(余数为1)0001 0010 1100整合为00010010110011.Hex to Octal Octal cannot be directly converted to hexadecimal.Then hexadecimal can not be directly converted to octal,The conversion can be performed using an indirect conversion method.1.Convert hexadecimal to binary first,Then convert to octal.2.Convert hexadecimal to decimal first,Then convert to octal.The conversion process is no longer introduced here,Same as converting from octal to hexadecimal,Here is the reverse process.12.Convert hexadecimal to decimal to get hexadecimal96来举例(由右向左依次乘以16的n次幂,n从零开始)9*161+6*160=150好了,Above is the binary,八进制,十进制,十六进制之间的转换.We can do categorical memory,并总结规律.注意:1.我们在将进制数除以2must choose the reverse order. 2.在乘以次幂的时候也是从右往左的顺序,由零次幂依次递增. 3.在选择区域的时候一定要看清是转换十六进制还是八进制,否则就会出错,记住不足的位数一定要补零哦.These are the things I want to remind you of,当然了,通过实例,自己多多练习,I believe that the conversion of the base is very simple for everyone.
边栏推荐
- The calculation of the determinant of the matrix and its source code
- 2020年度总结——品曾经,明得失,展未来
- go : go-redis set operations
- Let the "label" content in Baidu map generator expand--solution
- B站崩了,如果是你是那晚负责的开发人员你会怎么做?
- [GO语言基础] 一.为什么我要学习Golang以及GO语言入门普及
- 【MySQL】MySQL中如何实现分页操作
- schur completement
- What happens when @Bean and @Component are used on the same class?
- numpy 多维数组ndarray的详解
猜你喜欢

云服务器零基础部署网站(保姆级教程)
Test Development Engineer Growth Diary 010 - CI/CD/CT in Jenkins (Continuous Integration Build/Continuous Delivery/Continuous Testing)

“AI教练”请进家,家庭智能健身蓬勃发展

Is it possible to use the same port for UDP and TCP?

redis实现分布式锁的原理

Station B collapsed, what would you do if you were the developer in charge that night?

不会吧,Log4j 漏洞还没有完全修复?

What new materials are used in the large aircraft C919?

识别“数据陷阱”,发现数据的可疑之处

Ali Ermian: How many cluster solutions does Redis have?I answered 4
随机推荐
手机端滚动至页面指定位置
UDP和TCP使用同一个端口,可行吗?
(GGG)JWT
让百度地图生成器里的“标注”内容展开--解决方案
export , export default, import complete usage
AI可通过X光片识别种族,但没人知道为什么
从追赶到超越,国产软件大显身手
阿里二面:列出 Api 接口优化的几个技巧
Vue2进阶篇-编程式路由导航、缓存路由组件、路由的激活与失活
From catching up to surpassing, domestic software shows its talents
golang : Zap日志整合
sql concat()函数
bin文件夹下的roslyn文件夹
The calculation and source code of the straight line intersecting the space plane
go : use gorm to modify data
go : 使用gorm创建数据库记录
理解和熟悉递归中的尝试
DNS domain name resolution services
node.js中实现对数据库的链式操作
从 Google 离职,前Go 语言负责人跳槽小公司