
☆Star this public account to not miss any updates☆
Whether it is the CAN bus or any computer system, data is ultimately stored and processed in binary. However, for the convenience of human reading and writing, we extensively use hexadecimal and decimal.

Below, I will explain in detail binary, decimal, and hexadecimal, as well as their relationships and conversion methods.
1. Decimal
-
Base 10: Uses 10 symbols:
<span><span>0, 1, 2, 3, 4, 5, 6, 7, 8, 9</span></span> -
Place Value: The weight of each digit is a power of 10 (from right to left, starting from 0).
-
How to Understand: This is the counting system we use every day in our lives.
Example: The number 123
-
<span><span>3</span></span>is in the units place, representing<span><span>3 * 10⁰ = 3 * 1 = 3</span></span> -
<span><span>2</span></span>is in the tens place, representing<span><span>2 * 10¹ = 2 * 10 = 20</span></span> -
<span><span>1</span></span>is in the hundreds place, representing<span><span>1 * 10² = 1 * 100 = 100</span></span> -
Total:
<span><span>100 + 20 + 3 = 123</span></span>
2. Binary
-
Base 2: Uses only 2 symbols:
<span><span>0, 1</span></span> -
Place Value: The weight of each digit is a power of 2 (from right to left, starting from 0).
-
How to Understand: This is the only “language” that computer hardware can directly understand. A binary digit (bit) represents a
<span><span>0</span></span>or<span><span>1</span></span>.
Example: The number <span><span>1101</span></span> (binary)
-
Calculate the weight of each digit from right to left:
-
The rightmost 0 place:
<span><span>1 * 2⁰ = 1 * 1 = 1</span></span> -
The 1 place:
<span><span>0 * 2¹ = 0 * 2 = 0</span></span> -
The 2 place:
<span><span>1 * 2² = 1 * 4 = 4</span></span> -
The 3 place:
<span><span>1 * 2³ = 1 * 8 = 8</span></span> -
Total:
<span><span>8 + 4 + 0 + 1 = 13</span></span>(decimal) -
Therefore, binary
<span><span>1101</span></span>= decimal<span><span>13</span></span>
3. Hexadecimal
-
Base 16: Uses 16 symbols:
<span><span>0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F</span></span> -
<span><span>A</span></span>= 10,<span><span>B</span></span>= 11,<span><span>C</span></span>= 12,<span><span>D</span></span>= 13,<span><span>E</span></span>= 14,<span><span>F</span></span>= 15 -
Place Value: The weight of each digit is a power of 16 (from right to left, starting from 0).
-
How to Understand: It is a perfect abbreviation of binary. Since
<span><span>16 = 2⁴</span></span>, one hexadecimal digit can represent exactly 4 binary digits (4 bits). This makes it an excellent tool for representing binary data, much more convenient than writing a long string of<span><span>0</span></span>and<span><span>1</span></span>.
Example: The number <span><span>0x2F</span></span> (hexadecimal)
-
<span><span>0x</span></span>or<span><span>h</span></span>is a common prefix or suffix for hexadecimal numbers to distinguish them from decimal numbers. -
Calculate from right to left:
-
The 0 place:
<span><span>F * 16⁰ = 15 * 1 = 15</span></span> -
The 1 place:
<span><span>2 * 16¹ = 2 * 16 = 32</span></span> -
Total:
<span><span>32 + 15 = 47</span></span>(decimal) -
Therefore, hexadecimal
<span><span>2F</span></span>= decimal<span><span>47</span></span>
Disclaimer: This public account maintains neutrality regarding all original, reprinted, and shared content, statements, views, and judgments. The articles published are for readers’ reference only, and the copyright of the published articles, videos, images, etc., belongs to the authors. If any reprinted works have incorrect author or source markings or involve infringement, please kindly remind the original author and contact the editor for deletion.

If you like this article, feel free to share it and spread knowledge for joy.