Translating Things to Binary

1. Number Systems

All numbers are stored in binary on the computer. Binary numbers are based on powers of 2. You already know a number system based on 10.

Name Based On First Four Columns Digits Available Other Info
Decimal 10 1000, 100, 10, 1 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 based on fingers?
Binary 2 16, 8, 4, 2, 1 0, 1 based on on/off, all data on computer is encoded this way.
Octal 8 512, 64, 8, 1 0, 1, 2, 3, 4, 5, 6, 7 binary can be easily translated to it
Hexadecimal 16 4096, 256, 16, 1 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f colour codes are often stored this way. binary and octal are easily converted to this.

Examples:

Decimal Binary Octal Hexadecimal
10 1010 12 a
201 11001001 311 c9

Counting to 10 in Binary:

Decimal 1 2 3 4 5 6 7 8 9 10
Binary 1 10 11 100 101 110 111 1000 1001 1010

2. Fractions in Binary

The columns also continue into the negatives.

Power of 2 2^4 2^4 2^3 2^2 2^1 2^0 . 2^-1 2^-2 2^-3 2^-4 2^-5 2^-5
Result 16 16 8 4 2 1 . 1/2 1/4 1/8 1/16 1/32 1/32
Decimal Result             . 0.5 0.25 0.125 0.0625 0.03125 0.03125

Thus 101.1011

= 4+1+0.5+0.125+0.0625

=5.6875

3. Converting Between Number Systems

There is a shortcut between base 8 and base 2. Because 2^3=8, 3 columns of binary make one column in octal.

010 011 100 (bin) -> 2 3 4 (oct)

(translate each group of three binary digits to decimal, place them in order and that is the octal).

A similar shortcut exists between base 16 and base 2. Because 2^4 =16, 4 columns of binary is one column in hexadecimal.

0110 0111 1000 (bin) -> 6 7 8 (hex)

In fact, octal and hexadecimal exist because they make binary easier for humans to read.

Multiplicative Method for converting between bases

4. Things to Note

The positional system of writing numbers is extremely clever because it allows you to write infinitely large and small numbers. You just keep adding columns in the direction you'd like.

Zero is very key in the positional system. It BOTH represents nothing and it is a placeholder in a column. Without zero it is hard to tell if the space is meant to mean that the column is blank or the user left a big space. Zero is considered a very important development of the history of numbers.

Our scientific notation uses X10^4 (or whatever) because we use base 10 numbers. In binary the scientific notation uses 2.

You only find base 10 numbers easy because you were taught them first. In Babylonia, they used Base 60 and in Mexico, the Mayans used Base 20. The Babylonian system is still used today for time (minutes and seconds) and angles.

The repeating decimals that appear in a number system occur because of the base. In our base 10 system, fractions with a denominator of 3, 6, 9 repeat because those numbers do not evenly divide into a multiple of 10. In binary, almost everything is a repeating decimal, because only fractions with a denominator of 5 go evenly. In a base 60 system, like the Babylonians used, there are few repeating decimals.