2.0 Binary and Number representations

In this chapter we’ll take a first look at different number systems that are essential to every computer engineer. There are quite a few topics to cover, so we’ll start at a shallow level (just enough to get by). The goal of this chapter is to help you understand how different number systems work and relate to computers. By the end of the chapter, you will be able to understand binary numbers, as well as doing calculations with different number systems.

In future chapters, we’ll revisit the majority of these topics, apply them in different scenarios. New concepts will also be introduced that build upon those covered in this lesson.

If you feel like some important concept isn’t covered in a lesson here, or you have a question that isn’t answered in the current lesson, it’s possible that it’s covered in the next lesson.


Why do we need different number systems?

Numbers are a fundamental part of how we describe and understand the world. But why do computers use binary (1s and 0s) instead of the decimal system that we use every day? The answer lies in electrical engineering and how computers physically process information.

Modern computers are built from transistors, which are tiny electronic switches that can either be on or off. Since electrical signals naturally have two distinct states — high voltage (on) and low voltage (off) — it makes sense to represent numbers in a system that aligns with this principle. This is why computers use the binary number system, where each digit (bit) is either 1 (on) or 0 (off).

But binary is just one of many number systems. Hexadecimal and octal number systems are also used because they make it easier to work with large binary numbers.

Let’s dive deeper into number systems and how binary numbers form the foundation of all computing.


Base-10 number system

The standard number system is called base-10, or decimal number system. The decimal number system has 10 number symbols, and they are the following: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

The number of unique symbols (or digits) determines the base of the number system.

The decimal number system is a positional numeral system. This entails that weight of the digit is determined by its position in the number. For example, the number 267 can be written as following:

2 × 102 + 6 × 101 + 7 × 100

Or the number 8600 can be written as following:

8 × 103 + 6 × 102 + 0 × 101 + 0 × 100

Each digit’s value is determined by its position, with its weight represented as a power of 10.


The decimal system can represent 10 values with one digit (0-9). With two digits, it can represent 100 values (0-99).

In a decimal number, the number of different values that can be represented by n digits is 10n, where n is the number of digits.

For example:

  • With 1 digit, it can represent 10 numbers: 101 = 10 (0 to 9).
  • With 2 digits, it can represent 100 numbers: 102 = 100 (0 to 99).
  • With 3 digits, it can represent 1,000 numbers: 103 = 1,000 (0 to 999).

Base-2 number system

Now that we have a basic grasp of how the decimal number system works, we can apply the same logic to all other number systems, but with a key difference in how many symbols are used. While the decimal system uses 10 symbols (0-9), the binary (base-2) numeral system only uses 2 symbols: 0 and 1.

A binary digit, or bit, can only represent two values: 0 (off) or 1 (on). This is because electronic circuits, such as transistors, naturally have two distinct states: high (1) and low (0). This makes the binary system ideal for representing information in electronics, where each bit corresponds to a state of the system; either on or off.

The binary number system is also a positional numeral system. This entails that weight of the digit is determined by its position in the number. But the weight of binary numbers has a base of 2.

For example, the number 1011 can be written as following:

1 × 23 + 0 × 22 + 1 × 21 + 1 × 20

Or the number 1100 can be written as following:

1 × 23 + 1 × 22 + 0 × 21 + 0 × 20


The binary number system can only represent 2 numbers with one bit (0 and 1). But each additional bit doubles the potential representations.

The number of different values that can be represented by n bits is 2n, where n is the number of bits.

For example:

  • 1 bit can represent 2 numbers: 0 and 1 (binary for 0-1 in decimal).
  • 2 bits can represent 4 numbers: 00 to 11 (binary for 0-3 in decimal).
  • 3 bits can represent 8 numbers: 000 to 111 (binary for 0-7 in decimal).
  • 4 bits can represent 16 numbers: 0000 to 1111 (binary for 0-15 in decimal).

The conversion between the two systems can be seen in the following table:

Decimal numberBinary number
00
11
210
311
4100
5101
6110
7111
81000
91001
101010
111011
121100
131101
141110
151111

If this feels hard to grasp, don’t worry. In the next chapter we will delve deeper into the fundamental understanding of number systems.