Binary numbers

Introduction
The binary system lets us manipulate numbers with only values of 0 and 1. Each digit in a binary number is called bit, the number of bits in a binary number defines the highest value possible with this binary number (2^number of digits).

Length and Value
The amount of ones and zeros defines how many bits the number is, so say: 101100 is six bits.

8 bits is equal to 1 byte

The place of the bit defines its value just like in our decimal system.

in decimal our places increase every time by powers of 10: 1, 10, 100, 1000, etc. But in binary, the places are by powers of 2: 1, 2, 4, 8, etc.

Place Value = 2^(Position From Right To Left - 1).

Binary to decimal
To convert binary to decimal, add all of the bit values

10010110 = (128*1)+(64*0)+(32*0)+(16*1)+(8*0)+(4*1)+(2*1)+(1*0)= 128 + 16 + 4 + 2= 150

Decimal to binary
Repeatedly subtract the highest possible power of 2 from your decimal number until 0 is reached, and note all of the used powers of two.

150-128

--128 = 2^7

22-16

--16 = 2^4

6-4

-- 4 = 2^2

2-2

-- 2 = 2^1

0

Then add one to all those powers. Now you have all of the bit places from right to left where a 1 should be, the others are 0.