当前位置:网站首页>Binary conversion problem
Binary conversion problem
2022-07-05 00:26:00 【The learning path of Java Rookies】
Base number
One 、 Introduction to the system
For integers , There are four representations :
Binary system : 0, 1 , full 2 Into the 1. With 0b or 0B start .
Decimal system : 0-9 , full 10 Into the 1.
octal : 0-7 , full 8 Into the 1. In numbers 0 It begins with .
Hexadecimal : 0-9 And A(10)-F(15) , full 16 Into the 1. With 0x or 0X It begins with
Two 、 The conversion of Radix
1. Binary and decimal conversion
Binary to decimal
Convert decimal to binary
The rules : Divide the number by 2 , Until Shang Wei 0 until , Then reverse the remainder of each step , It's the binary system .
Case study : Please put 34 Convert to binary = 0B00100010
2. Binary and octal conversion
Binary to octal
The rules : Starting from the low , Group binary numbers into three bits , Convert to the corresponding octal number .
Case study : Please put ob11010101 Convert to octal
ob11010101 => 0325
Octal to binary
The rules : Put the octal number every 1 position , Turn to the corresponding one 3 A binary number of bits .
Case study : Please put 0237 Convert to binary
Be careful :0 The beginning indicates octal
0237 = 0b10011111
3. Binary and hexadecimal conversion
Binary to hexadecimal
The rules : Starting from the low , Set the binary numbers in groups of four , Convert to the corresponding hexadecimal number .
Case study : Please put ob11010101 Convert to hex
ob1101(D)0101(5) = 0xD5
Hexadecimal to binary
The rules : Put the hexadecimal number every 1 position , Convert to corresponding 4 A binary number of bits .
Case study : Please put 0x23B Convert to binary
0x2(0010)3(0011)B(1011) = 0b001000111011
边栏推荐
- C语言中sizeof操作符的坑
- Netcore3.1 JSON web token Middleware
- P4281 [ahoi2008] emergency assembly / gathering (LCA)
- Design of emergency lighting evacuation indication system for urban rail transit station
- What is the difference between port mapping and port forwarding
- uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
- URL和URI
- P4281 [AHOI2008]紧急集合 / 聚会(LCA)
- Application of fire fighting system based on 3D GIS platform
- 实战模拟│JWT 登录认证
猜你喜欢
[paper reading] Tun det: a novel network for meridian ultra sound nodule detection
《论文笔记》Multi-UAV Collaborative Monocular SLAM
Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
圖解網絡:什麼是網關負載均衡協議GLBP?
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
2022.07.03(LC_6111_统计放置房子的方式数)
abc 258 G - Triangle(bitset)
分布式BASE理论
同事的接口文档我每次看着就头大,毛病多多。。。
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
随机推荐
1189. Maximum number of "balloons"
人脸识别5- insight-face-paddle-代码实战笔记
Nine Qi single chip microcomputer ny8b062d single key control four LED States
基于三维gis平台的消防系统运用
【C】 (written examination questions) pointer and array, pointer
ORB(Oriented FAST and Rotated BRIEF)
分布式BASE理论
青海省国家湿地公园功能区划数数据、全国湿地沼泽分布数据、全国省市县自然保护区
[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])
Five papers recommended for the new development of convolutional neural network in deep learning
[monitoring] ZABBIX
Acrel-EMS综合能效平台在校园建设的意义
打新债开户注册安全吗?有没有风险的?靠谱吗?
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
2022.07.03(LC_6108_解密消息)
雅思考试流程、需要具体注意些什么、怎么复习?
Using the uniapp rich text editor
挖财学院开户安全的吗?开户怎么开?
Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
JS 将伪数组转换成数组