Binary, Octal, and Hexadecimal Number Systems: A Complete Guide for Electronics and Computer Engineering

Introduction
Number systems are one of the fundamental concepts in digital electronics, computer engineering, programming, and embedded systems. We normally use the decimal number system in our daily lives. However, computers and digital electronic circuits work primarily with the binary number system, which uses only two digits: 0 and 1. To make binary numbers easier for humans to read and work with, engineers frequently use octal and hexadecimal number systems. Understanding these number systems is essential for students, programmers, electronics engineers, embedded-system developers, and anyone working with digital hardware.
In this article, we will learn:
- What a number system is
- Binary number system
- Octal number system
- Decimal number system
- Hexadecimal number system
- Place values and positional notation
- Number-system conversions
- Binary-to-octal conversion
- Binary-to-hexadecimal conversion
- Decimal conversion methods
- Practical electronics applications
- Bits, nibbles, bytes, and registers
- Common mistakes
- Frequently asked questions
What Is a Number System?
A number system is a method used to represent numerical values using a defined set of symbols and a particular base, also called a radix. The base determines how many different digits can be used in the number system. For example, the decimal system has a base of 10 and uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
| Number System | Base | Digits Used |
|---|---|---|
| Binary | 2 | 0, 1 |
| Octal | 8 | 0–7 |
| Decimal | 10 | 0–9 |
| Hexadecimal | 16 | 0–9, A–F |
The most important number systems for digital electronics are binary and hexadecimal, while octal is also useful for understanding binary representation.
Understanding Positional Notation
Number systems use positional notation. The value of a digit depends on its position. Consider the decimal number: 583 Its value is: 5 × 10² + 8 × 10¹ + 3 × 10⁰ Therefore: 500 + 80 + 3 = 583. The same principle applies to binary, octal, and hexadecimal. For any base B, the positional values are: B⁰, B¹, B², B³,….This concept is the foundation for understanding number-system conversions.
Binary Number System
The binary number system is a base-2 number system. It uses only two digits: 0 and 1 Each binary digit is called a bit.

