While working with your RevPi system you will always be confronted with different number systems. For all of you who are new to the topic and for those of you who have learned and repressed this at some point, we have created a small summary here.
Binary number system
The binary number system is the basis for electronic data processing, since only two logical states (1 and 0) can be distinguished here. A computer must therefore make all calculations with these two numbers.
At first glance this looks as if there are very limited possibilities to express oneself with this number system. However, as in all other number systems, we have places available that take values. The binary number system is based on the number 2, which means that the values here simply double:
Each of these digits can have two different values (0 or 1) A single-digit dual number is called a bit (binary digit). Thus two numbers can be represented with one bit (0 or 1). With 2 bits the possibilities are doubled:
00, 01, 10, 11
We calculate the decimal number 19 into the dual number system:
- Write down a table that goes from the one digit of the dual system to the digit that is smaller (or the same size) than 19.
- Write a 1 under the largest value that fits into the 19.
- Subtract 16 out of 19. You get a residual value of 3.
- Write a 1 under the largest value that fits into the 3.
- Subtract 2 from 3. You get a residual value of 1.
- Subtract 1 from 1, you get the residual value 0, fill the empty fields of the table with 0.
The decimal number 19 corresponds to the dual number 10011.
Hexadecimal number system
The hexadecimal number system is used to display large dual numbers clearly. Long bit sequences are divided into 4 bits each and converted into a hexadecimal number.
|Grouped bit sequence||0101||0000||1100||1010||0011||1111|
|Converting to Hex Numbers||5||0||C||A||3||F|
|Grouped hex numbers||50||CA||3F|
Overview of number systems
Don’t make it so hard!
Mental arithmetic keeps you mentally fit, but if you need it to be fast, you can also use the accessory calculator on your PC:
- Open the Accessory Calculator.
- Switch to the programmer view.
- Enter a value.
- Select the desired number system.
The value is displayed in the desired number system.