KAHIBARO
Discord Login Register
Up
9.2.4 Digital Electronics

9.2.4.1 Binary Numbers

Counting with Two Symbols

Digital electronics is built on a very simple idea, information can be represented using only two symbols. These symbols are usually written as $0$ and $1$. A number system that uses only these two digits is called the binary number system.

In everyday life we normally use the decimal system, which has ten digits, $0$ through $9$. Binary uses base $2$, while decimal uses base $10$. The word base tells us how many different digit symbols are available before we move to the next place value.

In decimal, the place values are powers of $10$:
$$
1,\ 10,\ 100,\ 1000,\ \dots
$$

In binary, the place values are powers of $2$:
$$
1,\ 2,\ 4,\ 8,\ 16,\ 32,\ \dots
$$

So the binary number $1011_2$ means:
$$
1011_2 = 1\cdot 2^3 + 0\cdot 2^2 + 1\cdot 2^1 + 1\cdot 2^0
$$
which gives
$$
1011_2 = 8 + 0 + 2 + 1 = 11_{10}
$$

The small subscript reminds us which base is being used. The notation $1011_2$ means binary, and $11_{10}$ means decimal.

A binary digit is called a bit.
Binary uses only two possible values for each bit, $0$ and $1$.
The place values in binary are powers of $2$, not powers of $10$.

Why Binary Is Used in Electronics

Binary is especially useful in digital circuits because many electronic devices naturally have two stable states. For example, a circuit may have low voltage and high voltage, off and on, or false and true. These physical states can be assigned the symbols $0$ and $1$.

Because of this, binary numbers are not just a mathematical idea. They match the way digital hardware works. A long binary number is simply a pattern of many bits, each bit stored by some physical part of a circuit.

A single bit can represent only two possibilities. With more bits, we can represent more numbers. If we have $n$ bits, the total number of different patterns is:
$$
2^n
$$

For example, with $3$ bits there are:
$$
2^3 = 8
$$
possible patterns:
$$
000,\ 001,\ 010,\ 011,\ 100,\ 101,\ 110,\ 111
$$

Place Value in Binary

Just as decimal numbers are understood by place value, binary numbers are also understood by place value. Consider the binary number $11001_2$. Each position corresponds to a power of $2$.

Binary positionPower of 2Value if bit is 1
leftmost$2^4$$16$
next$2^3$$8$
next$2^2$$4$
next$2^1$$2$
rightmost$2^0$$1$

So:
$$
11001_2 = 1\cdot 16 + 1\cdot 8 + 0\cdot 4 + 0\cdot 2 + 1\cdot 1 = 25_{10}
$$

The rightmost bit is the least significant bit, because it has the smallest place value. The leftmost bit is the most significant bit, because it has the largest place value.

In any binary number, the rightmost place is always $2^0 = 1$.
Moving one place to the left multiplies the place value by $2$.

Counting in Binary

Counting in binary follows the same general rule as decimal counting, when one place is full, we carry to the next place. But in binary, each place can only be $0$ or $1$.

DecimalBinary
00
11
210
311
4100
5101
6110
7111
81000

This pattern is important. After $1$, we cannot write $2$ in binary, because binary has no digit $2$. So we write $10_2$, which means one group of two and zero ones.

A useful way to think of this is that binary counting works like a row of switches. The rightmost switch flips most often, and when it goes from $1$ back to $0$, it causes the next switch to change.

Binary counting as switches

Converting Binary to Decimal

To convert a binary number into decimal, multiply each bit by its power of $2$, then add the results.

Take $101101_2$ as an example:
$$
101101_2 = 1\cdot 2^5 + 0\cdot 2^4 + 1\cdot 2^3 + 1\cdot 2^2 + 0\cdot 2^1 + 1\cdot 2^0
$$

So:
$$
101101_2 = 32 + 0 + 8 + 4 + 0 + 1 = 45_{10}
$$

This method always works because binary is a place value system.

Converting Decimal to Binary

To convert a decimal whole number into binary, one common method is repeated division by $2$. At each step, divide by $2$ and record the remainder. The remainder is always $0$ or $1$.

