Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hexadecimal Number System

Similar presentations


Presentation on theme: "Hexadecimal Number System"— Presentation transcript:

1 Hexadecimal Number System
CS 1 Rick Graziani Cabrillo College Spring 2007

2 Rick Graziani graziani@cabrillo.edu

3 Rick Graziani graziani@cabrillo.edu

4 Pixels A monitors screen is divided into a grid of small unit called picture elements or pixels. The more pixels per inch the better the resolution, the sharper the image. All colors on the screen are a combination of red, green and blue (RGB), just at various intensities. Rick Graziani

5 Rick Graziani graziani@cabrillo.edu

6 Dreamweaver Rick Graziani

7 <tr> <td rowspan="2" bgcolor="#cccc99"> </td> <td height="30" bgcolor="#999966"><div id="mainnav"> Hexadecimal Number With web applications like HTML (Hypertext Markup Language), colors are sometime described using their RGB color specification in hexadecimal. Rick Graziani

8 Hexadecimal RED GREEN BLUE
<td rowspan="2" bgcolor="#cccc99"> </td> Red Green Blue cc cc 99 <td height="30" bgcolor="#999966"><div id="mainnav"> # means hexadecimal in web applications Rick Graziani

9 Why do these people use them? web designers digital medial creators
Hexadecimal Numbers What are they? Why do these people use them? web designers digital medial creators computer scientists networking professionals Rick Graziani

10 Rick’s Number System Rules
All digits start with 0 A Base-n number system has n number of digits: Decimal: Base-10 has 10 digits Binary: Base-2 has 2 digits Hexadecimal: Base-16 has 16 digits The first column is always the number of 1’s Each of the following columns is n times the previous column (n = Base-n) Base 10: 10, , Base 2: Base 16: 65, , Rick Graziani

11 Hexadecimal Digits Dec Hex 1 2 3 4 5 6 7 Dec Hex 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 Dec Hex 8 9 10 11 12 13 14 15 Rick Graziani

12 Hexadecimal Digits Dec Hex 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 Dec Hex 8 8
Dec Hex A B C D E F Rick Graziani

13 Hexadecimal Decimal 16’s 1’s 8 9 10 14 15 16
0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, A, B, C, D, E, F Hexadecimal Decimal ’s 1’s 8 9 10 14 15 16 Rick Graziani

14 Hexadecimal Decimal 16’s 1’s 8 8 9 9 10 A 14 E 15 F 16 1 0
0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, A, B, C, D, E, F Hexadecimal Decimal ’s 1’s A E F Rick Graziani

15 Hexadecimal Decimal 16’s 1’s 17 20 21 26 12 29
0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, A, B, C, D, E, F Hexadecimal Decimal ’s 1’s 17 20 21 26 12 29 Rick Graziani

16 Hexadecimal Decimal 16’s 1’s 17 1 1 20 1 4 21 1 5 26 1 A 12 C 29 1 D
0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, A, B, C, D, E, F Hexadecimal Decimal ’s 1’s A C D Rick Graziani

17 Hexadecimal Decimal 16’s 1’s 30 31 32 33 50 60
0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, A, B, C, D, E, F Hexadecimal Decimal ’s 1’s 30 31 32 33 50 60 Rick Graziani

18 Hexadecimal Decimal 16’s 1’s 30 1 E 31 1 F 32 2 0 33 2 1 50 3 2 60 3 C
0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, A, B, C, D, E, F Hexadecimal Decimal ’s 1’s E F C Rick Graziani

19 Don’t forget why we are doing this!
<tr> <td rowspan="2" bgcolor="#cccc99"> </td> <td height="30" bgcolor="#999966"><div id="mainnav"> Hexadecimal Number Rick Graziani

20 Why Hexadecimal? Hexadecimal is perfect for matching 4 bits.
Every combination of 4 bits can be matched with one hex number. 4 bits can be represented by 1 Hex value 8 bits can be represented by 2 Hex values Rick Graziani

21 Hexadecimal Digits 4 bits can be represented by 1 Hex value
Dec Hex Binary 8421 A B C D E F Hexadecimal: 16 digits Dec Hex Binary 8421 Rick Graziani

22 Hexadecimal Digits 4 bits can be represented by 1 Hex value
Dec Hex Binary 8421 A B C D E F Hexadecimal: 16 digits Dec Hex Binary 8421 Rick Graziani

