ITN Module 5
ITN Module 5
Instructor Materials
Module Objective: Calculate numbers between decimal, binary, and hexadecimal systems.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
5.1 Binary Number System
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
Binary Number System
Binary and IPv4 Addresses
• Decimal numbering system consists of digits 0 through 9
• Binary numbering system consists of 1s and 0s, called bits
• Hosts, servers, and network equipment using binary addressing to identify each other.
• Each address is made up of a string of 32 bits, divided into four sections called octets.
• Each octet contains 8 bits (or 1 byte) separated by a dot.
• For ease of use by people, this dotted notation is converted to dotted decimal.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
Binary Number System
Decimal Positional Notation
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
Binary Number System
Decimal Positional Notation (Cont)
Position 3 2 1 0
Positional Value 103=1000 102=100 101=10 100=1
Decimal Number
Calculate x 103 = x 102 = x 101 = x 100 =
Add them up…
Result
Base/radix = 10
Positional Value = radixposition
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
Binary Number System
Binary Positional Notation
Position 3 2 1 0
Positional Value 23=8 22=4 21=2 20=1
Binary Number
Calculate x 23 = x 22 = x 21 = x 20 =
Add them up…
Result
Base/radix = 2
Positional Value = radixposition
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
Binary Number System
Binary Positional Notation (Cont)
Position 7 6 5 4 3 2 1 0
Positional Value 27=128 26=64 25=32 24=16 23=8 22=4 21=2 20=1
Binary Number
Calculate result
Base/radix = 2
Positional Value = radixposition
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
Binary Number System
Decimal to Binary Conversion
The binary positional value table is useful in converting a dotted decimal IPv4 address to
binary.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
Binary Number System
Decimal to Binary Conversion Example
• Convert decimal 168 to binary
Is 168 > 128?
- Yes, enter 1 in 128 position and subtract 128 (168-128=40)
Is 40 > 64?
- No, enter 0 in 64 position and move on
Is 40 > 32?
- Yes, enter 1 in 32 position and subtract 32 (40-32=8)
Is 8 > 16?
- No, enter 0 in 16 position and move on
Is 8 > 8?
- Equal. Enter 1 in 8 position and subtract 8 (8-8=0)
No values left. Enter 0 in remaining binary positions
128 64 32 16 8 4 2 1
1 0 1 0 1 0 0 0
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
5.2 Hexadecimal Number
System
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
Hexadecimal Number System
Hexadecimal and IPv6 Addresses
• To understand IPv6 addresses,
you must be able to convert
hexadecimal to decimal and
vice versa.
• Hexadecimal is a base sixteen
numbering system, using the
digits 0 through 9 and letters A
to F.
• It is easier to express a value
as a single hexadecimal digit
than as four binary bit.
• Hexadecimal is used to
represent IPv6 addresses and
MAC addresses.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
Hexadecimal Number System
Hexadecimal to Decimal Conversions
Position 3 2 1 0
Positional Value 163=4096 162=256 161=16 160=1
Hexa Number
Calculate x 163 = x 162 = x 161 = x 160 =
Add them up…
Result
Base/radix = 16
Positional Value = radixposition
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27
Hexadecimal Number System
Decimal to Hexadecimal Conversions
• Steps:
1. Divide the decimal number by 16.
Treat the division as an integer
division.
2. Write down the remainder (in
hexadecimal).
3. Divide the result again by 16. Treat
the division as an integer division.
4. Repeat step 2 and 3 until result is 0.
5. The hex value is the digit sequence
of the remainders from the last to
first.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
Hexadecimal Number System
Hexadecimal and IPv6 Addresses (Cont.)
• IPv6 addresses are 128 bits in
length. Every 4 bits is
represented by a single
hexadecimal digit. That makes
the IPv6 address a total of 32
hexadecimal values.
• The figure shows the preferred
method of writing out an IPv6
address, with each X
representing four hexadecimal
values.
• Each four hexadecimal
character group is referred to
as a hextet.
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30