# What are Binary and Hexadecimal Number Systems?

There are three numbering systems that every network engineer needs to know decimal, binary, and hexadecimal. We all know how the decimal system work, so let’s begin with the introduction to the binary system.

A basic understanding of the binary system and how to convert to a decimal system is an essential tool for anyone working as a network engineer. Therefore, you will find a few questions about binary numbers in your next CCNA or CompTIA exam.

### What are binary numbers?

A binary number is part of a numeral system expressed only with 0s and 1s. Importantly, because this is the basis for all binary code. The language in which computer hardware communicates with another piece of hardware.

## Basics of Binary Numbers

Firstly, before I start talking about a good old computer networking conversation. Let’s start by introducing some of the basics of binary calculations. As a kids, we all learn how to use the decimal system. My daugher is 3 years old and already learning to count to 10. This is easy because most of us have 10 fingers so we don’t have to count off the top of our head.

Computer, networking devices, and machines used the binary system because of its simplicity of using only 1s and 0s. For a machine using electrical signals, it’s easier to communicate using only two states. 1 for On and 0 for Off.

All calculations in a computer are based on millions of transistors that are either in an ON or OFF position. In binary, the numbers 0s and 1s do not simply mean that the computer is on or off. To clarify, these ON and OFF signals can be interpreted by devices to achieve a broad range of results.

In order to understand how a computer network works you need to learn how to convert a number from binary to digital or hexadecimal. This is a basic knowledge you need to obtain while learning how to interact with IP Addresses and subnetting in a network.

## How to convert decimal numbers to binary?

Firstly, let’s do a recap. To clarify, binary is a numerical notation system that uses 0s and 1s. Most often, numbers are represented by the Decimal system, which is base 10.

•     Decimal: (deci)mal → (deci) meaning 10. → 110
•     Binary: (bi)nary → (bi) meaning 2. → 12

In the decimal system, there are ten unique numbers from 0 to 9. In the binary system, there are only two unique numbers: 0 and 1. Each number is commonly known as a bit.

If you are preparing for a CCNA or Network+ exam you will need to learn how to convert an IP Address into a binary number. Let’s look at the following example. Use the table to convert from a decimal to a binary number or vice versa. Here is an example.

### Basic Decimal to Binary Conversion Table

Ex. If we want to convert the binary number 10100110 into a decimal form.

Plug the numbers from right to left and add the decimal number shown in the same column. Each column represents the number two raised to an exponent. Moreover, that exponent’s value increasing by one as you move through each of the eight positions.

To clarify, read the table from right to left. In addition, add each column’s value from the decimal row to the value on the previous column: (128+32+4+2) = 166. As you can see, we do not count the bits with a 0 because they’re “turned off.”

In the real world, you can use a calculator to do this conversion.

## How to Convert an IPv4 Address into Binary

Let’s start by understanding what is IPv4 address. IPv4 is a 32-bit number that uniquely identifies a network interface on a machine. That is to say, an IPv4 address is typically written in decimal digits, formatted as four 8-bit long octets or segments separated by periods. In addition, every octet and must be a decimal value between 0 and 255.

For example, I will be using the Decimal to Binary Converting Table to convert the following IPv4 addresses into their binary form.

Now that you understand the binary system let’s move into the hexadecimal system. This numerical system has become a very important element of the computer world. As a result of the rapid increase of network-connected devices. Therefore, due to the necessity to maintain unique identifiers force the industry to include hexadecimal numbers. This new address system is called IPv6.

First, let’s begin by introducing the hexadecimal number system. This numerical system is also known as hex or as base-16 number system. It consists of 16 alphanumeric characters that include a range of numbers from 0 to 9 and a set of alphabet letters from A to F.

An IPv6 address format consists of eight groups or segments of hexadecimal values separated by colons. In addition, the first 64 bits of the IPv6 address are used for routing purposes. It consists of the routing prefix and subnet ID.

The last 64 bits identify the address of the interface or interface ID. In other words, it derived from the physical or MAC address using IEEE’s Extended Unique Identifier (EUI-64) format.

### Convert an IPv6 Address into Decimal or Binary

Similar to IPv4 addresses, you can convert an IPv6 address into the binary system. The following chart will help you simplify the process.

For example, given below is a 128 bit IPv6 address represented in binary format and divided into eight 16-bits blocks:

Each block is then converted into Hexadecimal and separated by ‘:’ symbol:

Even after converting into Hexadecimal format, the IPv6 address remains long. IPv6 provides some rules to shorten the address.

### How to Simplify or Compress an IPv6 Address

In addition to an increase in the supply of IP addresses. IPv6 also addressed some of the IPv4’s weaknesses of an older IP address system. However, this longer type of IP address. Therefore, increasing the difficulty for the network engineer to remember the addresses.

Consequently, a simplifying trick called IPv6 address compression is applied to help network engineers to remember these types of IP addresses. Above all, making it easier to read by the human eye.