Octal
Adapted from Wikipedia · Discoverer experience
Octal is a special way to write numbers, known as a numeral system. Instead of using ten symbols like we do in everyday math (0 through 9), octal uses only eight symbols, from 0 to 7. Each position in an octal number represents a power of 8, similar to how each position in our regular decimal system represents a power of ten.
For example, the octal number 112 means you calculate it like this: 1 × 8² + 1 × 8¹ + 2 × 8⁰, which equals 64 + 8 + 2 = 74 in our usual decimal numbers. This system helps us work with numbers in a way that connects closely to binary numbers, which computers use to process information.
Octal is especially useful because each octal digit matches exactly with three binary digits. This makes it easier to convert between binary and other number systems. For instance, the binary number for 74, which is 1001010, can be grouped as 001 001 010, turning into the octal number 112. This connection makes octal a helpful tool in computer science and engineering.
Multiplication table
The multiplication table for octal numbers shows how different octal digits (0 to 7) multiply together. Each row and column represents one of these digits, and where they meet, you find the product in octal form. This helps in understanding how calculations work in the octal system, which uses base 8 instead of the usual base 10 we use every day.
| × | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 |
| 2 | 2 | 4 | 6 | 10 | 12 | 14 | 16 | 20 |
| 3 | 3 | 6 | 11 | 14 | 17 | 22 | 25 | 30 |
| 4 | 4 | 10 | 14 | 20 | 24 | 30 | 34 | 40 |
| 5 | 5 | 12 | 17 | 24 | 31 | 36 | 43 | 50 |
| 6 | 6 | 14 | 22 | 30 | 36 | 44 | 52 | 60 |
| 7 | 7 | 16 | 25 | 34 | 43 | 52 | 61 | 70 |
| 10 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 100 |
Usage
The octal system is a way to write numbers using only the digits 0 to 7, instead of the usual 0 to 9. Each position in an octal number represents a power of 8, similar to how each position in a decimal number represents a power of 10. For example, the octal number 112 means:
1 × 82 + 1 × 81 + 2 × 80
People have used octal in different ways throughout history. In China, the ancient trigrams from the I Ching correspond to octal digits. Some Native American languages, like the Yuki language in California, also use an octal system because people count the spaces between their fingers instead of the fingers themselves.
In computing, octal was popular in early computers because it works well with systems that process data in groups of three bits. For example, each octal digit represents exactly three binary digits. Even today, octal is sometimes used in computer systems, such as for setting file permissions in Unix systems.
Conversion between bases
To change a number from decimal (the normal way we count) to octal (base 8), you can divide the number by 8 repeatedly and write down the remainders. For example, to turn 125 into octal, you can break it down like this: 125 = 8 × 15 + 5, then 15 = 8 × 1 + 7, and finally 1 = 8 × 0 + 1. Reading the remainders from last to first gives you 175 in octal.
You can also change octal back to decimal by multiplying each digit by a power of 8 and adding the results. For example, the octal number 764 equals 7 × 82 + 6 × 81 + 4 × 80, which is 500 in decimal.
Octal numbers are closely related to binary numbers. Each octal digit matches exactly three binary digits. To turn octal into binary, just change each octal digit to its three-digit binary form. To go from binary to octal, group the binary digits into threes (adding zeroes if needed) and change each group into an octal digit.
| 001 | 010 | 111 | 100 |
| 1 | 2 | 7 | 4 |
| 011 | 100 | . | 010 | 010 |
| 3 | 4 | . | 2 | 2 |
| 1 | 0 | 5 | 7 |
| 001 | 000 | 101 | 111 |
| 0010 | 0010 | 1111 |
| 2 | 2 | F |
| 3 | F | A | 5 |
| 0011 | 1111 | 1010 | 0101 |
| 0 | 011 | 111 | 110 | 100 | 101 |
| 0 | 3 | 7 | 6 | 4 | 5 |
Real numbers
Octal can also represent parts of numbers, just like decimal. Because octal only uses the digits 0 to 7, some fractions in octal repeat, but these patterns are usually simple.
There are special numbers that cannot be written exactly with any number system, whether decimal or octal. The table below shows how some of these numbers look in both decimal and octal.
Main article: irrational numbers
| Decimal base Prime factors of the base: 2, 5 Prime factors of one below the base: 3 Prime factors of one above the base: 11 Other Prime factors: 7 13 17 19 23 29 31 | Octal base Prime factors of the base: 2 Prime factors of one below the base: 7 Prime factors of one above the base: 3 Other Prime factors: 5 13 15 21 23 27 35 37 | ||||
| Fraction | Prime factors of the denominator | Positional representation | Positional representation | Prime factors of the denominator | Fraction |
| 1/2 | 2 | 0.5 | 0.4 | 2 | 1/2 |
| 1/3 | 3 | 0.3333... = 0.3 | 0.2525... = 0.25 | 3 | 1/3 |
| 1/4 | 2 | 0.25 | 0.2 | 2 | 1/4 |
| 1/5 | 5 | 0.2 | 0.1463 | 5 | 1/5 |
| 1/6 | 2, 3 | 0.16 | 0.125 | 2, 3 | 1/6 |
| 1/7 | 7 | 0.142857 | 0.1 | 7 | 1/7 |
| 1/8 | 2 | 0.125 | 0.1 | 2 | 1/10 |
| 1/9 | 3 | 0.1 | 0.07 | 3 | 1/11 |
| 1/10 | 2, 5 | 0.1 | 0.06314 | 2, 5 | 1/12 |
| 1/11 | 11 | 0.09 | 0.0564272135 | 13 | 1/13 |
| 1/12 | 2, 3 | 0.083 | 0.052 | 2, 3 | 1/14 |
| 1/13 | 13 | 0.076923 | 0.0473 | 15 | 1/15 |
| 1/14 | 2, 7 | 0.0714285 | 0.04 | 2, 7 | 1/16 |
| 1/15 | 3, 5 | 0.06 | 0.0421 | 3, 5 | 1/17 |
| 1/16 | 2 | 0.0625 | 0.04 | 2 | 1/20 |
| 1/17 | 17 | 0.0588235294117647 | 0.03607417 | 21 | 1/21 |
| 1/18 | 2, 3 | 0.05 | 0.034 | 2, 3 | 1/22 |
| 1/19 | 19 | 0.052631578947368421 | 0.032745 | 23 | 1/23 |
| 1/20 | 2, 5 | 0.05 | 0.03146 | 2, 5 | 1/24 |
| 1/21 | 3, 7 | 0.047619 | 0.03 | 3, 7 | 1/25 |
| 1/22 | 2, 11 | 0.045 | 0.02721350564 | 2, 13 | 1/26 |
| 1/23 | 23 | 0.0434782608695652173913 | 0.02620544131 | 27 | 1/27 |
| 1/24 | 2, 3 | 0.0416 | 0.025 | 2, 3 | 1/30 |
| 1/25 | 5 | 0.04 | 0.02436560507534121727 | 5 | 1/31 |
| 1/26 | 2, 13 | 0.0384615 | 0.02354 | 2, 15 | 1/32 |
| 1/27 | 3 | 0.037 | 0.022755 | 3 | 1/33 |
| 1/28 | 2, 7 | 0.03571428 | 0.02 | 2, 7 | 1/34 |
| 1/29 | 29 | 0.0344827586206896551724137931 | 0.0215173454106475626043236713 | 35 | 1/35 |
| 1/30 | 2, 3, 5 | 0.03 | 0.02104 | 2, 3, 5 | 1/36 |
| 1/31 | 31 | 0.032258064516129 | 0.02041 | 37 | 1/37 |
| 1/32 | 2 | 0.03125 | 0.02 | 2 | 1/40 |
| Number | Positional representation | |
|---|---|---|
| Decimal | Octal | |
| √2 (the length of the diagonal of a unit square) | 1.414213562373095048... | 1.3240 4746 3177 1674... |
| √3 (the length of the diagonal of a unit cube) | 1.732050807568877293... | 1.5666 3656 4130 2312... |
| √5 (the length of the diagonal of a 1×2 rectangle) | 2.236067977499789696... | 2.1706 7363 3457 7224... |
| φ (phi, the golden ratio = (1+√5)/2) | 1.618033988749894848... | 1.4743 3571 5627 7512... |
| π (pi, the ratio of circumference to diameter of a circle) | 3.141592653589793238462643 383279502884197169399375105... | 3.1103 7552 4210 2643... |
| e (the base of the natural logarithm) | 2.718281828459045235... | 2.5576 0521 3050 5355... |
This article is a child-friendly adaptation of the Wikipedia article on Octal, available under CC BY-SA 4.0.
Safekipedia