Convert $13_{10}$ to binary:

Division stepQuotientRemainder
$13 \div 2$$6$$1$
$6 \div 2$$3$$0$
$3 \div 2$$1$$1$
$1 \div 2$$0$$1$

Now read the remainders from bottom to top:
$$
13_{10} = 1101_2
$$

We can check:
$$
1101_2 = 1\cdot 8 + 1\cdot 4 + 0\cdot 2 + 1\cdot 1 = 13
$$

Binary and Powers of Two

Binary numbers are closely connected to powers of two. A binary number with a single $1$ and all other digits $0$ represents a power of $2$.

BinaryDecimal
11
102
1004
10008
1000016
10000032

This is one reason binary is easy for machines. Shifting a binary number one place to the left multiplies it by $2$, as long as the number of available bits is not exceeded.

For example:
$$
101_2 = 5_{10}
$$
and shifting left gives:
$$
1010_2 = 10_{10}
$$

Fixed Number of Bits

In real digital systems, numbers are usually stored using a fixed number of bits, such as $8$, $16$, $32$, or $64$. This limits the range of numbers that can be represented.

With $4$ bits, the smallest unsigned number is:
$$
0000_2 = 0
$$
and the largest is:
$$
1111_2 = 15
$$

So $4$ bits can represent $16$ different values, from $0$ to $15$.

In general, with $n$ bits used for unsigned numbers, the range is:
$$
0 \text{ to } 2^n - 1
$$

For $n$ bits, the number of possible bit patterns is $2^n$.
For unsigned binary numbers, the largest value is $2^n - 1$.

Leading Zeros

Sometimes binary numbers are written with extra zeros on the left. These are called leading zeros. They do not change the value.

For example:
$$
101_2 = 0101_2 = 00000101_2
$$

Leading zeros are useful when all numbers in a system must use the same number of bits. For example, an $8$ bit system may store the decimal number $5$ as:
$$
00000101_2
$$

Binary Fractions

Binary can also represent fractions, just as decimal does. In decimal, places to the right of the point represent:
$$
10^{-1},\ 10^{-2},\ 10^{-3},\dots
$$

In binary, places to the right of the point represent:
$$
2^{-1},\ 2^{-2},\ 2^{-3},\dots
$$

So:
$$
0.1_2 = 2^{-1} = \frac{1}{2}
$$
and
$$
0.01_2 = 2^{-2} = \frac{1}{4}
$$

As an example,
$$
10.11_2 = 1\cdot 2^1 + 0\cdot 2^0 + 1\cdot 2^{-1} + 1\cdot 2^{-2}
$$
which gives
$$
10.11_2 = 2 + 0 + \frac{1}{2} + \frac{1}{4} = 2.75_{10}
$$

For beginners, the main idea is that binary fractions use powers of $2$ on both sides of the binary point.

A Visual View of Place Values

A binary number can be understood as a sum of selected powers of $2$. Each $1$ means that power of $2$ is included, and each $0$ means it is not.

Binary place values for 10110

Connection to Digital Electronics

Binary numbers are the language of digital systems. A sequence of bits can represent a number, a letter, an instruction, or the state of a circuit. In digital electronics, understanding binary is the first step toward understanding logic gates, memory, processors, and communication between devices.

When a circuit reads $1$, it usually means one electrical state, and when it reads $0$, it means another. The exact voltage values depend on the technology, but the binary interpretation remains the same.

Binary is the natural number system for digital electronics because circuits can reliably distinguish two states.
A pattern of bits can represent numerical information directly.

Summary

Binary numbers use base $2$ and only the digits $0$ and $1$. Each position in a binary number has a value equal to a power of $2$. Binary numbers can be converted to decimal by adding powers of $2$, and decimal numbers can be converted to binary by repeated division by $2$. With $n$ bits, there are $2^n$ possible patterns, which is why binary is so important in digital systems.

Up
9.2.4 Digital Electronics

Views: 4

Comments

Please login to add a comment.

Don't have an account? Register now!