Convert any decimal number to binary.
42 in binary =
101010
Divide by 2 repeatedly and read the remainders in reverse. 42 = 101010.