# Binary

From WLCS

## Binary

Binary code, or **Machine Code**, is the basic, lowest level of communication of data used by computers. It consists of a given number of *bytes* which contain 8 *bits*, or places, each. Binary is base 2 of a number, where all place values are powers of the number 2. For example, the number 3 in binary is 00000011_{2}, because there is one *2* plus one *1*. Notice how 8 *bits* are used.

### 2's Complement

To represent negative integers, **2's complement** is used. This is formed by flipping every bit (*1's compliment*) and adding 1.
For example:

- To find -3
_{10}in base 2: - 3
_{10}= 00000011_{2} - One's complement: 11111100
_{2} - Add one: 11111101
_{2} - ∴ -3
_{10}= 11111101_{2} - Q.E.D.