About This Site
Powers and Fractions
Notes About Squares
Repeat Length Again
Intrinsic Nature of Primes
> Other Topics
Other Topics (2)
Two Kinds of Odd
HexadecimalHexadecimal is a wonderful thing. I became familiar with it early on, and have often been glad I knew it. Sure, it's useful mainly for working with computers, but the way I see it, learning a different number base is mind-expanding in much the same way that learning a foreign language is.
Hexadecimal for me occupies about the same place that German does. I know them both pretty well, enough to be comfortable with them, but I never learned to speak them like a native or to think in terms of them. Neither was a large step away from my native language. And, coincidentally, I learned them both at about the same time.
Hexadecimal is also nice because it's in the same language family as binary and octal (all descended from proto-binary, hehe). Once you know one, it's easy to translate to any of the others.
Although the factor structure is very different, 24 vs. 2Χ5, hexadecimal doesn't strike me as very foreign, I think because the base is still an even number. I bet if one really learned to think in foreign bases, it would be amazing. I imagine one would be able to see the numbers and their relationships almost as Platonic ideals, free of any accident of base.
But, it's hard to know where to begin, what number to use as a base. Maybe 13, an odd prime? Or 15, the first odd composite, or 21, an odd composite relatively prime to 10? Or maybe 12 or 24, composite numbers with repeated factors, or 30 or 60, numbers with three different prime factors? Unfortunately, I can't really imagine learning a base beyond 60, there would just be too many symbols.
Now I'm sure you're all inspired to learn hexadecimal. Fortunately, it's easy, pretty much everything I know fits in one little table.
The first thing you need to do is learn the part in bold. The other digits are the same as in decimal, so that's all you need to know to convert single digits from hex to decimal.
Then you need to learn the fourth column, which gives the decimal values for hex digits in the tens place. For example, hexadecimal 90 is decimal 144. If you know that, and can add in your head a little, you can easily convert two-digits numbers (bytes!) from hex to decimal.
If you're enthusiastic, you could learn the fifth column, and even extend the table further, but I've never found it necessary. For example, even though it's an easy one, I just don't know that A00 is 2560 in the same reflexive way I know that A0 is 160. I only included the column because it's striking how many of the values are powers of two and three (sometimes with a zero tacked on).
To convert from decimal to hex, I always just reverse the method above, using a kind of table lookup. For decimal 107, for example, I think, hmm the next number down is hmm 96, which is 60; and 107 - 96 leaves 11, which is B; so the answer is 6B. It would be much more efficient to learn the reverse digit tables, but I've never bothered. I know that 10, 20, and 30 are A, 14, and 1E, and that 100, by amusing coincidence, is 64, but that's all.
So much for conversion.
It's not quite true what I said above, that I never learned to think in terms of hexadecimal. There are a few things that I think of mostly in hex.
So, it's not quite true that I never learned to think in hex. But, there are large gaps in my education. I know the most basic thing a native would know, how to count, but not the next most basic thing, arithmetic. I can sort of fake addition and subtraction, but even there, there's a lot of back-and-forth to decimal; and I can only do multiplication and division in special cases. It's like knowing the vocabulary of a language, but not the grammarand certainly not anything about writing good prose.
For your amusement, here's an example of something a native would know, a table of squares.
Doesn't it just jump right out at you that 9 + 10 = 19?
In Other Bases
Multiplication Table, The
Powers of 2 and 3
Two Kinds of Odd
@ March (2004)