Date post: | 23-Dec-2015 |
Category: |
Documents |
Upload: | lynne-french |
View: | 217 times |
Download: | 0 times |
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Chabot CollegeChabot College
ELEC 74AELEC 74AHexadecimal Introduction
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hexadecimal NumbersHexadecimal Numbers
In the decimal (base 10) system, each digit has 10 possible values.
In the hexadecimal (base 16) system, each digit has 16 possible values:
Dec 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15Hex 0 1 2 3 4 5 6 7 8 9 A B C D E F
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hexadecimal NumberingHexadecimal Numbering
In decimal, each place value is a power of ten.
We read the number 2342 as two-thousand three-hundred forty-two.
1101001000
2432
100101102103
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hexadecimal NumberingHexadecimal Numbering
In hexadecimal, each place value is a power of 16!
We read the hex number 2342 as
(2 x 4096) + (3 x 256) + (4 x 16) + (2 x 1) = 9026
116256
2
4096
2
160161162163
43
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hexadecimal NotationHexadecimal NotationIs 2342 a decimal or hex number?
Hex numbers often• are preceded by 0x:
0x2342• are followed by h:
2342h• include digits A - F:
2B4C• used for MAC addresses:
00-0A-3C-24-A2-99
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
ConversionsConversions
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hexadecimal NumberingHexadecimal Numbering
In hex, each place value is a power of 16:
1162564096
160161162163
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Decimal ConversionHex to Decimal Conversion
The hex number 2B1F is equivalent to 11,071 in decimal:
2 x 4096 = 8,192
B (11) x 256 = 2,816
3 x 16 = 48
F (15) x 1 = 15
Total = 11,071
116256
F3B
4096
2
160161162163
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Decimal ConversionHex to Decimal Conversion
Convert the hex number 04A3 to decimal:
__ x 4096 = _____
__ x 256 = _____
__ x 16 = _____
__ x 1 = _____
Total = _____
116256
3A4
4096
0
160161162163
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Decimal ConversionHex to Decimal Conversion
Convert the hex number 04A3 to decimal:
0 x 4096 = 0
4 x 256 = 1024
A (10) x 16 = 160
3 x 1 = 3
Total = 1187
116256
3A4
4096
0
160161162163
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Decimal to Hex ConversionDecimal to Hex Conversion
The decimal number 1,442 is equivalent to 5A2 in hexadecimal:
Convert 1,442:
1442 / 256 = 5 with remainder of 162
162 / 16 = 10 (A) with remainder of 2
2 / 1 = 2
Hex Answer: 5A2
116256
2A5
4096
160161162163
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Decimal to Hex ConversionDecimal to Hex Conversion
Convert the decimal number 965 to hexadecimal:
Convert 965:
___ / 256 = ___ with remainder of ___
___ / 16 = ___ with remainder of ___
___ / 1 = 2
Hex Answer: _____
1162564096
160161162163
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Decimal to Hex ConversionDecimal to Hex Conversion
Convert the decimal number 965 to hexadecimal:
Convert 965:
965 / 256 = 3 with remainder of 197
197 / 16 = 12 (C) with remainder of 5
5 / 1 = 5
Hex Answer: 3C5
1162564096
160161162163
C3 5
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Binary ReviewBinary Review
In binary, each place value is a power of two.
Binary 1001 is equivalent to 9 in decimal.
124
100
8
1
20212223
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Binary ConversionHex to Binary Conversion
• 16 = 24, so four binary bits can be represented as a single hex digit:
Binary1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000
Hex F E D C B A 9 8 7 6 5 4 3 2 1 0
Dec 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex - Binary RelationshipHex - Binary Relationship
0A-3C-19 24-C6-78
0 A 3 C 1 90000 1010 0011 1100 0001 1001
2 4 C 6 7 80010 0100 1100 0110 0111 1000
4 bits per hex digit
8 bits (one byte) per pair of hex digits
6 pairs of hex digits X 8 bits per pair = 48 bit MAC address
< 24 bits (OUI) > < 24 bits (station) >
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Binary ConversionHex to Binary Conversion
• Conversions are usually done one byte (8 bits) at a time.
• Each byte is split into two 4-bit parts.
• Each 4-bit part converts to one hex (24) digit:
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Binary ConversionHex to Binary Conversion
Convert Hex C4 to Binary:
• C = 1100
• 4 = 0100
• C4 = 11000100
Binary1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000
Hex F E D C B A 9 8 7 6 5 4 3 2 1 0
Dec 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Binary ConversionHex to Binary Conversion
Convert Hex 7F to Binary:
• 7 = ____
• F = ____
• 7F = ________
Binary1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000
Hex F E D C B A 9 8 7 6 5 4 3 2 1 0
Dec 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Hex to Binary ConversionHex to Binary Conversion
Convert Hex 7F to Binary:
• 7 = 0111
• F = 1111
• 7F = 01111111
Binary1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000
Hex F E D C B A 9 8 7 6 5 4 3 2 1 0
Dec 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Binary to Hex ConversionBinary to Hex Conversion
Convert Binary 11000011 to Hex:
• 1100 = _
• 0011 = _
• 11000011 = __
Binary1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000
Hex F E D C B A 9 8 7 6 5 4 3 2 1 0
Dec 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Binary to Hex ConversionBinary to Hex Conversion
Convert Binary 11000011 to Hex:
• 1100 = C
• 0011 = 3
• 11000011 = C3
Binary1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000
Hex F E D C B A 9 8 7 6 5 4 3 2 1 0
Dec 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY
Practice SlidePractice Slide
Binary1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000
Hex F E D C B A 9 8 7 6 5 4 3 2 1 0
Dec 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1162564096
160161162163
Decimal < - > Hex
Binary < - > Hex