answersLogoWhite

0

With computers it is often bit (binary digit) patterns that matter and with octal or hexadecimal numbers it is easy to convert them to binary as each digit is represented by an exact number of binary digits (3 for octal, 4 for hexadecimal) without any waste.

Using *nix access permissions as an example, the basic permissions are split into 3 groups (Owner, Group, World), each with 3 possible permissions (Read, Write and eXecute). These are stored as a bit pattern: if set the permission is granted, if not set permission is not granted. A file with rwxr-x--x (rwx for owner, r-x for group and --x for world) is stored in binary as 111101001 which can be represented in octal easily by reading it in groups of 3 bits: 111101001 → 111 101 001 = 0751, or in hexadecimal by splitting it into groups of 4 bits: 111101001 → 1 1110 1001 = 0x1e9; but to convert it to decimal requires: 256 + 128 + 64 + 32 + 8 + 1 = 489.

Similarly, going the other way: what permissions are represented by 420?

420 to binary:
420 ÷ 2 = 210 r 0
210 ÷ 2 = 105 r 0
105 ÷ 2 = 52 r 1
52 ÷ 2 = 26 r 0
26 ÷ 2 = 13 r 0
13 ÷ 2 = 6 r 1
6 ÷ 2 = 3 r 0
3 ÷ 2 = 1 r 1
1 ÷ 2 = 0 r 1
→ 420 = 110100100 in binary = rw-r--r--

420 in octal is 0644 and in hexadecimal is 0x1a4

0644 to binary: 110 100 100 → 110100100 as before [much quicker and easier]
0x1a4 to binary: 1 1010 0100 → 110100100 again.

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga

Add your answer:

Earn +20 pts
Q: Why are octal or hexadecimal number systems used as shortcut notations?
Write your answer...
Submit
Still have questions?
magnify glass
imp