jcadima
2/2/2017 - 2:25 PM

Decimal to Binary

Decimal to Binary


- Divide a the number by 2, ignore the remainder, use the closest number that divides by 2
- divide from right to left until 1 is reached
- put a 1 for ODD and 0 for EVEN


Convert 3  to binary:

3 / 2 = 1 

so we have:

 1       3 
 ------------    
 1       1         both are ODD
 
 
 binary has 8 digits:
 0 0 0 0 0 0 0 0 
 
so 3 in binary will be:
 
 
0 0 0 0 0 0 1 1   =  3
 
 
=============================================
 
Convert 14 to Binary

14 / 2 = 7
7 / 2  = 3
3 / 2  = 1

so we have:

1     3     7     14
----------------------
1     1     1     0

8 Digit Binary:

0  0  0  0  1  1  1  0  =  14