Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3). |

**Navigation**

Topics | Help • Register • News • History • How to • Sequences statistics • Template prototypes |

# Binary

**Binary** means composed of two parts or two pieces. It contrasts with unary, ternary, quaternary, and so on. Binary numeral system, a representation for numbers using only two digits (usually, 0 and 1). Thus it is a base 2 numbering system.

Binary is used in computers as a series of "off" and "on" switches. All the data and calculations are binary in nature. A **bit** is a **bi**nary dig**it**. A byte is 8 bits and can hold values between 0 and 255. In binary, each digit's place value is double that of the next digit to the right; the place value of the rightmost digit being 1.

Example: 10110011_{2} = 179_{10}

- from right to left
- 1 → 1 * 2
^{0}= 1 - 1 → 1 * 2
^{1}= 2 - 0 → 0 * 2
^{2}= 0 - 0 → 0 * 2
^{3}= 0 - 1 → 1 * 2
^{4}= 16 - 1 → 1 * 2
^{5}= 32 - 0 → 0 * 2
^{6}= 0 - 1 → 1 * 2
^{7}= 128

So 1 + 2 + 16 + 32 + 128 = 179.

Mersenne numbers when written in binary are all 1's. This makes them repunit numbers. This innate 'binariness' of Mersenne numbers makes calculations in the search for Mersenne primes a bit easier.

Octal (base 8) and hexadecimal (base 16) are other ways that binary may be represented. Two hexadecimal digits (0-F) can show a full byte. Hexadecimal FF = 255 (base 10) = 11111111 binary.