Binary is the fundamental number system used by digital computers and electronic systems.
Example: Consider:101101₂ The subscript 2 indicates that the number is binary.
Its place values are:
| Position | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|---|
| Value | 32 | 16 | 8 | 4 | 2 | 1 |
| Digit | 1 | 0 | 1 | 1 | 0 | 1 |
Therefore:
101101₂
= 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1
= 32 + 8 + 4 + 1
= 45₁₀
So:
101101₂ = 45₁₀
Why Do Digital Systems Use Binary?
Digital electronic circuits are designed around two distinct logic states. These are commonly represented as:
- Logic 0 → LOW
- Logic 1 → HIGH
At the physical level, these states are represented by different voltage ranges rather than necessarily exactly 0 V and 5 V. Transistors can operate as electronic switches, making two-state logic highly practical. This is why binary is used in:
- CPUs
- Microcontrollers
- FPGA systems
- Digital ICs
- Memory devices
- Digital communication
- Embedded systems
- Digital logic circuits
Therefore, binary is often described as the fundamental language of digital electronics.
Binary Counting
Binary counting follows the same concept as decimal counting, but only two digits are available.
Binary counting sequence
| Decimal | Binary |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
| 10 | 1010 |
| 11 | 1011 |
| 12 | 1100 |
| 13 | 1101 |
| 14 | 1110 |
| 15 | 1111 |
After 1111₂, the next number is: 10000₂ which represents decimal 16.
Bits, Nibbles, and Bytes
Binary representation leads to several important terms used in electronics and computing. A bit is a single binary digit. It can have one of two values: 0 or 1
A group of 4 bits is called a nibble. Example: 1010
A group of 8 bits is called a byte. Example: 10101100
Therefore:
| Unit | Number of Bits |
|---|---|
| Bit | 1 |
| Nibble | 4 |
| Byte | 8 |
| 2 Bytes | 16 |
| 4 Bytes | 32 |
| 8 Bytes | 64 |
These concepts are particularly important when working with microcontrollers, processors, memory, and communication protocols.
Octal Number System
The octal number system is a base-8 number system. It uses eight digits: 0, 1, 2, 3, 4, 5, 6, 7. The digits 8 and 9 do not exist in octal.
Example
Consider:725₈ Its value is: 7×8² + 2×8¹ + 5×8⁰
= 7×64 + 2×8 + 5
= 448 + 16 + 5
= 469₁₀
Therefore:
725₈ = 469₁₀
Why Is Octal Related to Binary?
Octal has a direct mathematical relationship with binary:8 = 2³ Therefore, one octal digit corresponds exactly to three binary bits.
| Octal | Binary |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
For example:
572₈ can be converted into binary:
5 → 101
7 → 111
2 → 010
Therefore:
572₈ = 101111010₂
This relationship makes binary-to-octal conversion very easy.
Hexadecimal Number System
The hexadecimal number system is a base-16 number system. It uses 16 symbols: 0–9 and A–F
The letters represent values greater than 9.
| Decimal | Hexadecimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
Hexadecimal Place Values
2AF₁₆ The positional values are: 16², 16¹, 16⁰
Therefore:
2AF₁₆ = 2×16² + A×16¹ + F×16⁰
Since:
A = 10 and F = 15
we get:
= 2×256 + 10×16 + 15
= 512 + 160 + 15
= 687₁₀
Therefore:
2AF₁₆ = 687₁₀
Why Is Hexadecimal So Important?
Hexadecimal has a particularly useful relationship with binary: 16 = 2⁴
Therefore:
One hexadecimal digit represents exactly four binary bits. For example: A₁₆ = 1010₂ and: F₁₆ = 1111₂. This makes hexadecimal extremely useful for representing long binary values in a compact and readable format. For example: 11111111₂ can be written as: FF₁₆ Instead of eight binary digits, we only need two hexadecimal digits.
Binary-to-Decimal Conversion
To convert binary to decimal, multiply each binary digit by its corresponding power of 2. Consider: 110101₂ Write the positional values:
| Digit | 1 | 1 | 0 | 1 | 0 | 1 |
|---|---|---|---|---|---|---|
| Power | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
Therefore:
= 1×32 + 1×16 + 0×8 + 1×4 + 0×2 + 1×1
= 32 + 16 + 4 + 1 = 53
Therefore:
110101₂ = 53₁₀
Decimal-to-Binary Conversion
The standard method is repeated division by 2. Let’s convert: 45₁₀
| Division | Quotient | Remainder |
|---|---|---|
| 45 ÷ 2 | 22 | 1 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Read the remainders from bottom to top: 101101₂ Therefore: 45₁₀ = 101101₂.
Binary-to-Octal Conversion
The shortcut is simple: Group binary digits into sets of three from right to left. Example: 110101101₂ Group the digits: 110 | 101 | 101 Now convert each group: 110 = 6, 101 = 5, 101 = 5 Therefore: 110101101₂ = 655₈
What if the number of bits is not divisible by 3?
Add zeros to the left. Example: 10101₂ Group: 010 | 101 Therefore: 010 = 2, 101 = 5 So: 10101₂ = 25₈.
Octal-to-Binary Conversion
This process is even easier. Replace every octal digit with its corresponding three-bit binary value. Example: 753₈
Convert:7 → 111, 5 → 101, 3 → 011 Therefore: 753₈ = 111101011₂.
Binary-to-Hexadecimal Conversion
For binary-to-hexadecimal conversion: Group the binary digits into sets of four from right to left.
Example: 101101101010₂ Group: 1011 | 0110 | 1010 Convert each group: 1011 = B, 0110 = 6, 1010 = A
Therefore: 101101101010₂ = B6A₁₆.
Hexadecimal-to-Binary Conversion
Replace each hexadecimal digit with its four-bit binary equivalent. Example: 3F7₁₆
Convert: 3 → 0011, F → 1111, 7 → 0111 Therefore: 3F7₁₆ = 001111110111₂. The leading zeros may be omitted when they are not required for a fixed-width representation.
Decimal-to-Octal Conversion
To convert decimal to octal, repeatedly divide by 8. Example: 125₁₀
125 ÷ 8 = 15 remainder 5
15 ÷ 8 = 1 remainder 7
1 ÷ 8 = 0 remainder 1
Read from bottom to top: 175₈ Therefore: 125₁₀ = 175₈.
Binary vs Octal vs Decimal vs Hexadecimal
| Feature | Binary | Octal | Decimal | Hexadecimal |
|---|---|---|---|---|
| Base | 2 | 8 | 10 | 16 |
| Digits | 0–1 | 0–7 | 0–9 | 0–9, A–F |
| Main use | Digital systems | Legacy/specialized | Everyday mathematics | Computing & electronics |
| Bits represented by one digit | 1 | 3 | Not fixed | 4 |
| Compactness | Low | Medium | Medium | High |
| Importance in embedded systems | Very High | Low–Medium | High | Very High |
Quick Reference Table
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
Conclusion
Binary, octal, decimal, and hexadecimal are four important number systems used in mathematics, computing, and electronics. Among them, binary is fundamental to digital hardware, because digital circuits operate using two logical states. Octal provides a compact representation of binary values in groups of three bits, while hexadecimal provides an even more convenient representation by grouping binary data into four-bit sections. For students and engineers working with digital electronics, microcontrollers, embedded systems, processors, FPGA systems, communication protocols, and hardware debugging, a strong understanding of these number systems is essential. Once you become comfortable with number-system conversions, concepts such as binary arithmetic, bit manipulation, registers, memory addressing, logic operations, microcontroller programming, and digital circuit design become much easier to understand. One final example to remember: 255₁₀ = 11111111₂ = 377₈ = FF₁₆ Different representations, same numerical value. That is the fundamental idea behind number systems.
