Numbers in binary system code (base two and computer representation). Numerical conversions.

Introduction into the binary system

Binary numbers. Binary numeral system

In mathematics and digital electronics, a binary number is a number expressed in the binary numeral system, which is a base 2 numeral system. In this system, numeric values are represented using only two different symbols: typically 0 (zero) and 1 (one). The base 2 system is a positional numeric notation with a radix of 2. Binary is the way a computer holds information, the 1's and 0's.

Examples of binary numbers: 01, 10, 001, 010, 011, 100, 101, 110, 111, etc.

The decimal number (denary) system we're all familiar with is a base-ten system, meaning it uses ten distinct digits - 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

Examples of numbers in the decimal system: 1, 2, 3, 10, 101, 304, 579, 2746, 54206, etc.

Counting in binary system

After 0 and 1 comes 10. In fact, whenever a number made up of entirely 1's is reached, an extra digit is added. This is exactly the same thing that happens in the decimal system when a number made up of entirely 9's is reached.

Here are the first 32 (33) numbers expressed in binary and their decimal equivalent:

Decimal numberBinary number
0(10)0(2)
1(10)1(2)
2(10)10(2)
3(10)11(2)
4(10)100(2)
5(10)101(2)
6(10)110(2)
7(10)111(2)
8(10)1000(2)
9(10)1001(2)
10(10)1010(2)
11(10)1011(2)
12(10)1100(2)
13(10)1101(2)
14(10)1110(2)
15(10)1111(2)
16(10)1 0000(2)
17(10)1 0001(2)
18(10)1 0010(2)
19(10)1 0011(2)
20(10)1 0100(2)
21(10)1 0101(2)
22(10)1 0110(2)
23(10)1 0111(2)
24(10)1 1000(2)
25(10)1 1001(2)
26(10)1 1010(2)
27(10)1 1011(2)
28(10)1 1100(2)
29(10)1 1101(2)
30(10)1 1110(2)
31(10)1 1111(2)
32(10)10 0000(2)

As you can see, there are 32 distinct numbers that can be represented on 5 digits or less (1 through 31, as well as 0). This can be also calculated, because 32 = 25. The total quantity of distinct numbers that can be represented in 8 digits is 28 = 256. 1 through 255 as well as 0. So 255 in binary is 11111111. Because binary uses base two as opposed to the decimal base ten, the numbers get larger much more quickly, but they still obey the same principles.


Binary alphabet letters coding


0 and 1. How computers work. Bits and bytes.