Number Systems

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:

8 4 2 1
 …  23  22  21 20

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

Example :

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.
16 8 4 2 1
  • Write a 1 under the largest value that fits into the 19.
16 8 4 2 1
1
  • Subtract 16 out of 19. You get a residual value of 3.
  • Write a 1 under the largest value that fits into the 3.
16 8 4 2 1
1  1
  • Subtract 2 from 3. You get a residual value of 1.
16 8 4 2 1
1 1 1
  • Subtract 1 from 1, you get the residual value 0, fill the empty fields of the table with 0.
16 8 4 2 1
1 0 0 1 1

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.

Example:

Bit sequence 010100001100101000111111
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

Number Hexadecimal Decimal Binary/Dual
Position 1 2 1 4 3 2 1
1 0 0 0 0 0 0
2 1 1 0 0 0 1
3 2 2 0 0 1 0
4 3 3 0 0 1 1
5 4 4 0 1 0 0
6 5 5 0 1 0 1
7 6 6 0 1 1 0
8 7 7 0 1 1 1
9 8 8 1 0 0 0
10 9 9 1 0 0 1
11 A 1 0 1 0 1 0
12 B 1 1 1 0 1 1
13 C 1 2 1 1 0 0
14 D 1 3 1 1 0 1
15 E 1 4 1 1 1 0
16 F 1 5 1 1 1 1

 

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.