Radix Conversion in Digital Electronics


In positional number systems, the radix is the total number of unique digits that are used to represent numbers in that number system. Radix is also called Base. For example, in decimal number system, we use total ten digits from 0 to 9 (i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) to represent any decimal number. Therefore, for the decimal number system, the radix or base is ten (10).

Although we can easily convert a given number from one radix (i.e. number system) to any other radix (number system) by using radix conversion protocols. In this article, we will understand the radix conversion with the help of examples. But before that let us first know briefly about the four most common types of number systems.

  • Decimal Number System − The radix or base of the decimal number system is ten (10), thus it has 10 unique digits from 0 to 9 to represent different numbers. Decimal number system is the most common in human calculations.

  • Binary Number System − The radix or base of the binary number system is two (2). Thus, binary number system has only two digits 0 and 1. Each binary digit is called a bit. Binary number system is the extensively used in digital system design.

  • Octal Number System − The radix or base of the octal number system is eight (8). Therefore, octal number system has eight digits from 0 to 7 to represent octal numbers. It is also used in digital systems.

  • Hexadecimal Number SysteExample 3 m − The radix or base of the hexadecimal number system is sixteen (16). Hence, hexadecimal number system contains total 16 unique digits from 0 to 15, where, 0 to 9 are used as in the decimal number system, but 10 to 15 are denoted by a character, i.e., 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F. It number system is also used in electronic system such as microcontrollers.

In this tutorial, we will discuss in detail the following types of conversion −

  • Decimal to Binary Conversion

  • Binary to Decimal Conversion

  • Decimal to Octal Conversion

  • Octal to Decimal Conversion

  • Decimal to Hexadecimal Conversion

  • Hexadecimal to Decimal Conversion

  • Binary to Octal Conversion

  • Octal to Binary Conversion

  • Binary to Hexadecimal Conversion

  • Hexadecimal to Binary Conversion

Now, let us discuss each of these radix conversion one by one.

Decimal to Binary Conversion

We can convert a number given in the decimal number system into its corresponding number in the binary number system. There are two methods to convert a number from decimal number system to binary number system, namely sum of weights method and double-dabble method.

In the sum of weights method, the set of binary weight values whose sum is equal to the given decimal number is determined. This method is suitable only for small numbers, because in this method, we need to remember the values of various powers of 2.

In the double-dabble method, the decimal integer number is converted into an equivalent binary integer number by successive division by 2, and the fractional part of the decimal number is converted into equivalent binary fractional number by successive multiplication by 2.

Now, let us understand these two methods of decimal to binary conversion with the help of solved examples.

Example 1

Convert $\lgroup 165\rgroup_{10}$ to its equivalent binary number.

Solution

Given decimal number is $\lgroup 165\rgroup_{10}$.

Sum-of-Weights Method − The largest decimal number, which is a power of 2, and not exceeding 165 is 128,

$$128=2^{7}=\lgroup 10000000\rgroup_{2}$$

The remainder is,

$$165-128=37$$

Now, the largest decimal number, which is a power of 2 and not exceeding 37 is 32,

$$32=2^5=\lgroup 100000\rgroup^2$$

The remainder is,

$$37-32=5$$

The largest decimal number, which is a power of 2 and not exceeding 5 is 4,

$$4=2^{2}=\lgroup 100\rgroup_{2}$$

The remainder is,

$$5-4=1$$

Finally,

$$1=2^{0}=\lgroup 1\rgroup_{2}$$

Therefore,

$$\lgroup 165\rgroup_{10}=\lgroup 10000000\rgroup_{2}+\lgroup 100000\rgroup_{2}+\lgroup 100\rgroup_{2}+\lgroup 1\rgroup_{2}=\lgroup 10100101\rgroup_{2} $$

This process can also be represented as,

Binary Weights

27

26

25

24

23

22

21

20

Binary Weight Values

128

64

32

16

8

4

2

1

Bit

1

0

1

0

0

1

0

1

Double-Dabble Method − In this method, we will divide the given decimal number successively by 2 and read the remainders upwards to obtain the equivalent binary number.

Divisor

Number

Remainder

2

165

1

2

82

0

2

41

1

2

20

0

2

10

0

2

5

1

2

2

0

2

1

1

2

0

Reading the remainders from bottom to top, the equivalent binary number is $\lgroup 165\rgroup_{10}= \lgroup 10100101\rgroup _2 $.

Binary to Decimal Conversion

We can convert a given binary number into its equivalent decimal number by using the positional weights method. In the positional weight method, each bit of the binary number is multiplied by its position weight and the product terms are then added together to get the decimal number.

Example 2

Convert $\lgroup 101101\rgroup_2 $ into its equivalent decimal number.

Solution

Given binary number is $\lgroup 101101\rgroup _2$.

Binary digits

1

0

1

1

0

1

Positional weights

25

24

23

22

21

20

Positional weights

(1×25)

(1×24)

(1×23)

(1×22)

(1×21)

(1×20)

32

0

8

4

0

1

Hence, the equivalent decimal number will be,

$$\mathrm{\lgroup 101101\rgroup_2=32+0+8+4+0+1= \lgroup 45\rgroup_{10}}$$

Decimal to Octal Conversion

We can covert a given decimal number into its equivalent octal number by successive division of the given number by 8 till the quotient is 0. Then, the octal number is obtained by reading the remainders upwards.

Example 3

Convert $(370)_{10}$ to equivalent octal number.

