Presentation is loading. Please wait.

Presentation is loading. Please wait.

Information Processing

Similar presentations


Presentation on theme: "Information Processing"— Presentation transcript:

1 Information Processing
Lecture 6A Hexadecimal Notation

2 The Hexadecimal System
The Hexadecimal number System had 16 separate characters: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F The extra letters are so that the numbers can be written using one character each. This means that A7BC is a number written in Hexadecimal code

3 Hexadecimal Dec Hex 0  0 1  1 2  2 3  3 4  4 5  5 6  6 7  7 8  8 9  9 10  A 11  B 12  C 13  D 14  E 15  F These numbers are written in base 16, so that a number like 9E means the 9 is 9 x 16 = 144 the E is 14 x 1 = 14 Altogether this would be 158 Slide

4 Hexadecimal Numbers Normally in the context of computers, we will only be considering two-digit Hexadecimal numbers like A3 or 4E When the numbers have more digits we tend to split them up into two-digit pairs. This makes interpretation a lot easier

5 Hexadecimal to Decimal
For example: The number 4E in Hexadecimal, is: 4 E That is 4 x 16 = and E (= 14) x 1 = 14 Total : (Decimal Notation)

6 Challenges Convert F2 from Hexadecimal to Decimal
Convert 8B from Hexadecimal to Decimal

7 Challenges F2 F x 16 = 15 x 16 = 240 …and 2 x 1 = 2 Total = 242 8B
B x 1 = 11 x 1 = 11 Total = 139

8 Converting Decimal to Hexadecimal
Two digit Hexadecimal numbers lie in the range 0 – 255 We will only consider numbers in this range. The answer will always be a two-digit hexadecimal number

9 Converting Decimal to Hexadecimal
Example: Convert 181 to Hexadecimal 181  16 = 11 remainder 5 In Hexadecimal 11 = B In Hexadecimal 5 = 5 This means: = B5 Decimal Hexadecimal

10 Challenges Convert 100 from Decimal to Hexadecimal

11 Challenges 239 100 239  16 = 14 rem 15 100  16 = 6 rem 4
14 in Hex is E 15 in Hex is F So the Hexadecimal number is: EF 100 100  16 = 6 rem 4 So the Hexadecimal number is:

12 Hexadecimal to Binary The easiest way to convert Hex to Binary is by using a ‘look-up’ table to find the Binary equivalents for the Hex digits 0 to F For example, the Binary for 6A would just be: 6 = 0110 A = 1010 6A = Hex Binary 0  0000 1  0001 2  0010 3  0011 4  0100 5  0101 6  0110 7  0111 8  1000 9  1001 A  1010 B  1011 C  1100 D  1101 E  1110 F  1111

13 Challenge Convert E8 to Binary

14 Challenge E8 E = 1100 8 = 1000 This means that E8 =

15 Binary to Hexadecimal Binary Hex 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 Converting Binary to Hex can be done in exactly the same way, by using a look-up table For example the binary number will be: 1001 = 9 1011 = B So that = 9B

16 Challenge Convert to Hexadecimal

17 Challenge 11000011 This can be split: 1100 = C 0011 = 3
0011 = 3 So that = C3

18 Summary Hexadecimal is just a shorthand way of writing Binary Code.
Each of the numbers 0 – 15 is written as an individual character. This means that we can represent each of the decimal numbers with two digits Every one of the 8-digit binary numbers can be represented by a two-digit hexadecimal number.


Download ppt "Information Processing"

Similar presentations


Ads by Google