You are on page 1of 23

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : Swathi K.N
Designation : Lecturer
Branch : Computer Engineering
Institute : Kamala Nehru Polytechnic For Women,
Hyd,
Year : I year
Subject : Computer Fundamentals and Office
Automation
Subject Code : CM-105
Topic : Fundamentals Of Computers
Duration : 100 minutes
Sub. Topic : Conversions of binary number to
hexadecimal, Conversions of
hexadecimal to binary
Teaching Aids : PPT, Images, Animation.
CM105.22TO23 1
Objective
On completion of this period, you would be able
to know:

Conversion of a binary number to hexa


decimal.

Conversion of a hexa decimal number to


binary

CM105.22TO23 2
Recap

 Conversions of binary number to decimal

CM105.22TO23 3
Prerequisite

 Representation of Binary system

 Representation of Hexadecimal system.

 Relationship between Binary and Hexadecimal.

CM105.22TO23 4
BINARY TO HEXADECIMAL

CM105.22TO23 5
Conversion of a binary number to
hexadecimal number
METHOD 1

As base16 = 24, to convert a binary number to


hexadecimal
 4-bit binary groups (each group contains 4
binary bits) are formed in the binary number.

 After forming the groups, each group of 4 binary


bits is converted to its hexadecimal number.

CM105.22TO23 6
1.Convert the binary number 01101110 to
its equivalent hexadecimal.
Divide the given binary number into 4-bit binary
groups

(01101110)2 = (0110) (1110)

= 6E (hex)
(01101110)2=(6E)16

CM105.22TO23 7
2.Convert the binary number 1101001101 to its
equivalent hexadecimal

 Forming of groups of 4-bits from right hand side


to left.

(1101001101)2 = (11) (0100) (1101)


 We see that the group of the most significant
binary bits
contains only 2 binary bits

CM105.22TO23 8
Convert the binary number 1101001101 to its
equivalent hexadecimal (contd)

 This can be extended to 4 binary bits by adding


zeros in MSB position.

 If MSBs are extended by adding zeros the


number remains unaffected.

(1101001101)2 = (0011) (0100) (1101)


= 34D (hex)
CM105.22TO23 9
3. Convert the binary number 1011100.1000101
to its equivalent hexadecimal

The formation of grouping of binary bits which are


after the binary point, is made from left to right.

1011100.1000101 = (101)(1100).(1000)(101)
= (0101)(1100).(1000)(1010)
= 5C.8A (hex)

CM105.22TO23 10
Conversion of a binary number to
hexadecimal number

METHOD 2

 First convert a binary number to decimal number

 Then convert the decimal number so obtained to


hexadecimal number.

CM105.22TO23 11
1.Convert the binary number 101101 to its
equivalent hexadecimal.

101101 = 1*25 + 0*24 + 1*23 +1*22 + 0*21 +1*20


= 32 + 0 + 8 + 4 +0 + 1
= (45)10

CM105.22TO23 12
Convert the binary number 101101 to its
equivalent hexadecimal (contd).

Now convert 45 into hexadecimal number.

division remainder
16 45
16 2 13 = D
0 2

(45)10 = (2D)16
Thus (101101)2 = (45)10 = (2D)16

CM105.22TO23 13
Conversion of a hexadecimal number to a
binary number

METHOD 1:

First it should be converted to its


equivalent decimal number.

Then convert the decimal number so


obtained to its binary equivalent.

CM105.22TO23 14
METHOD 2:

Each digit of the given hexadecimal number


should be converted to its 4-bit binary equivalent.

CM105.22TO23 15
1.Convert the hexadecimal number ABC to its
equivalent binary number.

 METHOD 1:

(ABC)16 = A *162 + B*161 + C*160


= 10 *256 + 11*16 + 12*1
= 2560 + 176 + 12
= (2748)10
(1010 1011 1100)10
CM105.22TO23 16
Now converting this decimal into binary.
Division Remainders
2 2748
2 1374 0
2 687 0
2 343 1
2 171 1
2 85 1
2 42 1
2 21 0
2 10 1
2 5 0
2 2 1
2 1 0
2 0 1
Thus (ABC)16 = (2748)10 = (101010111100)2
CM105.22TO23 17
METHOD 2:

A16 = (10)10 = (1010)2 2 10


B16 = (11)10 = (1011)2 2 5 0
C16 = (12)10 = (1100)2 2 2 1
21 0
0 1
(10)10 = (1010)2

(ABC)16 = ( 1010 1011 1100 )2


CM105.22TO23 18
2. Convert the hexadecimal number 6B9 to
its equivalent binary number.
 Each digit of the given hexadecimal number is
converted to its 4-bit binary equivalent.

(6B9)16 = (0110) (1011)(1001)


= (011010111001)2
= (011010111001)2

CM105.22TO23 19
3. Convert the hexadecimal number 6D.3A to
its equivalent binary number
 Each digit of the given hexadecimal number is
converted to its 4-bit binary equivalent.

(6D.3A)16 = (0110) (1101) . (0011) (1010)


=(01101101.00111010)2
=(1101101.0011101)2

CM105.22TO23 20
Summary

In this class, you have learnt about

 Conversions of binary number to hexadecimal

 Conversions of hexadecimal to binary number

CM105.22TO23 21
Frequently Asked Questions

 Explain how to convert a binary number to


equivalent hexadecimal.

 Explain how to convert a hexa decimal number


to equivalent binary

CM105.22TO23 22
Quiz

 The binary equivalent of (ABC)


a. 1010 1011 1100
b.1010 1100 1100
c. 1011 1010 1101
Answer: a

CM105.22TO23 23

You might also like