23 Hexadecimal Digits 4 bits can be represented by 1 Hex value
Hexadecimal is perfect for matching 4 bits. Every combination of 4 bits can be matched with one hex number. 4 bits can be represented by 1 Hex value 8 bits can be represented by 2 Hex values Dec. Hex. Binary Dec. Hex. Binary A B C D E F Rick Graziani

24 Converting Decimal, Hex, and Binary
Dec. Hex. Binary Dec. Hex. Binary A B C D E F Dec. Hex Binary Dec. Hex Binary Dec. Hex Binary F A C Rick Graziani

25 Converting Decimal, Hex, and Binary
Dec. Hex. Binary Dec. Hex. Binary A B C D E F Dec. Hex Binary Dec. Hex Binary Dec. Hex Binary A 1010 15 F E C 1100 10 A 12 C Rick Graziani

26 What about 8 bits? HEX BINARY 2 4 ? Dec. Hex. Binary Dec. Hex. Binary
A B C D E F HEX BINARY ? Rick Graziani

27 What about 8 bits? HEX BINARY 2 4 0010 0100
Dec. Hex. Binary Dec. Hex. Binary A B C D E F HEX BINARY Rick Graziani

28 What about 8 bits? HEX BINARY 2 4 0010 0100
Dec. Hex. Binary Dec. Hex. Binary A B C D E F HEX BINARY Rick Graziani

29 Using Hex for 8 bits Hex Binary Hex Binary Hex Binary
Dec. Hex. Binary Dec. Hex. Binary A B C D E F Hex Binary Hex Binary Hex Binary C AB A B D Rick Graziani

30 Using Hex for 8 bits Dec. Hex. Binary Dec. Hex. Binary A B C D E F Hex Binary Hex Binary Hex Binary C AB A B D F FF C C Rick Graziani

31 So why is Rick torturing us?
<tr> <td rowspan="2" bgcolor="#cccc99"> </td> <td height="30" bgcolor="#999966"><div id="mainnav"> Hexadecimal Number Rick Graziani

32 How much RED GREEN BLUE ? <td rowspan="2" bgcolor="#cccc99"> </td> Red Green Blue cc cc 99 <td height="30"bgcolor="#999966"><divid…> Rick Graziani

33 Hexadecimal # RED GREEN BLUE
<td rowspan="2" bgcolor="#cccc99"> </td> Red Green Blue cc cc 99 Convert to Binary Red Green Blue Hex cc cc 99 Bin 24 bits represent a single color Rick Graziani

34 Red Green Blue Hex cc cc 99 Bin 1100 1100 1100 1100 1001 1001
24 bits represent a single color Rick Graziani

35 ? ? ? Red Green Blue Hex 00->FF 00->FF 00->FF
Bin thru thru thru Dec > > > 255 255 255 255 ? ? ? Rick Graziani

36 255 ? 255 ? 255 ? How Much? 0 to 255 Rick Graziani

37 Hexadecimal Decimal 16’s 1’s c c or 12 12 (12x16) (12x1)
Red Green Blue Hex cc cc 99 Bin Hexadecimal Decimal ’s 1’s c c or (12x16) (12x1) = Rick Graziani

38 Hexadecimal Decimal 16’s 1’s c c or 12 12 (12x16) (12x1)
Red Green Blue Hex cc cc 99 Bin Hexadecimal Decimal ’s 1’s c c or (12x16) (12x1) = Rick Graziani

39 Hexadecimal Decimal 16’s 1’s 9 9 or 9 9 (9x16) (9x1) 153 = 144 + 9
Red Green Blue Hex cc cc 99 Bin Hexadecimal Decimal ’s 1’s or (9x16) (9x1) = Rick Graziani

40 Red Green Blue Hex cc cc 99 Bin 1100 1100 1100 1100 1001 1001
Dec Rick Graziani

41 255 204 255 204 255 153 Rick Graziani

42 <td rowspan="2" bgcolor="#cccc99"> </td>
Rick Graziani

43 For those of you interested in Web Design and Digital Media, you will work with colors based on hexadecimal code, hue, other codes, or shades. Rick Graziani

44 #C73F17 Chili Powder C 7 3 F 1 7 16’s 1’s 16’s 1’s 16’s 1’s
12x16 7x x x x16 7x1 Rick Graziani

45 Chili Powder #C73F17 C7 3F 17 Rick Graziani

46 Try these E E F F C A D Rick Graziani

47 Try these E E F F C A D Rick Graziani

48 Color Codes Rick Graziani

49 Hexadecimal Number System
CS 1 Rick Graziani Cabrillo College Spring 2007


Download ppt "Hexadecimal Number System"

Similar presentations


Ads by Google