Binary is the most basic language of computers. Everything, from simple text to full-length movies can be exepressed using binary. Computers use binary because it is a base 2 numbering system, in which each digit value has a value of one or zero. Thanks to the invention of the transistor, computers can represent binary numbers at an electronics level. Simple operations are implemented on the CPU and use binary values to compute.
Binary numbers are long, though. You need at least eight binary digits to represent a single character. This is where octal is useful, as it can represent an 3-digit binary number using a single octal value. This comes in handy when dealing with integers that are multiples of three bits wide. For example, Unix file permissions are represented by 12 bits, making octal a good choice for writing them.
The process of converting from binary to octal using grouping is fairly simple. Each group of three binary digits corresponds to a single octal digit.
Converting 1011110102
to octal:
0102 = 28
1112 = 78
1012 = 58
Thus, 1011110102 = 5728
Binary | Oct |
---|---|
000 | 0 |
001 | 1 |
010 | 2 |
011 | 3 |
100 | 4 |
101 | 5 |
110 | 6 |
111 | 7 |