0% found this document useful (0 votes)
48 views17 pages

1 Data Representation - L6 - Hexadecimal To Binary and Decimal Conversion

Uploaded by

danayousif1711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views17 pages

1 Data Representation - L6 - Hexadecimal To Binary and Decimal Conversion

Uploaded by

danayousif1711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Chapter 1 : Data Representation

Hexadecimal to
Binary - Decimal
Conversion

6 Number System
Previously we Learned
• Concept of Decimal, Binary,
Hexadecimal Numbers
• Base and Range of Decimal,
Binary, Hexadecimal
numbers
• How to conversion between
Decimal and Binary
number.
Decimal Binary Octal Hexadecimal

0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
The table is shows the decimal, binary, 4 0100 4 4

octal, and hexadecimal numbers 5 0101 5 5

from 0 to 15. 6 0110 6 6


7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
LESSON OBJECTIVE

• Why the processors use only


HEX to Decimal Hexadecimal Number system
and how a Hexadecimal
Conversion number is converted to a
human readable form?

KEYWORDS SUCCESS CRITERIA


• Base
• Power table of 2 • Able to convert Hexadecimal
• MSB Number to Binary or Decimal
• LSB using the power table.
Hexadecimal Numbers
• These numbers are used extensively in
microprocessor work.

• The hexadecimal number system has a base of


16.
Hexadecimal Numbers
• The range of digits in Hexadecimal number system is :
– 0 to (radix -1)
– 0 to (16-1)
– 0 to 15

• It consists of the following sixteen number of digits.


0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Range of Hexadecimal Numbers

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
How to Convert Hex to Binary

• straightforward since hexadecimal numbers are


simplified versions of binary strings. You just
need to remember that each hex value will
produce four binary digits.
Algorithm to Convert Hex to Binary
• Step 1: Write down the hex number. If there are any, change the hex values represented
by letters to their decimal equivalents.
• Step 2: Each hex digit represents four binary digits and therefore is equal to a power of
2. The rightmost digit equals to 20 (1), the next one equals to 21 (2), the next one equals
to 22 (4) and the leftmost one equals to 23 (8). Write these numbers (8, 4, 2 and 1) below
the hex values.
• Step 3: Determine which powers of two (8, 4, 2 or 1) sum up to your hex digits. For
example, if one of your hex values is 10, this means 8 and 2 sum up to 10 (4 and 1 are
not used). If your hex number is 2, only 2 is used; 8, 4 and 1 are not.
• Step 4: Write down 1 below those 8, 4, 2 and 1’s that are used. Write down 0 below
those that are not used.
• Step 5: Read the 1’s and 0’s from left to right to get the binary equivalent of the given
hex number.
Advantage of a Hexadecimal Number
• The main advantage of a Hexadecimal Number is that
it is very compact and by using a base of 16 means that
the number of digits used to represent a given number
is usually less than in binary or decimal.

• Also, it is quick and easy to convert between


hexadecimal numbers and binary.
Application of HEX
SUMMARY
Binary integers to Hexadecimal: Algorithm
• Step 1: Write down the binary number and group the
digits (0’s and 1’s) in sets of four.
• Step 2: Every group of four in binary will give you one
digit in hexadecimal.
• Step 3: Add the products within each set of four. Write
the sums below the groups they belong to.
• Step 4: The digits you get from the sums in each group
will give you the hexadecimal number, from left to
right.
PLENARY
Find the decimal and
GROUP 1 Find the decimal and binary Find the decimal and binary equivalent
binary equivalent of the
Conversion equivalent of the Hex 16 of the Hex 9A
Hex 1A

GROUP 2
Find the decimal and
Find the decimal and binary Find the decimal and binary equivalent
binary equivalent of the
Conversion equivalent of the Hex 527 of the Hex F1A
Hex AF

GROUP 3 Find the decimal and


Find the decimal and binary Find the decimal and binary equivalent
binary equivalent of the
equivalent of the Hex 5A7E of the Hex EF5A
Conversion Hex 10AC

Evaluation Worksheet
3! 2! 1!

1.

3 Things I 2.
learned
3.

1.
2 Interesting
2.
facts

1 Question
1.

You might also like