View Single Post
Old 10-25-2006, 07:26 PM   #13
Alex
.
 
Join Date: Feb 2005
Posts: 13,354
Alex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of cool
Binary is easy, just iterate it once.

0 = 0
1 = 1
2 = 10
3 = 11
4 = 100
5 = 101
6 = 110
7 = 111
8 = 1000

and so on.

In base 10 the right most columns are 1s, with up to nine of them. The second are 10s with up to nine of them. So 89 is 8 tens, and 9 ones. Each column to the left multiplies the previous one by 10.

In binary, each column to the left multiplies the previous by 2. So the rightmost column are 1s (up to 1 of them), the next are 2s (up to 1 one of them), the next are 4s (up to 1 of them) and so one.
Spoiler:

So 18 would be one 16, zero 8, zero 4, one 2, and zero 1. 10010
Alex is offline   Submit to Quotes Reply With Quote