当前位置:网站首页>[embedded C foundation] Part 2: binary conversion and BCD coding
[embedded C foundation] Part 2: binary conversion and BCD coding
2022-07-28 13:01:00 【Black cat senior】
1 Preface
D Decimal system
B Binary system
H Hexadecimal
What is power ?
power : Weight refers to the basic unit of each bit in the data .
For example, numbers in decimal 123, that 3 It's everybody , take a temporary measure 1,2 It's ten , take a temporary measure 10,1 It's a hundred , Right is 100.
Decimal system 10 Of i Power (i What's the number )
Binary system 2 Of i Power
Others in the same way
2 Non decimal to decimal

3 Decimal to non decimal
3.1 Decimal to binary
The integer part is converted to binary number by “ except 2 Remainder ” Methods , That is, continuous division 2 And take the remainder as the result , Until business is 0, The remainder obtained is arranged in sequence from low to high, that is, the integer part of the converted binary number ;
For the decimal part , Then use “ ride 2 integer ” Methods , That is, the decimal part is used continuously 2 ride , Take the integer part of the first product as the highest bit , Until the required precision is achieved or the decimal part is 0 until .
边栏推荐
猜你喜欢

Flexpro software: measurement data analysis in production, research and development
![[June 28 event preview] low code Summit](/img/ba/2f35306ed2fb0ece14d704256d8e60.png)
[June 28 event preview] low code Summit

Li FuPan: application practice of kata safety container in ant group

单调栈Monotonic Stack

Machine learning practice - logistic regression-19

2020-12-13

Which big model is better? Openbmb releases bmlist to give you the answer!

【C语言易错点】第4篇:结构体在内存中存储规则详讲

Scala transformation, filtering, grouping, sorting

Summary: golang's ide:vscode usage
随机推荐
A brief introduction to the for loop. Some of the code involves arrays
Qt 信号和槽机制( 详解 )
Redefinition problem of defining int i variable in C for loop
Hc-05 Bluetooth module debugging slave mode and master mode experience
Sliding Window
Using JSON in C language projects
Insufficient permission to pull server code through Jenkins and other precautions
如何在 TiDB Cloud 上使用 Databricks 进行数据分析 | TiDB Cloud 使用指南
力扣315计算右侧小于当前元素的个数
STM32 loopback structure receives and processes serial port data
Shenwenbo, researcher of the Hundred Talents Program of Zhejiang University: kernel security in the container scenario
What if the win11 folder cannot be opened
How many times can the WordPress user name be changed? Attach the method of changing user name
Databinding+LiveData轻松实现无重启换肤
What if win11 cannot recognize Ethernet
黑猫带你学eMMC协议第27篇:什么是eMMC的动态容量(Dynamic Capacity)?
Flexpro software: measurement data analysis in production, research and development
2020-12-07
Chapter IX rest Service Security
VS code更新后不在原来位置