Binary Number System CCNA
Binary Number System CCNA

Binary Number System

Binary Number System
5

Summary

This topic calculate numbers between decimal and binary systems. Start learning CCNA 200-301 for free right now!!

Note: Welcome: This topic is part of Chapter 5 of the Cisco CCNA 1 course, for a better follow up of the course you can go to the CCNA 1 section to guide you through an order.

Binary and IPv4 Addresses

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.

Binary and IPv4 Addresses
Binary and IPv4 Addresses

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.

IPv4 addresses dotted decimal notation
IPv4 addresses dotted decimal notation

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.

Video – Converting Between Binary and Decimal Numbering Systems

Click Play in the figure for a video demonstrating how to convert between binary and decimal numbering systems.

Binary Positional Notation

Learning to convert binary to decimal requires an understanding of positional notation. Positional notation means that a digit represents different values depending on the “position” the digit occupies in the sequence of numbers. You already know the most common numbering system, the decimal (base 10) notation system.

The decimal positional notation system operates as described in the table.

Radix 10 10 10 10
Position in Number 3 2 1 0
Calculate (103) (102) (101) (100)
Position value 1000 100 10 1

The following bullets describe each row of the table.

  • Row 1, Radix is the number base. Decimal notation is based on 10, therefore the radix is 10.
  • Row 2, Position in number considers the position of the decimal number starting with, from right to left, 0 (1st position), 1 (2nd position), 2 (3rd position), 3 (4th position). These numbers also represent the exponential value use to calculate the positional value in the 4th row.
  • Row 3 calculates the positional value by taking the radix and raising it by the exponential value of its position in row 2.
    Note: n0 is = 1.
  • Row 4 positional value represents units of thousands, hundreds, tens, and ones.

To use the positional system, match a given number to its positional value. The example in the table illustrates how positional notation is used with the decimal number 1234.

Thousands Hundreds Tens Ones
Positional Value 1000 100 10 1
Decimal Number (1234) 1 2 3 4
Calculate 1 x 1000 2 x 100 3 x 10 4 x 1
Add them up… 1000 + 200 + 30 + 4
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
Calculate (27) (26) (25) (24) (23) (22) (21) (20)
Position value 128 64 32 16 8 4 2 1

The following bullets describe each row of the table.

  • Row 1, Radix is the number base. Binary notation is based on 2, therefore the radix is 2.
  • Row 2, Position in number considers the position of the binary number starting with, from right to left, 0 (1st position), 1 (2nd position), 2 (3rd position), 3 (4th position). These numbers also represent the exponential value use to calculate the positional value in the 4th row.
  • Row 3 calculates the positional value by taking the radix and raising it by the exponential value of its position in row 2.
    Note: n0 is = 1.
  • Row 4 positional value represents units of ones, twos, fours, eights, etc.

The example in the table illustrates how a binary number 11000000 corresponds to the number 192. If the binary number had been 10101000, then the corresponding decimal number would be 168.

Positional Value 128 64 32 16 8 4 2 1
Binary Number (11000000) 1 1 0 0 0 0 0 0
Calculate 1 x 128 1 x 64 0 x 32 0 x 16 0 x 8 0 x 4 0 x 2 0 x 1
Add Them Up.. 128 + 64 + 0 + 0 + 0 + 0 + 0 + 0
Result 192

Convert Binary to Decimal

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.

Positional Value 128 64 32 16 8 4 2 1
Binary Number (11000000) 1 1 0 0 0 0 0 0
Calculate 128 64 32 16 8 4 2 1
Add Them Up… 128 + 64 + 0 + 0 + 0 + 0 + 0 + 0
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.

Positional Value 128 64 32 16 8 4 2 1
Binary Number (10101000) 1 0 1 0 1 0 0 0
Calculate 128 64 32 16 8 4 2 1
Add Them Up… 128 + 0 + 32 + 0 + 8 + 0 + 0 + 0
Result 168

Convert the third octet of 00001011 as shown in the table.

Positional Value 128 64 32 16 8 4 2 1
Binary Number (00001011) 0 0 0 0 1 0 1 1
Calculate 128 64 32 16 8 4 2 1
Add Them Up… 0 + 0 + 0 + 0 + 8 + 0 + 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
Binary Number (00001010) 0 0 0 0 1 0 1 0
Calculate 128 64 32 16 8 4 2 1
Add Them Up… 0 + 0 + 0 + 0 + 8 + 0 + 2 + 0
Result 10

Decimal to Binary Conversion

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.

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.

Decimal to Binary position 128
Decimal to Binary position 128

Is the decimal number of the octet (n) equal to or greater than the next most-significant bit (64)?

  • If no, then enter binary 0 in the 64 positional value.
  • If yes, then add a binary 1 in the 64 positional value and subtract 64 from the decimal number.

Decimal to Binary position 64
Decimal to Binary position 64

Is the decimal number of the octet (n) equal to or greater than the next most-significant bit (32)?

  • If no, then enter binary 0 in the 32 positional value.
  • If yes, then add a binary 1 in the 32 positional value and subtract 32 from the decimal number.

