Hexadecimal to Binary and Binary to Hexadecimal Conversion Solved Examples

Hexadecimal to Binary and Binary to Hexadecimal Conversion


The conversion between hexadecimal and binary number system is easy and straightforward task. Let's start.

Key Questions:
  • Convert binary numbers into hexadecimal numbers
  • Convert hexadecimal numbers into binary numbers
  • How to convert binary fraction into hexadecimal fraction
  • How to convert hexadecimal fraction into binary fraction

Hexadecimal numbers
00
01
02
03
04
05
06
07
Binary numbers
0000
0001
0010
1111
0100
0101
0110
0111
Hexadecimal numbers
08
09
0A
0B
0C
0D
0E
0F
Binary numbers
1000
1001
1010
1011
1100
1101
1110
1111


Binary to Hexadecimal Conversion:

Whenever converting from binary to hexadecimal numbers, start with making group of 4 bits. But why we use 4 bits? Because  4 bits represent 16 different values. Or the largest possible value for 4 bit number is 2n-1. For integers start making group of 4 from right to left.

Example 11100111101)2

0111 0011 1101

The above binary number is an 11 bit number. You make two 4 bits groups easily. For third group add zero at the leftmost position. So 3 groups of 4 bits has been made as shown above.

For fractional numbers, start making groups of 4 bits from left to right.

Example: 0.11100110111)2

0.1110 0110 1110

In the above fractional number you can easily make two groups of 4 bits, starting from left. While for third group of 4 bits we have to add a zero at the rightmost position as shown above.

Let's solve some examples so that the you understand the conversion method.

Convert the given binary number into hexadecimal number Example#01: 1111111111)2  = ?)16


Making group of 4 bits
0011 1111 1111

Binary number
0011
1111
1111
Hexadecimal number
3
F
F


Answer 1111111111)2  = 3FF)16


Convert the given binary number into hexadecimal number Example#2: 110010111010.11111111)2=?)16


Making group of 4 bits

1100 1011 1010.1111 1111


Binary number
1100
1011
1010
.
1111
1111
Hexadecimal number
C
B
A
.
F
F

Answer 110010111010.11111111)2=CBA.FF)16


 

Convert the given binary number into hexadecimal number  Example#03: 11001100110011.111000111)2= ?)16


Making group of 4 bits

0011 0011 0011 0011.1110 0011 1000

Adding two 0s on leftmost side to complete a group of 4 bits. Adding three 0s on rightmost position in order to complete a group of 4 bits.


Binary number
0011
0011
0011
0011
.
1110
0011
1000
Hexadecimal number
3
3
3
3
.
E
3
8

Answer  11001100110011.111000111)2= 3333.E38)16


Hexadecimal to Binary Conversion:

When converting from Hexadecimal to binary number pick a single hexadecimal digit and convert it to equivalent binary number. One thing you have to keep in mind that binary number should be represent in 4 bit format. For example

1)16=0001)2 right way
1)16=1)2 wrong way

Note: this is wrong while using this technique. Otherwise it is absolutely right.  
1)16=1)2

Convert the given hexadecimal number into binary number Example#01:3FF)16= ?)2


3)16=0011)2

Hexadecimal number
3
F
F
Binary number
0011
1111
1111

Answer 3FF)16= 001111111111)2


Convert the given hexadecimal number into binary number Example#02:CBA.FF)16= ?)2



Hexadecimal number
C
B
A
.
F
F
Binary number
1100
1011
1010
.
1111
1111

Answer CBA.FF)16= 110010111010.11111111)2


Convert the given hexadecimal number into binary number Example#03: 3333.E38)16= ?)2


Hexadecimal number
3
3
3
3
.
E
3
8
Binary number
0011
0011
0011
0011
.
1110
0011
1000


Answer 3333.E38)16= 11001100110011.111000111)2

Octal To Binary And Binary To Octal Numbers Conversion

Octal Numbers to Binary Numbers and Binary Numbers to Octal Numbers

The conversion between binary numbers and octal numbers is very easy and straightforward task. Let's start.

Key Questions:
  • Convert octal number into binary number
  • Convert binary number into octal number
  • Convert octal fractional number into binary fractional number
  • Convert binary fractional number into octal fractional number


Octal numbers
00
01
02
03
04
05
06
07
Binary numbers
00
01
10
11
100
101
110
111

Binary to Octal Conversion:


Whenever converting from binary to octal, its easy, just make group of 3 bits. And convert each 3 bit group to its equivalent octal value. But why we make group of 3 bits? Because 3 bits number in binary the total values can be expressed are 2n or largest possible value for a 3 bit number is 2n-1=7. The total digits or unique symbols in base 8 (octal) syatem are 8.
For integers start making groups from right to left.
Example 01011101)2
   010 011 101
                      
                                   Start making group of 3 bits from here

We have a 8 bit number. Start making group of 3 bits from right. You can make 2 groups easily. For 3rd  3 bit group we have to add extra 0. As shown above

For fractional part start making group from left to right.
Example 0.1111000111)2

0.111 100 011 100
                                ⇗

          Start making group of 3 bits from here


Example#01:110111011.11010)2=?)2
Making group of 3 bits
110 111 011 . 110 100

Binary number
110
111
011
.
110
100
Octal number
6
7
3
.
6
4

Answer 110111011.11010)2=673.64)8


Example#02: 101111001.010101)2
Making group of 3 bits
101 111 001.010 101

Binary number
101
111
001
.
010
101
Octal number
5
7
1
.
2
5

Answer 110111011.11010)2=571.25)8


Example#03: 1111110011111001)2=?)8
Making group of 3 bits
001 111 110 011 111 001

Note: add two zeros on the left in order to make group of 3 bits.

Binary number
001
111
110
011
111
001
Octal number
1
7
6
3
7
1

Answer  1111110011111001)2=176371)8

Octal to Binary Conversion:

The conversion method is to take individual octal digit and convert it in binary. Make sure convert in the way that each octal digit should represent in 3 bit binary group.
For example if
                      1)8 =001)2  right way
                   
                      1)8 =1)2 wrong way

Note: this is wrong for this conversion technique only. Otherwise it is obviously the same.
1)8 =1)2

Example#01:673.64)8= ?)2
Represent each octal digit in 3 bit binary number.

Octal number
6
7
3
.
6
4
Binary number
110
111
011
.
110
100

Answer 673.64)8= 110111011.110100)2
Or 673.64)8= 110111011.1101)2

Note: you can remove the right most 0s that are unnecessary.


Example#02: 571.25)8?)2
Represent each octal digit in 3 bit binary number.

Octal number
5
7
1
.
2
5
Binary number
101
111
001
.
010
101

Answer 571.25)8= 101111001.010101)2


Example#03: 176371)8=?)2

Represent each octal digit in 3 bit binary number.


Octal number
1
7
6
3
7
1
Binary number
001
111
110
011
111
001

Answer 176371)8= 1111110011111001)2

Popular Posts