Solution

Given decimal number is $(370)_{10}$.

Divisor

Number

Remainder

8

370

2

8

46

6

8

5

5

0

Reading the remainders from bottom to top, the equivalent octal number is $\lgroup 370\rgroup_{10} = \lgroup 562\rgroup_{8} $.

Octal to Decimal Conversion

We can convert a given octal number into its equivalent decimal number by multiplying each digit in the octal number by the weight of its position and adding all the product terms.

Example 4

Convert $\lgroup 4050\rgroup_8 $to equivalent decimal number.

Solution

The given octal number is $\lgroup 4050\rgroup_8 $.

Octal digits

4

0

5

0

Positional weights

83

82

81

80

Multiplying

(4 × 83)

(0 × 82)

(5 × 81)

(0 × 80)

2048

0

40

0

Therefore, the equivalent decimal number will be,

$$\mathrm{\lgroup 4050\rgroup_8=2048+0+40+0= \lgroup 2088\rgroup_{10}}$$

Decimal to Hexadecimal Conversion

We can convert a decimal number into its equivalent hexadecimal number by successively dividing the given decimal number by 16 till the quotient is zero. Then, the remainders are to be read from bottom to top to obtain equivalent hexadecimal number.

Example 5

Convert $\lgroup 2590\rgroup_{10} $ to its equivalent hexadecimal number.

Divisor

Number

Remainder

Decimal

Hexadecimal

16

2590

14

E

16

161

1

1

16

10

10

A

0

Reading the remainders from bottom to top, the equivalent hexadecimal number is $\lgroup 2590\rgroup_{10} = \lgroup E1A\rgroup_{16}$.

Hexadecimal to Decimal Conversion

We can covert a given hexadecimal number to its equivalent decimal number by multiplying each digit of the hexadecimal number by its position weight and then add all the product terms to get the equivalent decimal number.

Example 6

Convert $\lgroup 5B7\rgroup_{16}$ to its equivalent decimal number.

Solution

The given hexadecimal number is $\lgroup 5B7\rgroup_{16}$.

Hex digits

5

B (10)

7

Positional weights

162

161

160

Multiplying

(5 ×162)

(10×161)

(7×160)

1280

160

7

Therefore, the equivalent decimal number will be,

$$\mathrm{\lgroup 5B7\rgroup_{16}=1280+160+7= \lgroup 1447\rgroup _{10}}$$

Binary to Octal Conversion

An octal digit is equivalent to a group of 3 binary bits. Hence, by using this relation, we can directly convert a binary number into the equivalent octal number. Hence, we convert a binary number into an equivalent octal number by making groups of 3 bits each, and then by replacing each 3 bit binary group by its equivalent octal digit.

Example 7

Convert $\lgroup 101101\rgroup_{2}$ to its equivalent octal number.

Solution

The given binary number is $\lgroup 101101110\rgroup_{2}$.

Groups of 3-bits

101

101

110

Octal equivalent

5

5

6

Therefore, the equivalent octal number is,

$$\lgroup 101101110\rgroup_{2}=\lgroup 556\rgroup_{8}$$

Octal to Binary Conversion

We can easily convert an octal number into its equivalent binary number just by replacing each octal digit by its 3-bit binary equivalent.

Example 8

Convert $\lgroup 366\rgroup_{8}$ to its equivalent binary number.

Solution

The given octal number is $\lgroup 366\rgroup_{8}$.

Octal number

3

6

6

Equivalent 3-bit binary

011

110

110

Therefore, the equivalent binary number is,

$$\lgroup 366\rgroup_{8}=\lgroup 011110110\rgroup_{2}$$

Binary to Hexadecimal Conversion

A hexadecimal digit is equivalent to a group of 4 binary bits. This relationship can be used to convert a binary number to its equivalent hexadecimal number. Thus, in order to convert a given binary number to equivalent hexadecimal number, we make groups of 4 bits each, and replace each 4-bit binary group by the equivalent hexadecimal digit.

Example 9

Convert $\lgroup 101011011\rgroup_{2}$ to the equivalent hexadecimal number.

Solution

The given binary number is $\lgroup 101011011\rgroup_{2}$.

Groups of 4-bits

0001

0101

1011

Hex equivalent

1

5

B (11)

Therefore, the equivalent hexadecimal number is,

$$\lgroup 101011011\rgroup_{2}=\lgroup 15B\rgroup_{16}$$

Hexadecimal to Binary Conversion

We can simply convert a hexadecimal number to equivalent binary number just by replacing each digit in the given hexadecimal number by its 4-bit binary group.

Example 10

Convert $\lgroup 5C8\rgroup_{16}$ to equivalent binary number.

Solution

The given number is $\lgroup 5C8\rgroup_{16}$.

Hex number

5

C (12)

8

Equivalent 4-bit binary

0101

1100

1000

Therefore, the equivalent binary number is,

$$\lgroup 5C8\rgroup_{16}=\lgroup 010111001000\rgroup_{2}$$

Conclusion

In this tutorial, we discussed radix or base conversion with help of solved examples. Radix conversion is an important process when we deal in different number systems. For example, a computer uses binary number system, while we (human) use decimal number for calculation.

Sometimes, we need to manually perform some calculations executed by computer such as to verify the results. In such situations, radix conversion is used to convert a binary to decimal number to simplify the calculation, because the decimal number system is more convenient for us.

Updated on: 03-Oct-2023

557 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements