Using octal (base 8) numbers to represent binary numbers and conversions between these bases


Binary numbers and octal numbers are a big part of a computer or any electronic device. You might think, "What is the difference between a binary numbers, octal numbers, and a regular number?" A regular number uses the base 10 system which are the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Octal numbers uses the base 8 system which are the numbers 0, 1, 2, 3, 4, 5, 6, 7. Binary numbers use the base 2 system and are the numbers 0 and 1. So why do we have so many number systems and what do they help us with in terms of computers? Binary numbers help us in computers because they are the standard system used in computers. A binary number looks like this, 001001101. This might look weird at first and you might think, "Is this the number 1,001,101?" It is not. Both 115 base 8 and 001001101 base 2 equal the number 77. How does 001001101 base 2 and 115 base 8 both equvilate to 77?

Binary numbers are in the base 2 system as mentioned previously. So what exactly does this mean and how does this relate to the 1's and 0's? base 2 uses two numbers, hense the 0 and 1. Why use these numbers? These numbers are used because 0 must be present in any base number to represent nothing. the 1 is used because 1 is a counting number and can go into any number. Lets go back to base 10. base 10 has a lot of place values, the ones, tens, hundreds, thousands, and so on. So as we count the numbers starting at zero they go, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. What happens as you go to ten? You go back to 0 in the ones column and then put a 1 in the tens column. This happens when you go from 99 to 100 as well. In the base 2 system it is the exact same thing that happens with the base 10 system except when you go from 0 to 1 you then go to 10. So what number is 10 in binary. Is it 10? it is actually 2. Just like in base 10 the base 2 system is exponential. The "ones column" in binary is 2^0, the next is 2^1, then 2^2 and so on. So to the previous example of 001001101 is equvalent to (0 * 2^8) + (0 * 2^7) + (1 * 2^6) + (0 * 2^5) + (0 * 2^4) + (1 * 2^3) + (1 * 2^2) + (0 * 2^1) + (1 * 2^0) = 0 + 0 + 64 + 0 + 0 + 8 + 4 + 0 + 1 = 77.

Binary Powers 29282726252423222120
Binary Values 5122561286432168421


What about base 8 or octal? How does 77 become 115? Similar to binary and base 10, octal is a set on numbers. Octal counts from 0-7. When we count and get to 7 we are at the end of the numbers available for us to use. so when we add 1 to 7 we get 10. In the "ones place" for octal is 8^0, the "ten place" is 8^1, and so on. This means it operates the same way as binary. Lets take 115 and figure out how that is 77 then. 115 base 8 = (1 * 8^2) + (1 * 8^1) + (5 * 8^0) = 64 + 8 + 5 = 77. This shows that you can convert any base 10 number into octal or binary or vice versa.

What if we want to get octal into binary? Do we have to convert a binary to base 10 and then to octal or octal to base 10 and then to binary? No we do not have to do this. Octal was created as a shortcut to get binary numbers faster. We know that 77 base 10 = 115 base 8 and 77 base 10 = 001001101 base 2 so does 001001101 base 2 = 115 base 8? Yes it does in fact by the transitive property. But to get from binary to octal or vice versa through base 10 is a long process. So octal is very easy to use with binary. Lets take the binary number 001001101 and break it up into groups of three. When broken up it looks like this 001 | 001 | 101. How does this help us? Octal looks like this when counting, 0, 1, 2, 3, 4, 5, 6, 7. Binary is like this to the same number of spots, 000,001,010,011,100,101,110,111. (For a side by side comparison look at the table at the bottom of the page) Lets take a look at 001 | 001 | 101. 001 = 1, 001 = 1, 101 = 5. So in octal, 001001101 = 115. This works the reverse way too. Lets take the number 324 in octal. 3 = 011, 2 = 010, 4 = 100. In binary 324 octal = 011010100.
Decimal0123456789101112131415
Binary00000101001110010111011110001001101010111100110111101111
Octal012345671011121314151617