Arithmetic of Computers

Arithmetic of Computers

from Tenscope Limited

By using this site, you are accepting "session" cookies, as set out in the site's Privacy Policy
Cookies are also used to remember which page of the book you last viewed, so that when you revisit the site you automatically return to the last page you visited.

Close

Lesson 7

Decimals to Octals

. . . and back again

Page 256

Previous Lesson

Next Lesson


Your answer :
52.3810 = 64.308.
Fine. You have seen that each part of the mixed number is treated separately.
This, to clinch it, is the way to convert a mixed number from decimal to octal, using the mixed number 239.48:
0 r = 3    .48 8)3 r = 5     × 8 8)29 r = 7    3.84 8)239     × 8    6.72     × 8    5.76 giving 239.4810 = 357.378  (rounded).
One thing to remember in changing decimal numbers to octals is that octal numbers are larger than their decimal equivalents, because 8 is a smaller base than 10 - just as it takes more feet than yards to make a mile. However, there is not a direct proportion between octal and decimal values, as you undoubtedly have observed.
Let’s review the actual technique of changing from decimals to octals.
To change a decimal whole number to an octal whole number, first divide the decimal number by 8 and note the remainder opposite the quotient. Then divide the first quotient by 8 and note the remainder, divide the second quotient by 8 and note the remainder, and continue in this fashion until the quotient is 0. The remainders, in reverse order to that in which they were obtained, are the digits of the octal equivalent.
Let’s convert the whole number 27810 to octal:
0 r = 4 8)4 r = 2 8)34 r = 6 8)278  giving 27810 = 4268.
To change a decimal fraction to an octal fraction, multiply the decimal fraction by 8; again multiply the fractional part only of the product by 8, and so on. The successive integers (whole numbers) of the products obtained are the digits of the new octal fraction.
Let us convert the decimal fraction .39510 to an octal fraction.
.395  × 8 3.160  × 8 1.280  × 8 2.240  × 8 1.920 giving .39510 = .31218 = .3128  (rounded).
Octal fractions have a way of going on and on - and, just as with decimal fractions, we need to know how to round them off. A decimal fraction is rounded off by determining the value of the portion of the fraction to the right of the rounding-off point. If this value is less than half the possible value of the place immediately to the right of the rounding-off point, it is dropped. If this value is half or more than half of the possible value of the place immediately to the right of the rounding-off point, the value of the digit in the place immediately to the left of the rounding-off point is increased by one.
In decimal fractions, “half of the possible value” is 5, since 5 is half of the base of the system. In octal fractions, “half of the possible value” is 4, since 4 is half of the base of the system.
The decimal fraction .7536 rounded to three places is .754, since .0006 is more than half the possible value of its place (the place immediately to the right of the rounding-off point). The decimal fraction .7534 rounded to three places is .753 since .0004 is less than half the possible value of its place (the place immediately to the right of the rounding-off point).
The octal fraction .31258 rounded to three places is .3138, since .00058 is more than half the possible value of its place; and the octal fraction .31238 rounded to three places is .3128 since .00038 is less than half the possible value of its place.
The next lesson will discuss the arithmetic of octal numbers.
Turn now to the Self-Test Questions for Lesson 7, in the Appendix.
 

Go to Self-Test Questions


 

Previous Page

Next Page


Editor's Note
We can combine these two methods to obtain a more efficient way of converting a decimal integer to octal. To convert 24410 to octal, look up in Table 2 in the Appendix the power of 8 (=23) which is just larger than the number to be converted (244 in this case). It is 512, which is 29 = 83. Divide the number to be converted by this power of 8, to give, here (244)/(512) = .4765625. Now multiply by 8 and record the integral part of the product; multiply the fractional part by 8 and again record the integral part of the product. Continue in this way until there is no fractional part left. The octal equivalent of the decimal integer is given by writing down the integral parts of the conversion process as they were obtained. Thus
(244)/(512) = .4765625
.4765625  × 8 3.8125000  × 8 6.5000000  × 8 4.0000000
Then
24410 = 3648.

Editor's Note
The number of octal places which can be obtained in converting a decimal fraction is limited by the number of decimal places (not significant digits) given in the fraction, according to the following table:
Decimal Places Octal Places 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 22 20 23
Thus, when converting .66734 to octal, there is no point in carrying the conversion beyond 6 octal places. Likewise, an octal fraction with, say, 7 places, is, on conversion, accurate to only 6 decimal places, and an octal fraction with 22 places is, on conversion, accurate to only 19 decimal places.