**⌚ August 22, 2014**

## Number Systems and Binary

In everyday number usage, we use the Hindu-Arabic number system, which is also called the decimal or base 10 number system because it uses ten digits to express values.

0 1 2 3 4 5 6 7 8 9

Beginning with zero, we count in consecutive whole numbers up to nine to specify ten digits. Values greater than 9 are represented using a combination of the existing ten digits. We can create different number systems following the same pattern. For example, a base 5 number system has five digits.

0 1 2 3 4

A base 60 number system, used for counting the seconds on a clock, uses the consecutive whole numbers from 0 to 59.

0 1 2 3 ... 57 58 59

A base 8 system, used in octal notation, has eight digits.

0 1 2 3 4 5 6 7

Computers use a special number system called *binary* to perform their operations. Binary is also known as the base 2 number system because it uses two digits, 0 and 1, to represent values.

0 1

Everything that happens inside a computer’s logic happens in binary by expressing real-world values in zeros and ones. Music, video, text, games, spreadsheets, files, keyboard entry, mouse movements, and more are expressed using the digits 0 and 1 in a wide variety of patterns. Because there are only two digits available, a binary number often requires more binary digits, called *bits*, to express the equivalent value in decimal.

For example,

01001100 01101111 01101111 01101011 00100000 01101111 01110101 01110100 00100001

is the binary representation of the ASCII string,

Look out!

Each 8-bit byte represents one letter or character.

L o o k space o u t ! -------------------------------------------------------------------------------- 01001100 01101111 01101111 01101011 00100000 01101111 01110101 01110100 00100001

We will learn how to convert among binary, numbers, and text later, but for now, understand that computers do not understand languages and letters the way people do. Everything must be broken down into simple parts represented with zeros and ones.

For fun, try using an online ASCII text to binary converter, such as www.easycalculation.com/ascii-hex.php, in order to familiarize yourself with what text looks like when converted to binary.

### –[ SIDENOTE: Whole Numbers. What Are They? ]–

When we count items, such as things in real life, we usually begin with one and count upwards. “One apple,” “two apples,” “three apples,” and so on.

The numbers we use to count with like this are called *natural* or *counting* numbers, and these numbers are said to belong to the set of *natural numbers*. They are positive in value and do not contain decimal parts.

Natural Numbers = { 1, 2, 3, 4, 5, 6, 7, 8,... }

It would be unnatural to begin counting a group of items, such as fingers, at zero — assuming the absence deformities. However, if we include the number zero in the set of natural numbers, we produce a new set of numbers called the set of *whole numbers*.

Whole Numbers = { 0, 1, 2, 3, 4, 5, 6, 7, 8,... }

Since every number system begins at the number zero (for we must have a digit to represent the concept of nothing) we use whole numbers, not natural numbers, to form a number system.

### Subsets

The set of natural numbers contains the same numbers as the set of whole numbers except for zero, so we say that the set of natural numbers is a *subset* of the set of whole numbers. Subsets are expressed using the ⊂ symbol and read as “*is a subset of*.”

{ Natural Numbers } ⊂ { Whole Numbers }

This is read as “The set of natural numbers **is a subset of** the set of whole numbers.” We can express the same sets numerically as,

{ 1, 2, 3,... } ⊂ { 0, 1, 2, 3,... }

Following this logic, we can see that binary, which consists of only two digits, 0 and 1, is a subset of the set of whole numbers.

{ 0, 1 } ⊂ { 0, 1, 2, 3,... }