Good morning friends,
Today we are going to learn how to change decimal numbers to binary numbers using some basic operations.
Conversion steps:
- Divide the number by 8.
- Get the integer quotient for the next iteration.
- Get the remainder for the binary digit.
- Repeat the steps until the quotient is equal to 0.
Example #1
Convert 756210 to octal:
Division by 8 | Quotient | Remainder (decimal) | Remainder (octal) | Digit # |
---|---|---|---|---|
7562/8 | 945 | 2 | 2 | 0 |
945/8 | 118 | 1 | 1 | 1 |
118/8 | 14 | 6 | 6 | 2 |
14/8 | 1 | 6 | 6 | 3 |
So 756210 = 66128
Example #2
Convert 3563110 to hexadecimal :
Division
by 8
|
Quotient
|
Remainder
(decimal)
|
Remainder
(octal)
|
Digit #
|
---|---|---|---|---|
35631/8
|
4453
|
7
|
7
|
0
|
4453/8
|
556
|
5
|
5
|
1
|
556/8
|
69
|
4
|
4
|
2
|
69/8
|
8
|
5
|
5
|
3
|
8/8
|
1
|
0
|
0
|
4
|
So 3563110 = 054578
I hope you have understood that how to change decimal to binary.
#source -Rapidtables