Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

Why do we use other bases which are neither binary (for computers) nor decimals (for humans)?

Computers end up representing them in binary, and humans strongly prefer getting their decimal representation. Why not stick to these two bases?

share|improve this question
add comment

3 Answers 3

Octal (base-8) and hexadecimal (base-16) numbers are a reasonable compromise between the binary (base-2) system computers use and decimal (base-10) system humans use.

Computers aren't good at multiple symbols, thus base 2 (where you only have 2 symbols) is suitable for them (longer strings are less of a problem). Humans are very good with multiple symbols, but aren't that good in remembering longer strings.

Hex uses the human advantage that they can work with lots of symbols while it is still easily convertible back and forth between base 2, because every hex number represents 4 binary numbers ($16=2^4$). I think hex wins over octal or base-32 because it can easily be used to represent bytes and 16/32/64-bit numbers.

share|improve this answer
2  
As an example, consider Hex values of RGB. It's easy to remember that white is #FFFFFF. It's harder to remember that white is 16777215 in decimal. You want to remove the red component of #EF439A? You get #00439A i.e. you just change the first two digits to 0. In decimal, you'd have to subtract 15663104. Good luck remembering that. –  jmite Jan 25 at 23:14
add comment

We use them for convenience and brevity.

Hex and Oct are really outstanding compressed representations of binary. Hex in particular is well suited to condensed forms of memory addresses. Every oct digit directly maps to 3 binary bits and every hex digit to 4 binary bits. This is a result of the bases (8 and 16) being powers of 2 ($2^3$ and $2^4$). For example, I can write binary $01101001$ as hex $69$ or if I extend it with a leading zero as oct $151$.

So, say you need a 64 bit memory addresses. You can either look at all 64 binary bits, or get it condensed to 16 hex digits. Often you don't need to compare a few addresses to see if their the same or contiguous. Would you rather look at 64 bits or 16 digits?

share|improve this answer
2  
Octal has the benefit of not adding any digit symbols and may have been more practical in the days of 6-bit characters (and common non-power-of-two words, e.g., 12-bit PDP-8, 18-bit PDP-1 [address registers for CDC 6x00], 36-bit PDP-6, 60-bit operand registers for CDC 6x00). The move to octet characters/bytes and power-of-two words makes hexadecimal more attractive. –  Paul A. Clayton Jan 25 at 19:41
add comment

Binary numbers in text are a waste of space.

Decimal shows no relation to powers of $2$. Often the fact that a number is, say $5\cdot 2^n-1$, is more important than how much that is.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.