Menu Close

How to Convert Binary to Hexadecimal?

Posted in C Program Exercises, C Programming, C++ Programming, Computer Science, Digital Circuit, General Topics

1. Binary to Hexadecimal Table

 

Binary Hexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

2.Convert every 4 binary digits (start from bit 0) to 1 hex digit

So, if you make each group of 4 bit of binary input number, then replace each group of binary number from its equivalent hexadecimal digits. That will be hexadecimal number of given number. Note that you can add any number of 0’s in leftmost bit (or in most significant bit) for integer part and add any number of 0’s in rightmost bit (or in least significant bit) for fraction part for completing the group of 4 bit, this does not change value of input binary number.

So, these are following steps to convert a binary number into hexadecimal number.

  • Take binary number
  • Divide the binary digits into groups of four (starting from right) for integer part and start from left for fraction part.
  • Convert each group of four binary digits to one hexadecimal digit.

3. an Example of Converting 11011101102 to 1B6 16

an example of how to convert a binary number to hexadecimal:

Let’s say we want to convert the binary number 1101110110 to hexadecimal.

Step 1: Group the binary digits into groups of four, starting from the right.

1101 1101 10

Step 2: If the leftmost group has less than four digits, add zeroes to the left to make it a four-digit group.

0001 1011 0110

Step 3: Convert each four-digit binary group to its corresponding hexadecimal digit.

Related:   How to Convert Binary to Decimal

0001 = 1 1011 = B 0110 = 6

Step 4: Write the hexadecimal digits in order from left to right.

The hexadecimal equivalent of binary 1101110110 is 1B6.

Therefore, binary 1101110110 in hexadecimal is represented as 1B6.

Leave a Reply