Converting a decimal number to binary is a basic skill in computing and digital electronics. It is necessary to understand Unix permissions (chmod 755 = 111 101 101), network addresses, bitwise operations and the internal representation of data.
The successive division by 2 method is the simplest for converting decimal to binary. Divide the number by 2 repeatedly, note the remainders (0 or 1) at each step, and read the remainders from bottom to top to get the binary representation. Alternatively, you can subtract successive powers of 2.
๐ Formula
๐ Reference table
| Decimal | Binary | Verification |
|---|---|---|
| 0 | 0 | โ |
| 1 | 1 | 1 |
| 5 | 101 | 4+1 |
| 10 | 1010 | 8+2 |
| 15 | 1111 | 8+4+2+1 |
| 16 | 10000 | 16 |
| 42 | 101010 | 32+8+2 |
| 100 | 1100100 | 64+32+4 |
| 255 | 11111111 | 128+64+32+16+8+4+2+1 |