a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment

I use base 16 almost every day - hexadecimal, or hex. It uses digits 0-9 and A-F.

The primary reason to use it is because, in hex, each "digit" represents a 4-bit pattern - and these patterns are position-independent (because 16 is a power of two). Converting any part of a hex number between hexadecimal and binary is a simple matter of replacing the hex digit with the 4-bit pattern which it represents. You can do this with any part of a large number, without having to worry about the values of the other parts. It's really just binary shorthand, once you've memorised the 16 bit-patterns for the digits.

Thus, if you have a memory location (say, holding 16 bits) in a computer which has the hex-number-value of "89AC", you can instantly tell (for example) that the highest bit is set, and the next three are not (because 8 is '1000'); the lowest two bits are not set (because C is '1100'); etc etc.

Sometimes in programming you just need to know which bits are on or off, and nobody wants to look at this (same value, in binary ) : 1000100110101100 or this (same value, in normal base-10) : 35244.