当前位置:网站首页>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
边栏推荐
- 图解网络:什么是网关负载均衡协议GLBP?
- 【路径规划】RRT增加动力模型进行轨迹规划
- 1189. Maximum number of "balloons"
- Two numbers replace each other
- Hologres Query管理及超时处理
- Application of multi loop instrument in base station "switching to direct"
- 22-07-02周总结
- Summer challenge brings you to play harmoniyos multi terminal piano performance
- Cross domain request
- AcWing164. 可达性统计(拓扑排序+bitset)
猜你喜欢

He worked as a foreign lead and paid off all the housing loans in a year

【C】(笔试题)指针与数组,指针

Using fast parsing intranet penetration to realize zero cost self built website

如何避免电弧产生?—— AAFD故障电弧探测器为您解决

Continuous modification of business scenario functions

Hash table, hash function, bloom filter, consistency hash

Acrel-EMS综合能效平台在校园建设的意义
![[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection](/img/25/e2366cabf00e55664d16455a6049e0.png)
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection

In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database

Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
随机推荐
模板的进阶
Summary of week 22-07-02
Some basic functions of enterprise projects are developed, and important things are saved to online first a
如何将自己的代码作品快速存证,已更好的保护自己劳动成果
Verilog tutorial (11) initial block in Verilog
[IELTS reading] Wang Xiwei reading P4 (matching1)
Cross domain request
Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
P3304 [sdoi2013] diameter (diameter of tree)
[paper reading] Tun det: a novel network for meridian ultra sound nodule detection
Significance of acrel EMS integrated energy efficiency platform in campus construction
微服务(Microservice)那点事儿
Consolidated expression C case simple variable operation
PermissionError: [Errno 13] Permission denied: ‘data. csv‘
Learn C language from scratch day 024
How to use fast parsing to make IOT cloud platform
基于三维gis平台的消防系统运用
js如何实现数组转树
Instructions for go defer
(script) one click deployment of any version of redis - the way to build a dream