Radix Conversion

By Administrator 16-Sep-2022

The number system we most familiar is Decimal (Base 10) which is used in our real world for counting numbers, cash, amount and other things. As a computer, it uses Binary (Base 2) number system, as they symbolizes for operating two states - on and off and its binary combinations. In computing, we also use Hexadecimal (Base 16) or Octal (Base 8) number systems, as a compact form of binary number representation.


Decimal Number system ranges from 0 to 9, which will count up next to 10 (ten). The lowest place is the rightmost position, and each successive position to the left has a higher place value. The rightmost position represents the "ones" column, the next position represents the "tens" column, the next position represents "hundreds", etc. Therefore, the number "123" represents 1 hundred(102), 2 tens(101) and 3 tens(100). Basically, after we count up the number from 0 to 9 (9 ones of 100), there is no number count up next to 9. So, it will go up 1 at the left one position and the right position will go to start 0. The next number we count will be 10 which defines 1 tens of 101 and 0 ones of 100.

Binary, Octal and Hexadecimal numbers goes the same way to count. When decimal number is based on 10, binary number will be based on 2, octal will be 8 and Hexadecimal will be 16.

So, the number of three digits position as follows. 

22 , 21 , 20

82 , 81 , 80

162 , 161 , 160

So, we are going to learn to convert between those number systems (decimal, binary, octal and hexadecimal numbers).
Let's divided into three groups.
(1) Decimal ⇔ Binary, Octal and Hexadecimal numbers
(2) Binary, Octal and Hexadecimal ⇔ Decimal numbers
(3) Binary ⇔ Octal ⇔ Hexadecimal

(1) Decimal ⇔ Binary, Octal and Hexadecimal numbers

Let's see the example. 

Decimal Number : (23)10

➡ (23)10 To Binary Number (Base 2) => The result is (10111)2 


Note: The last digit will be the 1st remainder and it will go the sequence as 5th, 4th, 3rd, 2nd and 1st. 

 (23)10 To Octal Number (Base 8) => The result is (27)8 


Note: The last digit will be the 1st remainder and it will go the sequence as 2nd and 1st. 

 (23)10 To Hexadecimal Number (Base 16) => The result is (17)16 


Note: The last digit will be the 1st remainder and it will go the sequence as 2nd and 1st. 

(2) Binary, Octal and Hexadecimal ⇔ Decimal numbers

(111011)To Decimal Number (Base 10) => The result will be (59)10 


(124)To Decimal Number (Base 10) => The result will be (84)10 


(A2)16 To Decimal Number (Base 10) => The result will be (162)10 


(3) Binary ⇔ Octal ⇔ Hexadecimal

During conversion among binary, octal and hexadecimal numbers, we have to convert to Base 2 Binary number format. We can represent three digits separator for Octal number and four digits separator for Hexadecimal number. 



Random Tips