Decimal, Binary, Octal and Hexadecimal Number System

Filter Course


Decimal, Binary, Octal and Hexadecimal Number System

Published by: Dikshya

Published date: 09 Jul 2023

Decimal, Binary, Octal and Hexadecimal Number System

Decimal Number System:

The decimal number system, also known as the base 10 system, is the number system commonly used by humans in everyday life. It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each digit's position in a decimal number represents a power of 10. The rightmost digit in a decimal number represents the ones place, the next digit to the left represents the tens place, then hundreds, thousands, and so on. Each digit is multiplied by the corresponding power of 10 based on its position, and the results are summed to determine the value of the number.

For example:

  • The decimal number 1234 consists of four digits. The digit 4 represents ones (10^0), the digit 3 represents tens (10^1), the digit 2 represents hundreds (10^2), and the digit 1 represents thousands (10^3). Adding these values together, we get 4 * 10^0 + 3 * 10^1 + 2 * 10^2 + 1 * 10^3 = 4 + 30 + 200 + 1000 = 1234.

Octal Number System:

The octal number system, also known as base 8, is a positional numeral system that uses eight digits: 0, 1, 2, 3, 4, 5, 6, and 7. Each digit's position in an octal number represents a power of 8. To understand how octal numbers work, let's look at an example:

In the decimal system: 123 = (1 * 10^2) + (2 * 10^1) + (3 * 10^0) = 100 + 20 + 3

In the octal system: 123 in octal = (1 * 8^2) + (2 * 8^1) + (3 * 8^0) = 64 + 16 + 3 = 83. In this example, the octal number 123 is equivalent to the decimal number 83.

- Converting from decimal to octal: To convert a decimal number to octal, you can divide the decimal number successively by 8 and write down the remainders in reverse order. Keep dividing until the quotient becomes zero.

For example:

Decimal number: 255

Dividing 255 by 8, we get: 255 ÷ 8 = 31 remainder 7 (Write down the remainder 7)

31 ÷ 8 = 3 remainder 7 (Write down the remainder 7)

3 ÷ 8 = 0 remainder 3 (Write down the remainder 3)

The remainders in reverse order are 377, so the decimal number 255 is equivalent to the octal number 377.

- Converting from octal to decimal: To convert an octal number to decimal, you multiply each digit by the corresponding power of 8 and sum up the results.

For example:

Octal number: 642

Calculating the decimal equivalent: (6 * 8^2) + (4 * 8^1) + (2 * 8^0) = 384 + 32 + 2 = 418

So, the octal number 642 is equivalent to the decimal number 418.

Binary Number System:

The binary number system, also known as base 2, is a positional numeral system that uses only two digits: 0 and 1. It is the fundamental number system in computing and digital systems. Each digit's position in a binary number represents a power of 2. To understand how binary numbers work, let's look at an example:

In the decimal system: 1011 = (1 * 10^3) + (0 * 10^2) + (1 * 10^1) + (1 * 10^0) = 1000 + 0 + 10 + 1 = 1011

In the binary system: 1011 in binary = (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (1 * 2^0) = 8 + 0 + 2 + 1 = 11

In this example, the binary number 1011 is equivalent to the decimal number 11. 

Converting from decimal to binary: To convert a decimal number to binary, you can repeatedly divide the decimal number by 2 and write down the remainders in reverse order. Keep dividing until the quotient becomes zero.

For example:

Decimal number: 27

Dividing 27 by 2, we get: 27 ÷ 2 = 13 remainder 1 (Write down the remainder 1)

13 ÷ 2 = 6 remainder 1 (Write down the remainder 1)

6 ÷ 2 = 3 remainder 0 (Write down the remainder 0)

3 ÷ 2 = 1 remainder 1 (Write down the remainder 1)

1 ÷ 2 = 0 remainder 1 (Write down the remainder 1)

The remainders in reverse order are 11011, so the decimal number 27 is equivalent to the binary number 11011.

Converting from binary to decimal: To convert a binary number to decimal, you multiply each digit by the corresponding power of 2 and sum up the results.

For example:

Binary number: 10101

Calculating the decimal equivalent: (1 * 2^4) + (0 * 2^3) + (1 * 2^2) + (0 * 2^1) + (1 * 2^0) = 16 + 0 + 4 + 0 + 1 = 21

So, the binary number 10101 is equivalent to the decimal number 21.

Hexadecimal Number System:

The hexadecimal number system, also known as base 16, is a positional numeral system that uses 16 digits: 0-9 for the first ten digits, and A-F (or a-f) for the remaining six digits. Hexadecimal numbers are commonly used in computer programming, digital systems, and representing large binary values in a more compact form. Each digit's position in a hexadecimal number represents a power of 16.

To understand how hexadecimal numbers work, let's look at an example:

In the decimal system: 58 = (5 * 10^1) + (8 * 10^0) = 50 + 8

In the hexadecimal system: 58 in hexadecimal = (5 * 16^1) + (8 * 16^0) = 80 + 8 = 58

In this example, the hexadecimal number 58 is equivalent to the decimal number 88.

In the hexadecimal system, the digits beyond 9 are represented by letters according to their decimal equivalents:

  • A represents 10
  • B represents 11
  • C represents 12
  • D represents 13
  • E represents 14
  • F represents 15

Converting from decimal to hexadecimal:

To convert a decimal number to hexadecimal, you can repeatedly divide the decimal number by 16 and write down the remainders in reverse order. Keep dividing until the quotient becomes zero. For example:

Decimal number: 255

Dividing 255 by 16, we get: 255 ÷ 16 = 15 remainder 15 (Write down the remainder F)

15 ÷ 16 = 0 remainder 15 (Write down the remainder F)

The remainders in reverse order are FF, so the decimal number 255 is equivalent to the hexadecimal number FF.

Converting from hexadecimal to decimal:

To convert a hexadecimal number to decimal, you multiply each digit by the corresponding power of 16 and sum up the results.

For example:

Hexadecimal number: 3A

Calculating the decimal equivalent: (3 * 16^1) + (A * 16^0) = 48 + 10 = 58

So, the hexadecimal number 3A is equivalent to the decimal number 58.