Binary

From WLCS
Revision as of 13:14, 19 September 2008 by PaulClayberg (talk | contribs) (Binary)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 000000112, 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 -310 in base 2:
310 = 000000112
One's complement: 111111002
Add one: 111111012
∴ -310 = 111111012
Q.E.D.