Module 5 - Number Systems
Module 5 - Number Systems
5.0. Introduction
Binary Number System Calculate numbers between decimal and binary systems.
Hexadecimal Number System Calculate numbers between decimal and hexadecimal systems.
IPv4 addresses begin as binary, a series of only 1s and 0s. These are difficult to manage, so network
administrators must convert them to decimal. This topic shows you a few ways to do this.
Binary is a numbering system that consists of the digits 0 and 1 called bits. In contrast, the decimal numbering
system consists of 10 digits consisting of the digits 0 – 9.
Binary is important for us to understand because hosts, servers, and network devices use binary addressing.
Specifically, they use binary IPv4 addresses, as shown in the figure, to identify each other.
Each address consists of a string of 32 bits, divided into four sections called octets. Each octet contains 8 bits
(or 1 byte) separated with a dot. For example, PC1 in the figure is assigned IPv4 address
11000000.10101000.00001010.00001010. Its default gateway address would be that of R1 Gigabit Ethernet
interface 11000000.10101000.00001010.00000001.
Binary works well with hosts and network devices. However, it is very challenging for humans to work with.
For ease of use by people, IPv4 addresses are commonly expressed in dotted decimal notation. PC1 is assigned
the IPv4 address 192.168.10.10, and its default gateway address is 192.168.10.1, as shown in the figure.
For a solid understanding of network addressing, it is necessary to know binary addressing and gain practical
skills converting between binary and dotted decimal IPv4 addresses. This section will cover how to convert
between base two (binary) and base 10 (decimal) numbering systems.
5.1.2. Video – Converting Between Binary and Decimal Numbering Systems
Radix 10 10 10 10
Position in Number 3 2 1 0
Result 1,234
In contrast, the binary positional notation operates as described in the table.
Radix 2 2 2 2 2 2 2 2
Position in Number 7 6 5 4 3 2 1 0
Binary Number
(11000000) 1 1 0 0 0 0 0 0
1x 0x 0x 0x 0x 0x
Calculate 1 x 128 64 32 16 8 4 2 0x1
Result 192
To convert a binary IPv4 address to its dotted decimal equivalent, divide the IPv4 address into four 8-bit
octets. Next apply the binary positional value to the first octet binary number and calculate accordingly.
For example, consider that 11000000.10101000.00001011.00001010 is the binary IPv4 address of a host. To
convert the binary address to decimal, start with the first octet, as shown in the table. Enter the 8-bit binary
number under the positional value of row 1 and then calculate to produce the decimal number 192. This
number goes into the first octet of the dotted decimal notation.
Calculate 128 64 32 16 8 4 2 1
Result 192
Next convert the second octet of 10101000 as shown in the table. The resulting decimal value is 168, and it
goes into the second octet.
Calculate 128 64 32 16 8 4 2 1
Positional Value 128 64 32 16 8 4 2 1
Result 168
Convert the third octet of 00001011 as shown in the table.
Calculate 128 64 32 16 8 4 2 1
Result 11
Convert the fourth octet of 00001010 as shown in the table. This completes the IP address and
produces 192.168.11.10.
Positional Value 128 64 32 16 8 4 2 1
Calculate 128 64 32 16 8 4 2 1
Result 10
It is also necessary to understand how to convert a dotted decimal IPv4 address to binary. A useful tool is the
binary positional value table.
Click each position starting at 128 and work your way from left to right to the 1 position.
128
64
32
16
8
4
2
1
Is the decimal number of the octet (n) equal to or greater than the most-significant bit (128)?
If no, then enter binary 0 in the 128 positional value.
If yes, then add a binary 1 in the 128 positional value and subtract 128 from the decimal number.
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8
Step 9
Step 10
Step 11
Is the first octet number 192 equal to or greater than the high-order bit 128?
Yes it is, therefore add a 1 to the high-order positional value to a represent 128.
Subtract 128 from 192 to produce a remainder of 64.
As mentioned in the beginning of this topic, routers and computers only understand binary, while humans
work in decimal. It is important for you to gain a thorough understanding of these two numbering systems and
how they are used in networking.
Click each button to contrast the dotted decimal address and the 32-bit address.
Octets
32-bit Address
192.168.10.10 is an IP address that is assigned to a computer.
Binary and hexadecimal work well together because it is easier to express a value as a single hexadecimal digit
than as four binary bits.
The hexadecimal numbering system is used in networking to represent IP Version 6 addresses and Ethernet
MAC addresses.
IPv6 addresses are 128 bits in length and every 4 bits is represented by a single hexadecimal digit; for a total of
32 hexadecimal values. IPv6 addresses are not case-sensitive and can be written in either lowercase or
uppercase.
As shown in the figure, the preferred format for writing an IPv6 address is x:x:x:x:x:x:x:x, with each “x”
consisting of four hexadecimal values. When referring to 8 bits of an IPv4 address we use the term octet. In
IPv6, a hextet is the unofficial term used to refer to a segment of 16 bits or four hexadecimal values. Each “x”
is a single hextet, 16 bits, or four hexadecimal digits.
The sample topology in the figure displays IPv6 hexadecimal addresses.
Converting decimal numbers to hexadecimal values is straightforward. Follow the steps listed:
1. Convert the decimal number to 8-bit binary strings.
2. Divide the binary strings in groups of four starting from the rightmost position.
3. Convert each four binary numbers into their equivalent hexadecimal digit.
The example provides the steps for converting 168 to hexadecimal.
For example, 168 converted into hex using the three-step process.
1. 168 in binary is 10101000.
2. 10101000 in two groups of four binary digits is 1010 and 1000.
3. 1010 is hex A and 1000 is hex 8.
Answer: 168 is A8 in hexadecimal.