Last modified on April 25th, 2024

chapter outline

 

Binary to Hexadecimal

A binary-to-hexadecimal conversion is done to convert a binary number (base 2) to its equivalent hexadecimal number (base 16). It is done by the given methods.

Direct Method: Using Table

In this method, we directly represent a group of binary digits (of 4 bits) to its hexadecimal value using the conversion table.

Let us convert (11010)2 into its corresponding hexadecimal number.

Step 1: Grouping 11010 into 4 bits starting from the right, we have (1) and (1010).

Step 2: Since the first group is not of four bits, we add zeros to the front. Now, the groups (0001) and (1010) are of four bits. 

Step 3: We find their corresponding hexadecimal values using the conversion table.

Binary to Hexadecimal
Binary NumberHexadecimal Number
00000
00011
00102
00113
01004
01015
01106
01117
10008
10019
1010A
1011B
1100C
1101D
1110E
1111F

By converting each group into its corresponding hexadecimal values, we get

(0001)2 = (1)16 and (1010)2 = (A)16

Step 4: Taking the values based on the order of the groups, we get

(11010)2 = (1A)16

For Fractional Hexadecimal Numbers

Similarly, we convert the fractional binary numbers into corresponding hexadecimal numbers by grouping them into four bits. Unlike the integral part, the fractional part should be grouped from left to right. 

Now, converting (0.101)2 into its equivalent hexadecimal, we get

For the Integral Part:

(0)2 → (0000)2 → (0)16

For the Fractional Part:

(101)2 → (1010)2 → (A)16

Thus, (0.101)2 = (0.A)16

Convert (1111110010001)2 into its equivalent hexadecimal number.

Solution:

(0001) → 1
(1111) → F
(1001) → 9
(0001) → 1
(1111110010001)2 → (1F91)16

Indirect Method: Without Using Table

There is another way the binary numbers are represented to their corresponding hexadecimal numbers without using the conversion table. 

Let us convert (100101)2 into its hexadecimal number.

First, we convert 100101 into its corresponding decimal number and then to the hexadecimal.

Step 1: Binary to Decimal

While converting (100101)2 to its respective decimal number, we multiply each digit (right to left) by the corresponding powers of 2, as shown.

Binary Value100101
Decimal Value1 × 25 = 320 × 24 = 00 × 23 = 01 × 22 = 40 × 21 = 01 × 20 = 1

Now, on adding the value, we get the decimal number

32 + 0 + 0 + 4 + 0 + 1 = 32 + 4 + 1 = 37

Step 2: Decimal to Hexadecimal

Now, converting (37)10 into its hexadecimal form, we divide the number repeatedly by 16 until the quotient is 0.

On dividing 37 by 16, the quotient is 2, and the remainder is 5

Further, by repeating the same steps, we get

2 ÷ 16, quotient = 0, and remainder = 2

When the quotient is 0, the hexadecimal number is obtained by writing the remainders in reverse order (from last to first). 

Thus, (37)10 = (25)16

Translate (11000)2 in its equivalent hexadecimal form without using the conversion chart.

Solution:

By converting (11000)2 into its corresponding decimal, we get
(1 × 24) + (1 × 23) + (0 × 22) + (0 × 21) + (0 × 20) = 16 + 8 + 0 + 0 + 0 = 24
Now, by converting (24)10 into its corresponding hexadecimal, we get
24 ÷ 16, quotient = 1, and remainder = 8
1 ÷ 16, quotient = 0, and remainder = 1Thus, (11000)2 = (18)16

Last modified on April 25th, 2024