Книга: Advanced PIC Microcontroller Projects in C
1.13 Converting Decimal Numbers into Octal
Разделы на этой странице:
1.13 Converting Decimal Numbers into Octal
To convert a decimal number into octal, divide the number repeatedly by 8 and take the remainders. The first remainder is the LSD, and the last remainder is the MSD.
Example 1.17
Convert decimal number 15910 into octal.
Solution 1.17
Dividing the number repeatedly by 8:
159/8 ? 19 Remainder 7 (LSD)
19/8 ? 2 Remainder 3
2/8 ? 0 Remainder 2 (MSD)
The octal number is 2378.
Example 1.18
Convert decimal number 46010 into octal.
Solution 1.18
Dividing the number repeatedly by 8:
460/8 ? 57 Remainder 4 (LSD)
57/8 ? 7 Remainder 1
7/8 ? 0 Remainder 7 (MSD)
The octal number is 7148.
Table 1.3 shows the octal equivalent of decimal numbers 0 to 31.
Table 1.3: Octal equivalent of decimal numbers
Decimal | Octal | Decimal | Octal |
---|---|---|---|
0 | 0 | 16 | 20 |
1 | 1 | 17 | 21 |
2 | 2 | 18 | 22 |
3 | 3 | 19 | 23 |
4 | 4 | 20 | 24 |
5 | 5 | 21 | 25 |
6 | 6 | 22 | 26 |
7 | 7 | 23 | 27 |
8 | 10 | 24 | 30 |
9 | 11 | 25 | 31 |
10 | 12 | 26 | 32 |
11 | 13 | 27 | 33 |
12 | 14 | 28 | 34 |
13 | 15 | 29 | 35 |
14 | 16 | 30 | 36 |
15 | 17 | 31 | 37 |
Оглавление статьи/книги
- 1.1 Introduction
- 1.2 Microcontroller Systems
- 1.3 Microcontroller Features
- 1.4 Microcontroller Architectures
- 1.5 Number Systems
- 1.6 Converting Binary Numbers into Decimal
- 1.7 Converting Decimal Numbers into Binary
- 1.8 Converting Binary Numbers into Hexadecimal
- 1.9 Converting Hexadecimal Numbers into Binary
- 1.10 Converting Hexadecimal Numbers into Decimal
- 1.11 Converting Decimal Numbers into Hexadecimal
- 1.12 Converting Octal Numbers into Decimal
- 1.13 Converting Decimal Numbers into Octal
- 1.14 Converting Octal Numbers into Binary
- 1.15 Converting Binary Numbers into Octal
- 1.16 Negative Numbers
- 1.17 Adding Binary Numbers
- 1.18 Subtracting Binary Numbers
- 1.19 Multiplication of Binary Numbers
- 1.20 Division of Binary Numbers
- 1.21 Floating Point Numbers
- 1.22 Converting a Floating Point Number into Decimal
- 1.23 BCD Numbers
- 1.24 Summary
- 1.25 Exercises
Похожие страницы
- Numbers
- 1.6 Converting Binary Numbers into Decimal
- 1.7 Converting Decimal Numbers into Binary
- 1.8 Converting Binary Numbers into Hexadecimal
- 1.9 Converting Hexadecimal Numbers into Binary
- 1.10 Converting Hexadecimal Numbers into Decimal
- 1.11 Converting Decimal Numbers into Hexadecimal
- 1.12 Converting Octal Numbers into Decimal
- 1.14 Converting Octal Numbers into Binary
- 1.15 Converting Binary Numbers into Octal
- 1.16 Negative Numbers
- 1.17 Adding Binary Numbers