Presentation is loading. Please wait.

Presentation is loading. Please wait.

HEXADECIMAL NUMBERS.

Similar presentations


Presentation on theme: "HEXADECIMAL NUMBERS."— Presentation transcript:

1 HEXADECIMAL NUMBERS

2 OBJECTIVES Be able to explain what a hexadecimal number is
Be able to convert up to denary 255 to hexadecimal and vice versa Understand and be able to explain why we use hexadecimal

3 Binary Numbers Here are the first 16 binary numbers (using 4 bits), and their decimal equivalents. Copy this chart. binary denary hexa-decimal 0000 1000 8 0001 1 1001 9 0010 2 1010 10 0011 3 1011 11 0100 4 1100 12 0101 5 1101 13 0110 6 1110 14 0111 7 1111 15 © 2004, Robert K. Moniot

4 Activity Complete the chart by writing the first 16 hexadecimal numbers (beginning with 0) How many bits do you need to represent the first 16 hexadecimal numbers? binary denary hexa-decimal 0000 1000 8 0001 1 1001 9 0010 2 1010 10 A 0011 3 1011 11 B 0100 4 1100 12 C 0101 5 1101 13 D 0110 6 1110 14 E 0111 7 1111 15 F

5 Converting hex to denary and back again (up to denary 255)
We naturally understand denary numbers We know that 1089 = (1x1000)+(0x100)+(8x10)+(9x1) For hexadecimal it is the same but for base 16 For example: A9 (10x16)+(9x1) = = 169 10 9

6 Convert these hexadecimal numbers to denary – show working
FF AC 8D 99 EE 42 EXTRA CHALLENGE – TRY THESE : FFFF, EEF4, CBCB, 0101, DDFF

7 Convert these hexadecimal numbers to denary – ANSWERS
FF = (15 X 16) + (15 X 1) = = 255 AC = (10 X 16) + (12 X 1) = = 172 8D = (8 X 16) + (13 X 1) = = 141 99 = (9 X 16) + (9 X 1) = = 153 EE = (14 X 16) + (14 X 1) = = 238 42 = (4 X 16) + (2 X 1) = = 66

8 THE GOOD NEWS For the purposes of GCSE you need to be able to convert denary 255 to hexadecimal and back again (2 hexadecimal digits)

9 DENARY TO HEXADECIMAL How would you convert 200 denary to hexadecimal?
Divide 200 by 16 = 12 (lots of 16) remainder 8 (units) 12 as a hex = C and 8 is 8 Answer is C8

10 Convert these denary to hexadecimal
32 255 59 159 230

11 Binary and Hexadecimal
Hexadecimal works by grouping binary bits into groups of 4 (starting from the right). Each group (a nibble) is assigned a hex digit value. The digits are the same as for decimal up to 9, and then letters A through F are used for 10 through 15. 0000 = 0 1000 = 8 0001 = 1 1001 = 9 0010 = 2 1010 = A 0011 = 3 1011 = B 0100 = 4 1100 = C 0101 = 5 1101 = D 0110 = 6 1110 = E 0111 = 7 1111 = F Thus the 8-bit binary number converted to hex is B2 © 2004, Robert K. Moniot

12 What would these binary numbers be as hexadecimal?
Extension – write the proof by converting each to denary

13 Which of these is easier to remember?
or 5B5B Humans are not good at remembering long strings of numbers and binary numbers are often long and unwieldy

14 Why hexadecimal? Hex numbers are shorter/more memorable than equivalent binary numbers.. ... and can easily be converted to and from binary... ... as each hexadecimal digit corresponds to 4 binary digits

15 USES OF HEXADECIMAL Used in error messages
Representation of colours in images and HTML Challenge! – what other uses of hexadecimal in computing can you find? © 2004, Robert K. Moniot

16 The RGB Color System RGB values are based on the Red, Green, Blue primary color system. Each of the three primary colors is assigned a numerical strength. The three strengths of Red, Green, and Blue define the color. © 2004, Robert K. Moniot

17 Expressing Colors in Hex
Strengths of the primary colors are defined using 8-bit numbers (bytes). An 8-bit number can be represented using two hex digits. The value of the hex number ranges from 00 to FF, corresponding to a range from 0 to 255 decimal. A strength of 00 means the color is completely absent. A strength of FF or 255 means the color is at its maximum. An RGB color is thus represented by three 8-bit numbers (bytes), or six hex digits. © 2004, Robert K. Moniot

18 Expressing Colors in Hex
Note that 40 is ¼ of full strength, 80 is ½, C0 is ¾. Here are some examples of colors expressed in hex: "#000000" Black (all colors off) (what do you think white is?) "#FFFFFF" White (all colors max) "#FF0000" Red (red max, green & blue off) "#00FF00" Green "#0000FF" Blue "#FFFF00" Yellow (equal amounts of red & green) "#AEEEEE" Turquoise "#808080" Gray (all colors half max) © 2004, Robert K. Moniot

19 ACTIVITY Open notepad Type in: <body bgcolor=#ff0000>
Save the file with the extension .htm. Make sure not to save as a .txt file. Double-click on the file to open with your default browser. Now repeat the process with different colour codes.

20 HEXADECIMAL BINGO Highlight the decimal equivalent of the hexadecimal number given


Download ppt "HEXADECIMAL NUMBERS."

Similar presentations


Ads by Google