当前位置:网站首页>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
边栏推荐
- 2022.07.03 (LC 6108 decryption message)
- Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
- 【C】 (written examination questions) pointer and array, pointer
- How to do the project of computer remote company in foreign Internet?
- Verilog tutorial (11) initial block in Verilog
- Business implementation - the log is written to the same row of data
- 【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
- Distributed base theory
- Advanced template
- 企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
猜你喜欢
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
[selenium automation] common notes
Huawei employs data management experts with an annual salary of 2million! The 100 billion market behind it deserves attention
Power operation and maintenance cloud platform: open the new mode of "unattended and few people on duty" of power system
Significance of acrel EMS integrated energy efficiency platform in campus construction
Application of multi loop instrument in base station "switching to direct"
Summer challenge brings you to play harmoniyos multi terminal piano performance
URL和URI
城市轨道交通站应急照明疏散指示系统设计
PMP certificate renewal process
随机推荐
人脸识别5- insight-face-paddle-代码实战笔记
【雅思阅读】王希伟阅读P3(Heading)
P4408 [noi2003] truant children (tree diameter)
P4281 [AHOI2008]紧急集合 / 聚会(LCA)
Nine Qi single chip microcomputer ny8b062d single key control four LED States
lambda expressions
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
Cross domain request
【C】(笔试题)指针与数组,指针
2022.07.03(LC_6111_统计放置房子的方式数)
[path planning] RRT adds dynamic model for trajectory planning
JS how to realize array to tree
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
In June, the list of winners of "Moli original author program" was announced! Invite you to talk about the domestic database
Learning of basic amplification circuit
Application of fire fighting system based on 3D GIS platform
How to effectively monitor the DC column head cabinet
22-07-02周总结
Hisilicon 3559 universal platform construction: YUV422 pit stepping record
The pit of sizeof operator in C language