Like for example,
**PART 1**
while converting a decimal number to octal number, we divide given decimal
number by '8' until we get quotient equal to '0' and write remainders in
reverse order to get corresponding octal number.
consider,
163(decimal)--> 163/8 --> quotient=20(decimal), remainder=3(decimal)
20(decimal) --> 20/8 --> quotient=2(decimal), remainder=4(decimal)
2(decimal) --> 2/8 --> quotient=0(decimal), remainder=2(decimal)
thus,
163(decimal)=243(octal).
**PART 2**
Also,lets check whether above conversion result is right or not!
consider,
243(octal)=[2*8^2](decimal)+[4*8^1](decimal)+[3*8^0](decimal)
=128(decimal)+32(decimal)+3(decimal)
=163(decimal)
,which proves we have done right decimal to octal coversion in **PART 1**
Now, what I don't understand is, how writing remainders as digits works out automatically!
Asked
Active
Viewed 129 times
1
-
It works in the same way as you might find individual digits in decimal using integer division with remainders: $163/10=16$ with remainder $3$, while $16/10=1$ with remainder $6$, and $1/10=0$ with remainder $1$. – Henry Jan 31 '22 at 15:40
1 Answers
2
I am going to try to break this down using your specific example of converting $163$ (decimal) to base eight (octal). The point is, one keeps grouping according to the base, with the remainder at each step becoming the next rightmost digit.
$$\begin{array}{rcl} 163 & =& 8\cdot 20 + 3 \\ &=& 8\cdot(8\cdot 2 + 4) + 3 \\ &=& 8^2\cdot 2 + 8\cdot 4 + 3 \end{array}$$ The last line gives you the octal representation of $163_\rm{ten} = 243_\rm{eight}$ (Two groups of $8^2$, four groups of $8$, and $3$ units).
paw88789
- 40,402