# Denary to Binary

## What is binary

Binary is how computers store and represent data. In the computer there are loads of switches with only 2 states on or off. These are represented by ones and zeros. One is on and zero is off.

## What is denary

Denary is a base 10 number system. 256 is a Denary number because it has 6-1, 5-10 and 2-100

which= 256.

## Converting Denary to Binary

Binary numbers are a base 2 numbering system and the decimal places start at 1 and multiply by 2 from right to left e.g 1,2,4,8,16,32,64,128 e.t.c.

Denary numbers are base 10 and the decimal places start at 1 and multiply 10 from right to left e.g 1,10,100,1000

For example to covert 139 to binary you need to ask:

1. is 139=>128 yes it is so put a 1 and subtract 128 from 139 giving you 11
2. is 11=>64 no it isn't so put a 0 and go to the next number
3. is 11=>32 no it isn't so put a 0 and go on to the next number
4. is 11=>16 no it isn't so put a 0 and go on to the next number
5. is 11=>8 yes it is so put a 1 and subtract subtract 8 from 11 which is 3
6. is 3=>4 no it isn't so put a 0 and go on to the next number
7. is 3=>2 yes so put a 1 and subtract 2 from 3 that gives you 1
8. is 1=>1 yes so put a 1 and subtract 1 from 1 giving you 0
So your binary code should be 10001011

## Converting Binary to Denary

To find the Denary number you have to add all base 2 numbers which are represented as 1.

If the Binary code is 10101010 it is.

128+0+32+0+8+0+2+1=170

so the Denary number is 170

## Adding 2 Binary numbers together

Rules: there are rules for this that:

0+1=1 1+0=1 1+1=10 1 1+1=11

10001001+10001001