Skip to content
LearnTronics menu

LearnTronics

Math

Math Index

Start with the simplest numbers: 0 and 1

Before doing arithmetic with large numbers, fractions, formulas, or algebra, it helps to understand something very basic: the same quantity can be written in different number systems. The system tells us which digits are available and what each position in a number means.

What does “base” mean?

The base of a number system tells us how many different digit values are used before we move to the next place position.

The number system most people use every day is base 10, also called the decimal system. It uses ten digits:

0 1 2 3 4 5 6 7 8 9

After 9, there is no new single digit available, so we move one place to the left and write 10.

Each place in a base-10 number is worth ten times the place to its right:

ThousandsHundredsTensOnes
103102101100
1000100101

For example, the decimal number 347 means:

(3 × 100) + (4 × 10) + (7 × 1) = 347
The important idea is place value. A digit does not have only one value by itself. Its value also depends on where it is placed in the number.

Base 2: binary

The simplest positional number system uses only two digits:

0    1

This is base 2, usually called binary. After 1 there is no third digit available, so just as decimal moves from 9 to 10, binary moves from 1 to 10.

Binary uses only 0 and 1.
That does not mean binary can represent only two quantities. It means every place in the number can contain only one of those two digits.

Binary place values

In base 2, each place is worth two times the place to its right. The place values are powers of 2:

1286432168421
27262524 23222120

Notice that the rightmost position is still worth 1. Moving one place left doubles the value: 1, 2, 4, 8, 16, 32, 64, 128, and so on.

Reading a binary number

Take the binary number:

10112

The small 2 simply tells us that the number is written in base 2.

Binary digit1011
Place value8421
Contribution8021
8 + 0 + 2 + 1 = 1110

So 1011 in binary represents the same quantity as 11 in decimal.

Counting in binary

The pattern becomes clearer if we simply count upward.

DecimalBinaryWhat happened?
00Starting value
11Last available single binary digit
210Move to the next place
311Both 2 and 1 places are used
4100Move to the next place again
51014 + 1
61104 + 2
71114 + 2 + 1
81000Next power of two
910018 + 1
1010108 + 2
1110118 + 2 + 1
1211008 + 4
1311018 + 4 + 1
1411108 + 4 + 2
1511118 + 4 + 2 + 1
1610000Next power of two
The places 1, 2, 4, 8, 16, 32... are especially important in digital electronics. They appear constantly in memory sizes, counters, registers, addresses, masks, and digital data.

Turning binary into decimal

To convert a binary number to decimal, simply add the place values wherever the binary digit is 1. Ignore positions containing 0.

Example: 110101
The place values are 32, 16, 8, 4, 2, 1.
Binary110101
Place32168421
Use it?YesYesNoYesNoYes
32 + 16 + 4 + 1 = 53

Therefore:

1101012 = 5310

Why electronics likes base 2

A physical electronic circuit can often distinguish two states very reliably: off or on, low or high, false or true. Those two states can be represented by the two binary digits:

BinaryLogicPossible electrical meaning
0FalseLow / off
1TrueHigh / on

That is why the same 0 and 1 that appear in binary arithmetic also appear in digital logic. The mathematics of binary numbers and the TRUE/FALSE ideas used in logic fit together naturally.

One caution: a logic 1 does not necessarily mean exactly 1 volt, and a logic 0 does not necessarily mean exactly 0 volts. In real circuits, the allowable voltage ranges depend on the logic family and power supply. The digits describe logical states, not fixed voltages.

A useful pattern to remember

PowerValue
201
212
224
238
2416
2532
2664
27128
28256
2101024

You do not need to memorize an enormous table, but becoming familiar with the first several powers of 2 makes later work with digital electronics much easier.