Decimal to Binary position 32
Decimal to Binary position 32

Is the decimal number of the octet (n) equal to or greater than the next most-significant bit (16)?

  • If no, then enter binary 0 in the 16 positional value.
  • If yes, then add a binary 1 in the 16 positional value and subtract 16 from the decimal number.

Decimal to Binary position 16
Decimal to Binary position 16

Is the decimal number of the octet (n) equal to or greater than the next most-significant bit (8)?

  • If no, then enter binary 0 in the 8 positional value.
  • If yes, then add a binary 1 in the 8 positional value and subtract 8 from the decimal number.

Decimal to Binary position 8
Decimal to Binary position 8

Is the decimal number of the octet (n) equal to or greater than the next most-significant bit (4)?

  • If no, then enter binary 0 in the 4 positional value.
  • If yes, then add a binary 1 in the 4 positional value and subtract 4 from the decimal number.

Decimal to Binary position 4
Decimal to Binary position 4

Is the decimal number of the octet (n) equal to or greater than the next most-significant bit (2)?

  • If no, then enter binary 0 in the 2 positional value.
  • If yes, then add a binary 1 in the 2 positional value and subtract 2 from the decimal number.

Decimal to Binary position 2

Is the decimal number of the octet (n) equal to or greater than the last most-significant bit (1)?

  • If no, then enter binary 0 in the 1 positional value.
  • If yes, then add a binary 1 in the 1 positional value and subtract 1 from the last decimal number.

Decimal to Binary position 1
Decimal to Binary position 1

Decimal to Binary Conversion Example

To help understand the process, consider the IP address 192.168.11.10.

The first octet number 192 is converted to binary using the previously explained positional notation process.

It is possible to bypass the process of subtraction with easier or smaller decimal numbers. For instance, notice that it is fairly easy to calculate the third octet converted to a binary number without actually going through the subtraction process (8 + 2 = 10). The binary value of the third octet is 00001010.

The fourth octet is 11 (8 + 2 + 1). The binary value of the fourth octet is 00001011.

Converting between binary and decimal may seem challenging at first, but with practice it should become easier over time.

Click each step to see the conversion of the IP address of 192.168.10.11 into binary.

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.

Conversion into binary step 1
Conversion into binary step 1

Is the remainder 64 equal to or greater than the next high-order bit 64?

  • It is equal, therefore add a 1 to next high-order positional value.

Conversion into binary step 2
Conversion into binary step 2

Since there is no remainder, enter binary 0 in the remaining positional values.

  • The binary value of the first octet is 11000000.

Conversion into binary step 3

Is the second octet number 168 equal to or greater than the high-order bit 128?

  • Yes it is, therefore add a 1 to the high-order positional value to represent 128.
  • Subtract 128 from 168 to produce a remainder of 40.

Conversion into binary step 4
Conversion into binary step 4

Is the remainder 40 equal to or greater than the next high-order bit 64?

  • No it is not, therefore, enter a binary 0 in the positional value.

Conversion into binary step 5
Conversion into binary step 5

Is the remainder 40 equal to or greater than the next high-order bit 32?

  • Yes it is, therefore add a 1 to the high-order positional value to represent 32.
  • Subtract 32 from 40 to produce a remainder of 8.

Conversion into binary step 6
Conversion into binary step 6

Is the remainder 8 equal to or greater than the next high-order bit 16?

  • No it is not, therefore, enter a binary 0 in the positional value.

Conversion into binary step 7
Conversion into binary step 7

Is the remainder 8 equal to or greater than the next high-order bit 8?

  • It is equal, therefore add a 1 to next high-order positional value.

Conversion into binary step 8
Conversion into binary step 8

Since there is no remainder, enter binary 0 in the remaining positional values.

  • The binary value of the second octet is 10101000.

Conversion into binary step 9

The binary value of the third octet is 00001010.

Conversion into binary step 10
Conversion into binary step 10

The binary value of the fourth octet is 00001011.

Conversion into binary step 11
Conversion into binary step 11

Activity – Binary Game

This is a fun way to learn binary numbers for networking.

Game Link: ht​tps://learningnetwork.cisco.com/docs/DOC-1803

You will need to log in to cisco.com to use this link. It will be necessary to create an account if you do not already have one.

Mobile Download: https://learningnetwork.cisco.com/docs/DOC-11119

IPv4 Addresses

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.

192.168.10.10 is an IP address that is assigned to a computer.

Dotted Decimal Address
Dotted Decimal Address

This address is made up of four different octets.

Octets IP
Octets IP

The computer stores the address as the entire 32-bit data stream.

32-bit Address

Glossary: If you have doubts about any special term, you can consult this computer network dictionary.

Ready to go! Keep visiting our networking course blog, give Like to our fanpage; and you will find more tools and concepts that will make you a networking professional.

More Goodies
Internet-Based Connectivity
Internet-Based Connectivity