In this tutorial you will learn how to convert a number to binary format, and we will also see how to convert binary to decimal numbers.
Steps to Convert Decimal to Binary:
Converting a decimal number to binary involves dividing the decimal number by 2 repeatedly and noting the remainders until the quotient becomes zero. Then, the binary equivalent is formed by arranging the remainders in reverse order. Here’s a step-by-step guide:
- Divide the decimal number by 2: Start by dividing the decimal number by 2.
- Note the remainder: Note the remainder after each division.
- Repeat the process: Continue dividing the quotient by 2 and noting the remainders until the quotient becomes zero.
- Write down the remainders: Write down the remainders in reverse order. This forms the binary equivalent of the decimal number.
Let’s convert the decimal number 22 to binary:
- 22 ÷ 2 = 11 remainder 0
- 11 ÷ 2 = 5 remainder 1
- 5 ÷ 2 = 2 remainder 1
- 2 ÷ 2 = 1 remainder 0
- 1 ÷ 2 = 0 remainder 1
Now, writing down the remainders in reverse order: 11001
Conversion From Binary to Decimal:
10110
is the binary of 22
. Now we will see how we can get back the number from the binary format.
Binary Number | 1 | 0 | 1 | 1 | 0 |
Power of 2 (from the right/end) | 24 | 23 | 22 | 21 | 20 |
Power value (Ignore the zeros columns) | 16 | 4 | 2 |
Sum of 16+4+2 = 22 number from 10110.