★★★ [Tut] Decimal to binary, the easy way. easy as ➀ ➁ ➂
We are used to dealing with the decimal system, 10 characters:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary only uses two characters:
0, 1
Lets start converting, let's pick the Decimal number 43.
Then we make something like this to help with the conversion(when you're pro you can just imagine it in your head):
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
Why these numbers?
- You can create ANY number you want(up to 256) by adding any of these, want 10? add 8 + 2, want 5? add 4 + 1.
So, lets start from the left side.
- Is 43 bigger or equal to 128? No, so we skip to the next number and place a 0 in place of 128, table now looks like this:
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0
- Is 43 bigger or equal to 64? No, so again, we skip to the next number and place a 0 in place of 64, table now looks like this:
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0 | 0
- Is 43 bigger or equal to 32? Yes, so we do 43 - 32 = 11, and put a 1 under 32.
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0 | 0 | 1
Is 11 bigger or equal to 16? No, so 0 goes under 16.
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0 | 0 | 1 | 0
Is 11 bigger or equal to 8? Yes, so 11 - 8 = 3 and 1 goes under 8.
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0 | 0 | 1 | 0 | 1
Is 3 bigger or equal to 4? No, so 0 goes under 4.
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0 | 0 | 1 | 0 | 1 | 0
Is 3 bigger or equal to 2? Yes, so 3 - 2 = 1 and 1 goes under 2.
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0 | 0 | 1 | 0 | 1 | 0 | 1
Is 1 bigger or equal to 1? Yes, 1 goes under 1.
Code:
Code:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
0 | 0 | 1 | 0 | 1 | 0 | 1 | 1
So there you go, 43 is 00101011 in binary, how can we check if this is true?
- Add all the numbers that have a 1 under them.
1 + 2 + 8 + 32 = 43, correct 
Now do this number on your own: 78
Answer (Click to Hide)
Hope this tutorial was helpful.